codicent-app-sdk 0.5.5 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/dist/cjs/_virtual/_commonjsHelpers.js +1 -1
  2. package/dist/cjs/_virtual/index19.js +1 -1
  3. package/dist/cjs/_virtual/index20.js +1 -1
  4. package/dist/cjs/_virtual/index4.js +1 -1
  5. package/dist/cjs/_virtual/index5.js +1 -1
  6. package/dist/cjs/components/AiInput.js +1 -1
  7. package/dist/cjs/components/AudioIcon.js +1 -1
  8. package/dist/cjs/components/ChatInput.js +1 -1
  9. package/dist/cjs/components/ChatMessage.js +1 -1
  10. package/dist/cjs/components/CombinedPlaceholderDialog.js +1 -1
  11. package/dist/cjs/components/Footer.js +1 -1
  12. package/dist/cjs/components/GenericJsonRenderer.js +1 -1
  13. package/dist/cjs/components/Header.js +1 -1
  14. package/dist/cjs/components/HtmlView.js +1 -1
  15. package/dist/cjs/components/MessageInput.js +1 -1
  16. package/dist/cjs/components/MessageItem.js +1 -1
  17. package/dist/cjs/components/Profile.js +1 -1
  18. package/dist/cjs/components/Prompt.js +1 -1
  19. package/dist/cjs/components/SnapFooter.js +1 -1
  20. package/dist/cjs/components/TextHeader.js +1 -1
  21. package/dist/cjs/components/TypingIndicator.js +1 -1
  22. package/dist/cjs/components/UploadFile.js +1 -1
  23. package/dist/cjs/components/UrlProcessor.js +1 -1
  24. package/dist/cjs/components/VoiceIcon.js +1 -1
  25. package/dist/cjs/hooks/useAuthState.js +1 -1
  26. package/dist/cjs/hooks/useChat.js +1 -1
  27. package/dist/cjs/hooks/useCodicentState.js +1 -1
  28. package/dist/cjs/hooks/useObserveDataSchemas.js +1 -1
  29. package/dist/cjs/hooks/useTools.js +1 -1
  30. package/dist/cjs/hooks/useUserRoles.d.ts +1 -1
  31. package/dist/cjs/hooks/useUserRoles.d.ts.map +1 -1
  32. package/dist/cjs/hooks/useUserRoles.js +1 -1
  33. package/dist/cjs/node_modules/@fast-csv/format/build/src/formatter/RowFormatter.js +1 -1
  34. package/dist/cjs/node_modules/@fast-csv/format/build/src/index.js +1 -1
  35. package/dist/cjs/node_modules/@fast-csv/format/build/src/types.js +1 -1
  36. package/dist/cjs/node_modules/@fast-csv/parse/build/src/index.js +1 -1
  37. package/dist/cjs/node_modules/@fast-csv/parse/build/src/transforms/RowTransformerValidator.js +1 -1
  38. package/dist/cjs/node_modules/@fast-csv/parse/build/src/types.js +1 -1
  39. package/dist/cjs/node_modules/concat-map/index.js +1 -1
  40. package/dist/cjs/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/cf-rule-ext-xform.js +1 -1
  41. package/dist/cjs/node_modules/fs.realpath/index.js +1 -1
  42. package/dist/cjs/node_modules/fs.realpath/old.js +1 -1
  43. package/dist/cjs/node_modules/glob/common.js +1 -1
  44. package/dist/cjs/node_modules/glob/glob.js +1 -1
  45. package/dist/cjs/node_modules/glob/sync.js +1 -1
  46. package/dist/cjs/node_modules/inflight/inflight.js +1 -1
  47. package/dist/cjs/node_modules/minimatch/minimatch.js +1 -1
  48. package/dist/cjs/node_modules/minimatch/node_modules/brace-expansion/index.js +1 -1
  49. package/dist/cjs/node_modules/react-is/index.js +1 -1
  50. package/dist/cjs/node_modules/safe-buffer/index.js +1 -1
  51. package/dist/cjs/node_modules/scheduler/index.js +1 -1
  52. package/dist/cjs/node_modules/style-to-js/cjs/index.js +1 -1
  53. package/dist/cjs/node_modules/style-to-object/cjs/index.js +1 -1
  54. package/dist/cjs/node_modules/unzipper/node_modules/safe-buffer/index.js +1 -1
  55. package/dist/cjs/node_modules/zip-stream/node_modules/archiver-utils/index.js +1 -1
  56. package/dist/cjs/pages/AppFrame.js +1 -1
  57. package/dist/cjs/pages/Chat.js +1 -1
  58. package/dist/cjs/pages/Compose.js +1 -1
  59. package/dist/cjs/pages/CrmPage.js +1 -1
  60. package/dist/cjs/pages/CrmPagePersistent.js +1 -1
  61. package/dist/cjs/pages/FormAccept.js +1 -1
  62. package/dist/cjs/pages/FormInvite.js +1 -1
  63. package/dist/cjs/pages/Home.js +1 -1
  64. package/dist/cjs/pages/HtmlViewer.js +1 -1
  65. package/dist/cjs/pages/ImageView.js +1 -1
  66. package/dist/cjs/pages/ListPage.js +1 -1
  67. package/dist/cjs/pages/Log.js +1 -1
  68. package/dist/cjs/pages/Login.js +1 -1
  69. package/dist/cjs/pages/Menu.js +1 -1
  70. package/dist/cjs/pages/Purchase.js +1 -1
  71. package/dist/cjs/pages/Sales.js +1 -1
  72. package/dist/cjs/pages/Search.js +1 -1
  73. package/dist/cjs/pages/Snap.js +1 -1
  74. package/dist/cjs/services/codicent.js +1 -1
  75. package/dist/cjs/utils/excelExport.js +1 -1
  76. package/dist/esm/_virtual/_commonjsHelpers.js +1 -1
  77. package/dist/esm/_virtual/index14.js +1 -1
  78. package/dist/esm/_virtual/index17.js +1 -1
  79. package/dist/esm/_virtual/index19.js +1 -1
  80. package/dist/esm/_virtual/index20.js +1 -1
  81. package/dist/esm/_virtual/index4.js +1 -1
  82. package/dist/esm/_virtual/index5.js +1 -1
  83. package/dist/esm/components/AiInput.js +1 -1
  84. package/dist/esm/components/AudioIcon.js +1 -1
  85. package/dist/esm/components/ChatInput.js +1 -1
  86. package/dist/esm/components/ChatMessage.js +1 -1
  87. package/dist/esm/components/CombinedPlaceholderDialog.js +1 -1
  88. package/dist/esm/components/Footer.js +1 -1
  89. package/dist/esm/components/GenericJsonRenderer.js +1 -1
  90. package/dist/esm/components/Header.js +1 -1
  91. package/dist/esm/components/HtmlView.js +1 -1
  92. package/dist/esm/components/MessageInput.js +1 -1
  93. package/dist/esm/components/MessageItem.js +1 -1
  94. package/dist/esm/components/Profile.js +1 -1
  95. package/dist/esm/components/Prompt.js +1 -1
  96. package/dist/esm/components/SnapFooter.js +1 -1
  97. package/dist/esm/components/TextHeader.js +1 -1
  98. package/dist/esm/components/TypingIndicator.js +1 -1
  99. package/dist/esm/components/UploadFile.js +1 -1
  100. package/dist/esm/components/UrlProcessor.js +1 -1
  101. package/dist/esm/components/VoiceIcon.js +1 -1
  102. package/dist/esm/hooks/useAuthState.js +1 -1
  103. package/dist/esm/hooks/useChat.js +1 -1
  104. package/dist/esm/hooks/useCodicentState.js +1 -1
  105. package/dist/esm/hooks/useObserveDataSchemas.js +1 -1
  106. package/dist/esm/hooks/useTools.js +1 -1
  107. package/dist/esm/hooks/useUserRoles.d.ts +1 -1
  108. package/dist/esm/hooks/useUserRoles.d.ts.map +1 -1
  109. package/dist/esm/hooks/useUserRoles.js +1 -1
  110. package/dist/esm/node_modules/@fast-csv/format/build/src/CsvFormatterStream.js +1 -1
  111. package/dist/esm/node_modules/@fast-csv/format/build/src/formatter/index.js +1 -1
  112. package/dist/esm/node_modules/@fast-csv/parse/build/src/CsvParserStream.js +1 -1
  113. package/dist/esm/node_modules/@fast-csv/parse/build/src/parser/index.js +1 -1
  114. package/dist/esm/node_modules/@fast-csv/parse/build/src/transforms/index.js +1 -1
  115. package/dist/esm/node_modules/concat-map/index.js +1 -1
  116. package/dist/esm/node_modules/exceljs/lib/xlsx/xform/sheet/cf-ext/cf-rule-ext-xform.js +1 -1
  117. package/dist/esm/node_modules/fs.realpath/index.js +1 -1
  118. package/dist/esm/node_modules/fs.realpath/old.js +1 -1
  119. package/dist/esm/node_modules/glob/common.js +1 -1
  120. package/dist/esm/node_modules/glob/glob.js +1 -1
  121. package/dist/esm/node_modules/glob/sync.js +1 -1
  122. package/dist/esm/node_modules/inflight/inflight.js +1 -1
  123. package/dist/esm/node_modules/minimatch/minimatch.js +1 -1
  124. package/dist/esm/node_modules/minimatch/node_modules/brace-expansion/index.js +1 -1
  125. package/dist/esm/node_modules/react-is/index.js +1 -1
  126. package/dist/esm/node_modules/scheduler/index.js +1 -1
  127. package/dist/esm/node_modules/style-to-js/cjs/index.js +1 -1
  128. package/dist/esm/node_modules/style-to-object/cjs/index.js +1 -1
  129. package/dist/esm/node_modules/unzipper/node_modules/safe-buffer/index.js +1 -1
  130. package/dist/esm/node_modules/zip-stream/node_modules/archiver-utils/index.js +1 -1
  131. package/dist/esm/pages/AppFrame.js +1 -1
  132. package/dist/esm/pages/Chat.js +1 -1
  133. package/dist/esm/pages/Compose.js +1 -1
  134. package/dist/esm/pages/CrmPage.js +1 -1
  135. package/dist/esm/pages/CrmPagePersistent.js +1 -1
  136. package/dist/esm/pages/FormAccept.js +1 -1
  137. package/dist/esm/pages/FormInvite.js +1 -1
  138. package/dist/esm/pages/Home.js +1 -1
  139. package/dist/esm/pages/HtmlViewer.js +1 -1
  140. package/dist/esm/pages/ImageView.js +1 -1
  141. package/dist/esm/pages/ListPage.js +1 -1
  142. package/dist/esm/pages/Log.js +1 -1
  143. package/dist/esm/pages/Login.js +1 -1
  144. package/dist/esm/pages/Menu.js +1 -1
  145. package/dist/esm/pages/Purchase.js +1 -1
  146. package/dist/esm/pages/Sales.js +1 -1
  147. package/dist/esm/pages/Search.js +1 -1
  148. package/dist/esm/pages/Snap.js +1 -1
  149. package/dist/esm/services/codicent.js +1 -1
  150. package/dist/esm/utils/excelExport.js +1 -1
  151. package/dist/index.d.ts +1 -1
  152. package/package.json +2 -2
@@ -1 +1 @@
1
- import{useState as e,useEffect as s,useCallback as t}from"react";import{chatStore as o}from"../stores/chatStore.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import r from"../utils/logging.js";import"react/jsx-runtime";import"../_virtual/index.js";import"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"../node_modules/exceljs/excel.js";function n(n,a){const{service:i}=n,c=a||n.context.selectedApp||"",[d,l]=e(o.getState(c));s((()=>o.subscribe(c,l)),[c]);const g=t((async()=>{const e=o.getConversationId(c);if(e){console.log("Reloading chat history to check for missed messages...");try{const s=await i.getChatHistory(e),t=o.getMessages(c);return s.length>t.length?(console.log(`Found ${s.length-t.length} missed messages, updating chat...`),o.reset(c),s.forEach(((e,s)=>{const t={id:e.id,sender:s%2==0?"user":"bot",content:e.content};o.addMessage(c,t)})),o.setConversationId(c,e),r("chat-history-reloaded"),!0):(console.log("No missed messages found"),!1)}catch(e){return console.error("Failed to reload chat history:",e),!1}}return!1}),[i,c]),m=t(((e,s=0)=>{if(""===e.trim())return;const t=`$user-msg-${Date.now()}`,n={id:t,sender:"user",content:e},a=d.messages.length>0?d.messages[d.messages.length-1].id:void 0;o.addMessage(c,n),o.setBotTyping(c,!0),r("chat-send");const l=Promise.race([i.chat(e,a,c),new Promise(((e,s)=>{setTimeout((()=>s(new Error("Request timeout - please try again"))),36e4)}))]).then((e=>{const{id:s,content:t}=e,n={id:s,sender:"bot",content:t,isNew:!0};o.setConversationId(c,s),o.addMessage(c,n),o.setBotTyping(c,!1),r("chat-receive"),t.startsWith("Error code: ")&&r("chat-error: "+t)})).catch((async n=>{console.error("Chat error details:",{error:n,message:n?.message,name:n?.name,stack:n?.stack,tempId:t,lastMessageId:a,retryCount:s,timestamp:(new Date).toISOString()});if(0===s&&("AbortError"===n?.name||n?.message?.includes("timeout")||n?.message?.includes("Failed to fetch")||n?.message?.includes("NetworkError")))return console.log("Auto-retrying chat request..."),o.removeMessage(c,t),o.setBotTyping(c,!1),void setTimeout((()=>m(e,s+1)),2e3);function d(){let e="An error occurred while sending the message. Please try again.";if(i.onUnauthorized&&n?.toString().includes("401"))return alert("Session expired. Please log in again."),void i.onUnauthorized();"AbortError"===n?.name||n?.message?.includes("timeout")?(e="Request timed out. Please check your connection and try again.",r("chat-timeout")):n?.message?.includes("HTTP error: 500")?(e="Server error. Please try again in a moment.",r("chat-server-error")):(n?.message?.includes("Failed to fetch")||n?.message?.includes("NetworkError"))&&(e="Network error. Please check your connection and try again.",r("chat-network-error")),console.warn(e),o.removeMessage(c,t),o.setBotTyping(c,!1),r("chat-error")}"AbortError"===n?.name||n?.message?.includes("timeout")||n?.message?.includes("Failed to fetch")||n?.message?.includes("NetworkError")||n?.message?.includes("WebSocket")||n?.message?.includes("SignalR")||n?.message?.includes("Connection")?(console.log("Potential SignalR/connection issue detected, checking for missed messages..."),setTimeout((async()=>{if(await g())return o.removeMessage(c,t),o.setBotTyping(c,!1),console.log("Recovered missed message(s) from server"),void r("chat-recovered");d()}),2e3)):d()}));o.addPendingRequest(c,t,l)}),[i,d.messages,g,c]),u=t((()=>{o.reset(c),o.clearMessages(c),r("new-chat")}),[c]),h=t((e=>{o.reset(c),o.clearMessages(c),r("open-chat"),i.getChatHistory(e).then((e=>{e.forEach(((e,s)=>{const t={id:e.id,sender:s%2==0?"user":"bot",content:e.content};o.addMessage(c,t)}))}))}),[i,c]);return{messages:d.messages,isBotTyping:d.isBotTyping,handleSend:m,newChat:u,openChat:h,reloadChatHistory:g}}export{n as useChat};
1
+ import{useState as e,useEffect as s,useCallback as t}from"react";import{chatStore as o}from"../stores/chatStore.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import r from"../utils/logging.js";import"react/jsx-runtime";import"../_virtual/index.js";import"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"exceljs";function n(n,a){const{service:i}=n,c=a||n.context.selectedApp||"",[d,g]=e(o.getState(c));s((()=>o.subscribe(c,g)),[c]);const l=t((async()=>{const e=o.getConversationId(c);if(e){console.log("Reloading chat history to check for missed messages...");try{const s=await i.getChatHistory(e),t=o.getMessages(c);return s.length>t.length?(console.log(`Found ${s.length-t.length} missed messages, updating chat...`),o.reset(c),s.forEach(((e,s)=>{const t={id:e.id,sender:s%2==0?"user":"bot",content:e.content};o.addMessage(c,t)})),o.setConversationId(c,e),r("chat-history-reloaded"),!0):(console.log("No missed messages found"),!1)}catch(e){return console.error("Failed to reload chat history:",e),!1}}return!1}),[i,c]),m=t(((e,s=0)=>{if(""===e.trim())return;const t=`$user-msg-${Date.now()}`,n={id:t,sender:"user",content:e},a=d.messages.length>0?d.messages[d.messages.length-1].id:void 0;o.addMessage(c,n),o.setBotTyping(c,!0),r("chat-send");const g=Promise.race([i.chat(e,a,c),new Promise(((e,s)=>{setTimeout((()=>s(new Error("Request timeout - please try again"))),36e4)}))]).then((e=>{const{id:s,content:t}=e,n={id:s,sender:"bot",content:t,isNew:!0};o.setConversationId(c,s),o.addMessage(c,n),o.setBotTyping(c,!1),r("chat-receive"),t.startsWith("Error code: ")&&r("chat-error: "+t)})).catch((async n=>{console.error("Chat error details:",{error:n,message:n?.message,name:n?.name,stack:n?.stack,tempId:t,lastMessageId:a,retryCount:s,timestamp:(new Date).toISOString()});if(0===s&&("AbortError"===n?.name||n?.message?.includes("timeout")||n?.message?.includes("Failed to fetch")||n?.message?.includes("NetworkError")))return console.log("Auto-retrying chat request..."),o.removeMessage(c,t),o.setBotTyping(c,!1),void setTimeout((()=>m(e,s+1)),2e3);function d(){let e="An error occurred while sending the message. Please try again.";if(i.onUnauthorized&&n?.toString().includes("401"))return alert("Session expired. Please log in again."),void i.onUnauthorized();"AbortError"===n?.name||n?.message?.includes("timeout")?(e="Request timed out. Please check your connection and try again.",r("chat-timeout")):n?.message?.includes("HTTP error: 500")?(e="Server error. Please try again in a moment.",r("chat-server-error")):(n?.message?.includes("Failed to fetch")||n?.message?.includes("NetworkError"))&&(e="Network error. Please check your connection and try again.",r("chat-network-error")),console.warn(e),o.removeMessage(c,t),o.setBotTyping(c,!1),r("chat-error")}"AbortError"===n?.name||n?.message?.includes("timeout")||n?.message?.includes("Failed to fetch")||n?.message?.includes("NetworkError")||n?.message?.includes("WebSocket")||n?.message?.includes("SignalR")||n?.message?.includes("Connection")?(console.log("Potential SignalR/connection issue detected, checking for missed messages..."),setTimeout((async()=>{if(await l())return o.removeMessage(c,t),o.setBotTyping(c,!1),console.log("Recovered missed message(s) from server"),void r("chat-recovered");d()}),2e3)):d()}));o.addPendingRequest(c,t,g)}),[i,d.messages,l,c]),u=t((()=>{o.reset(c),o.clearMessages(c),r("new-chat")}),[c]),h=t((e=>{o.reset(c),o.clearMessages(c),r("open-chat"),i.getChatHistory(e).then((e=>{e.forEach(((e,s)=>{const t={id:e.id,sender:s%2==0?"user":"bot",content:e.content};o.addMessage(c,t)}))}))}),[i,c]);return{messages:d.messages,isBotTyping:d.isBotTyping,handleSend:m,newChat:u,openChat:h,reloadChatHistory:l}}export{n as useChat};
@@ -1 +1 @@
1
- import{useState as o,useRef as t,useCallback as e,useEffect as s}from"react";import p from"./useStateWithLocalStorage.js";import"../services/codicent.js";import"../components/Markdown.js";import"../components/Textarea.js";import"../components/Button.js";import"../components/CompoundButton.js";import"react/jsx-runtime";import"@fluentui/react-components";import"../components/Spinner.js";import"../components/TextHeader.js";import"../components/TypingIndicator.js";import"../components/Dialog.js";import"../components/ChatInput.js";import"../components/CombinedPlaceholderDialog.js";import"../components/ChatMessage.js";import"../components/Header.js";import"@fluentui/react-icons";import{getConfigValue as r}from"../config/index.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"../node_modules/exceljs/excel.js";import"./useLocalization.js";import"./useAppStyles.js";import"../components/FileThumbnail.js";import"../components/MessageInput.js";import"../components/UploadFile.js";import"../components/SnapFooter.js";import"../components/Profile.js";import"../components/MessageItem.js";import"../components/Content.js";import"../components/AiInput.js";import"../components/SearchBox.js";import"../components/DataMessagePicker.js";import"../components/HtmlView.js";import"../components/Footer.js";import"../components/Page.js";import"../components/QrCodeDialog.js";import"../components/QrScanner.js";import"../components/OfflineMessage.js";import"../components/LanguageSelector.js";import"../components/ListView.js";import"../components/RecordModal.js";import"../components/BulkUploadDialog.js";import"../components/CookieBanner.js";import"../pages/AppFrame.js";import"../pages/Canvas.js";import"../pages/Chat.js";import"../pages/Compose.js";import"../pages/Snap.js";import"../pages/Search.js";import"../pages/Menu.js";import"../pages/Log.js";import"../pages/Login.js";import"../pages/Home.js";import"../pages/ListPage.js";import"../pages/CrmPage.js";import"../pages/CrmPagePersistent.js";import"../pages/ImageView.js";import"../pages/FormInvite.js";import"../pages/FormAccept.js";import"../pages/Sales.js";import"react-router-dom";import"../pages/Purchase.js";import"../pages/QrScan.js";import"react-dom/client";import"../node_modules/@auth0/auth0-react/dist/auth0-react.esm.js";const i=i=>{const[m,n]=p("APP_WELCOME_STATE_TEXT_"+i.context.selectedApp,""),[a,c]=p("CODICENT_STATE_LAST_TIMESTAMP_"+i.context.selectedApp,0),{service:j,current:l}=i,[g,u]=o(!1),d=t(!1),T=e((async()=>{if(!d.current){d.current=!0;try{const o=await j.getMessagesFast(r("LOGBOOK_TAGS").split(",").filter((o=>"chat"!==o))),t=o.length>0?o[0].createdAt.getTime():a;if(t>a){c(t),u(!0);const o=await j.chat(r("WELCOME_STATUS_PROMPT"));n(o.content)}}finally{u(!1),d.current=!1}}}),[j,a,c,n]),S=e((()=>{j&&r("CHAT_INSTRUCTIONS")}),[j]);return s((()=>{l===i.allStates.hasAccess&&r("WELCOME_STATUS_PROMPT")?(T(),S()):r("WELCOME_STATUS_PROMPT")||n("")}),[l,i,T,S,n]),{welcomeStatusText:m,updating:g}};export{i as default};
1
+ import{useState as o,useRef as t,useCallback as e,useEffect as s}from"react";import p from"./useStateWithLocalStorage.js";import"../services/codicent.js";import"../components/Markdown.js";import"../components/Textarea.js";import"../components/Button.js";import"../components/CompoundButton.js";import"react/jsx-runtime";import"@fluentui/react-components";import"../components/Spinner.js";import"../components/TextHeader.js";import"../components/TypingIndicator.js";import"../components/Dialog.js";import"../components/ChatInput.js";import"../components/CombinedPlaceholderDialog.js";import"../components/ChatMessage.js";import"../components/Header.js";import"@fluentui/react-icons";import{getConfigValue as r}from"../config/index.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"exceljs";import"./useLocalization.js";import"./useAppStyles.js";import"../components/FileThumbnail.js";import"../components/MessageInput.js";import"../components/UploadFile.js";import"../components/SnapFooter.js";import"../components/Profile.js";import"../components/MessageItem.js";import"../components/Content.js";import"../components/AiInput.js";import"../components/SearchBox.js";import"../components/DataMessagePicker.js";import"../components/HtmlView.js";import"../components/Footer.js";import"../components/Page.js";import"../components/QrCodeDialog.js";import"../components/QrScanner.js";import"../components/OfflineMessage.js";import"../components/LanguageSelector.js";import"../components/ListView.js";import"../components/RecordModal.js";import"../components/BulkUploadDialog.js";import"../components/CookieBanner.js";import"../pages/AppFrame.js";import"../pages/Canvas.js";import"../pages/Chat.js";import"../pages/Compose.js";import"../pages/Snap.js";import"../pages/Search.js";import"../pages/Menu.js";import"../pages/Log.js";import"../pages/Login.js";import"../pages/Home.js";import"../pages/ListPage.js";import"../pages/CrmPage.js";import"../pages/CrmPagePersistent.js";import"../pages/ImageView.js";import"../pages/FormInvite.js";import"../pages/FormAccept.js";import"../pages/Sales.js";import"react-router-dom";import"../pages/Purchase.js";import"../pages/QrScan.js";import"react-dom/client";import"../node_modules/@auth0/auth0-react/dist/auth0-react.esm.js";const i=i=>{const[m,n]=p("APP_WELCOME_STATE_TEXT_"+i.context.selectedApp,""),[a,c]=p("CODICENT_STATE_LAST_TIMESTAMP_"+i.context.selectedApp,0),{service:j,current:l}=i,[g,u]=o(!1),d=t(!1),T=e((async()=>{if(!d.current){d.current=!0;try{const o=await j.getMessagesFast(r("LOGBOOK_TAGS").split(",").filter((o=>"chat"!==o))),t=o.length>0?o[0].createdAt.getTime():a;if(t>a){c(t),u(!0);const o=await j.chat(r("WELCOME_STATUS_PROMPT"));n(o.content)}}finally{u(!1),d.current=!1}}}),[j,a,c,n]),S=e((()=>{j&&r("CHAT_INSTRUCTIONS")}),[j]);return s((()=>{l===i.allStates.hasAccess&&r("WELCOME_STATUS_PROMPT")?(T(),S()):r("WELCOME_STATUS_PROMPT")||n("")}),[l,i,T,S,n]),{welcomeStatusText:m,updating:g}};export{i as default};
@@ -1 +1 @@
1
- import t from"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"react/jsx-runtime";import"react";import"../_virtual/index.js";import"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"../node_modules/exceljs/excel.js";function e({service:e}){return{getSchemas:async()=>{const o=await e.getMessagesFast(["schema"]),a={};for(const e of o){let{tags:o,content:s,mentions:r}=new t(e.content);o=o.map((t=>"#"+t)),r=r.map((t=>"@"+t));let i=o.find((t=>"#schema"!==t&&"#data"!==t));if(!i)continue;i=i.replace("#tag_","").replace("#","");const n=s,c=r.length>0?r[0].replace("@",""):"default";try{const t=JSON.parse(n);if(!t)continue;a[c]||(a[c]={}),a[c][i]=t}catch{continue}}return a},createDefaultDataFromSchema:t=>{const e={};for(const o in t.properties){const a=t.properties[o];e[o]=void 0!==a.default?a.default:""}return e}}}export{e as default,e as useObserveDataSchemas};
1
+ import t from"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"react/jsx-runtime";import"react";import"../_virtual/index.js";import"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"exceljs";function e({service:e}){return{getSchemas:async()=>{const o=await e.getMessagesFast(["schema"]),a={};for(const e of o){let{tags:o,content:s,mentions:r}=new t(e.content);o=o.map((t=>"#"+t)),r=r.map((t=>"@"+t));let i=o.find((t=>"#schema"!==t&&"#data"!==t));if(!i)continue;i=i.replace("#tag_","").replace("#","");const n=s,c=r.length>0?r[0].replace("@",""):"default";try{const t=JSON.parse(n);if(!t)continue;a[c]||(a[c]={}),a[c][i]=t}catch{continue}}return a},createDefaultDataFromSchema:t=>{const e={};for(const o in t.properties){const a=t.properties[o];e[o]=void 0!==a.default?a.default:""}return e}}}export{e as default,e as useObserveDataSchemas};
@@ -1 +1 @@
1
- import{useMemo as e}from"react";import{getConfigValue as t}from"../config/index.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"react/jsx-runtime";import"../_virtual/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import{getGpsLocation as s}from"../utils/device.js";import"../node_modules/exceljs/excel.js";const a=(a,r=e=>{console.log(e)},i=e=>{console.log(e)},n,o,p=()=>{console.log("stopVoiceSession")},c)=>e((()=>{const e=[],d=(t,s)=>{e.push({definition:t,handler:s})},m=async()=>{const e=t("APP_CONFIG"),s=t("APP_BUTTONS");return[...s&&e.apps[s]?e.apps[s].tasks:[],...await a.getAppTasks()]};d({name:"stop_voice_session",description:"Stops the voice session.",parameters:{type:"object",properties:{}}},(async()=>(console.log("TOOL: stop_voice_session"),r(void 0),p(),{ok:!0}))),d({name:"inject_script",description:"Injects a script into the html/canvas view.",parameters:{type:"object",properties:{script:{type:"string",description:"The script to inject"}},required:["script"]}},(async({script:e})=>(console.log("TOOL: inject_script",e),i(e),{ok:!0}))),d({name:"post_codicent_message",description:"Posts a message to Codicent, only when requested by the user.",parameters:{type:"object",properties:{content:{type:"string",description:'The codicent message text, e.g. "remember to call Linda"'},parent_id:{type:"string",description:'The parent message id of a previous message that you will add a new revision to, by setting parent_id to the origin message being "edited"'}},required:["content"]}},(async({content:e,parent_id:t})=>await a.sendMessage(e,t))),d({name:"update_codicent_message",description:"Posts an edited message, which replaces the old message.",parameters:{type:"object",properties:{content:{type:"string",description:'The updated codicent message text, e.g. "remember to call Johan", usually including the tags from the original message.'},parent_id:{type:"string",description:"The message id of a previous/old message to be updated."}},required:["content","parent_id"]}},(async({content:e,parent_id:t})=>await a.sendMessage(e,t))),d({name:"get_messages_list",description:"Gets messages tagged with given tag name, optionally limited by num_messages. The messages are listed in chronological order, latest first.",parameters:{type:"object",properties:{num_messages:{type:"integer",description:"The number of matching messages to return"},search_text:{type:"string",description:"Search text to filter messages by"},tag_name:{type:"string",description:"Name of tag to find messages by"},after_timestamp:{type:"string",description:"Only return messages after this timestamp"},before_timestamp:{type:"string",description:"Only return messages before this timestamp"}},required:["num_messages"]}},(async({num_messages:e,search_text:t,tag_name:s,after_timestamp:r,before_timestamp:i})=>{let n=await a.getMessages(s?[s]:[],void 0,e);t&&(n=n.filter((e=>e.content.includes(t)))),r&&(n=n.filter((e=>e.createdAt>r))),i&&(n=n.filter((e=>e.createdAt<i)));const o=n.slice(0,e);return console.log("get_messages_list result:",o),o})),d({name:"chat_with_codicent_ai",description:"Sends a message to Codicent AI and gets a response message back. Remember that you can always ask codicent via this tool to find out more about what you can achieve from chatting with the codicent AI.",parameters:{type:"object",properties:{message:{type:"string",description:"Text of message to the codicent"}},required:["message"]}},(async({message:e})=>await a.chat(e))),d({name:"create_todo",description:"Saves a todo message in Codicent.",parameters:{type:"object",properties:{text:{type:"string",description:"Text of todo"}},required:["text"]}},(async({text:e})=>await a.sendMessage("#todo "+e))),d({name:"place_order",description:"Places and order with the Codicent AI.",parameters:{type:"object",properties:{message:{type:"string",description:"The text message of the order as spoken by the user."}},required:["message"]}},(async({message:e})=>await a.sendMessage(`#do Jag kommer ge dig en text (nedan) på vad jag ska beställa. Använd bara den text du får av mig, inga tools.\n Du ska skapa en tabell med detaljerad information inklusive lagerstatus \n för varje artikel i beställningen. Svara först när du har all info på plats. Ställ inga frågor på vägen utan använd det du får av mig.\n \n ----\n EXEMPEL PÅ SVAR:\n ----\n Här är en tabell med detaljerad information inklusive lagerstatus för varje artikel i beställningen:\n \n Artikel\tHyresobjekt\tNamn\tLagertyp\tGrupp\tNamn.1\tSRA/SBEF\tLeverantör\tLevnr\tDepå\tLager\tReserverat\tUthyrt nu\tTillgängligt nu\tMärke/typ\tTillverkarnr\tTillv.år\tInköpsdato\tInköpspris\tVikt\n Elverk\t12345\tElverk 1\tHyresobjekt\tMaskiner\tElverk\tSRA\tLeverantör A\t001\tDepå 1\t5\t0\t1\t4\tHonda EU22i\t123456\t2020\t2020-01-01\t10000 SEK\t21 kg\n Elverk\t12345\tElverk 2\tHyresobjekt\tMaskiner\tElverk\tSRA\tLeverantör B\t002\tDepå 2\t3\t0\t1\t2\tYamaha EF2000iS\t654321\t2019\t2019-05-01\t9000 SEK\t20 kg\n Observera att denna tabell är baserad på den information som finns tillgänglig i lagerstatusen. Om du behöver ytterligare detaljer eller om något specifikt saknas, vänligen meddela mig.\n ----\n \n --- här följer texten på vad jag vill beställa ---\n \n \n ${e}`))),d({name:"remember_info",description:"Saves info in your internal memory for future use. Use this tool to save insights on how to perform our conversations and tasks related to them.",parameters:{type:"object",properties:{message:{type:"string",description:"Your insights to improve our future conversations."}},required:["message"]}},(async({message:e})=>await a.sendMessage(`#index #insights\n\n${e}`))),d({name:"save_to_crm",description:"Saves CRM related info to your memory (logbook).",parameters:{type:"object",properties:{message:{type:"string",description:"CRM log entry description/contents."},company:{type:"string",description:"Company name for CRM log entry."},contact:{type:"string",description:"Contact name for CRM log entry."}},required:["message","company"]}},(async({message:e,company:t,contact:s})=>await a.sendMessage(`#crm\n\nFöretag: ${t}\n\nInfo: ${e}${s?"\n\nKontakt: "+s:""}`))),d({name:"set_page_html",description:"Sets the innerHtml of the div covering the full app page. You can display any html/javascript/style/mermaid content here for the user to see ;-). This view is usually referred to as the canvas, or tavlan in Swedish.",parameters:{type:"object",properties:{html:{type:"string",description:"The inner html to set the page to."}},required:["html"]}},(async({html:e})=>(r(e),n.play(),{ok:!0}))),d({name:"hide_page_html",description:"Hides the inner html of the page.",parameters:{type:"object",properties:{}}},(async()=>(r(void 0),{ok:!0}))),d({name:"get_page_html",description:"Gets the inner html of the page.",parameters:{type:"object",properties:{}}},(async()=>({html:o}))),d({name:"get_tasks",description:"Gets the list of possible tasks that can be performed. This lists task names and their id:s. Use get_task to get the task instructions given a task id.",parameters:{type:"object",properties:{},required:[]}},(async e=>(await m()).map((e=>({id:e.id,name:e.title}))))),d({name:"get_task",description:"Gets the task instructions for a given task id. Use get_tasks to get a list of possible tasks (with their id:s).",parameters:{type:"object",properties:{task_id:{type:"string",description:"The task id to get instructions for."}},required:["task_id"]}},(async({task_id:e})=>{const t=(await m()).find((t=>t.id===e));return t?t.content:"Task not found"})),d({name:"get_chat_conversation",description:"Gets a chat conversation (message thread) by message ID. Returns all messages in the conversation thread in chronological order.",parameters:{type:"object",properties:{message_id:{type:"string",description:"The ID of any message in the conversation to retrieve the full thread."}},required:["message_id"]}},(async({message_id:e})=>{try{return{ok:!0,messages:await a.getChatHistory(e)}}catch(e){return{ok:!1,error:e.message||"Failed to get chat conversation"}}})),d({name:"get_gps_location",description:"Gets the current GPS location of the device. Returns latitude and longitude coordinates. Use this when the user asks about nearby places, directions, or anything location-dependent.",parameters:{type:"object",properties:{},required:[]}},(async e=>{try{const e=await s();return e?{ok:!0,latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy}:{ok:!1,error:"GPS not available"}}catch{return{ok:!1,error:"Failed to get GPS location"}}}));const{additionalTools:l=[],mergeStrategy:g="merge"}=c||{};return"replace"===g?l:"builtin-only"===g?e:[...e,...l]}),[a,r,i,o,n,c]);export{a as default};
1
+ import{useMemo as e}from"react";import{getConfigValue as t}from"../config/index.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"react/jsx-runtime";import"../_virtual/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import{getGpsLocation as s}from"../utils/device.js";import"exceljs";const a=(a,r=e=>{console.log(e)},i=e=>{console.log(e)},n,o,p=()=>{console.log("stopVoiceSession")},c)=>e((()=>{const e=[],d=(t,s)=>{e.push({definition:t,handler:s})},m=async()=>{const e=t("APP_CONFIG"),s=t("APP_BUTTONS");return[...s&&e.apps[s]?e.apps[s].tasks:[],...await a.getAppTasks()]};d({name:"stop_voice_session",description:"Stops the voice session.",parameters:{type:"object",properties:{}}},(async()=>(console.log("TOOL: stop_voice_session"),r(void 0),p(),{ok:!0}))),d({name:"inject_script",description:"Injects a script into the html/canvas view.",parameters:{type:"object",properties:{script:{type:"string",description:"The script to inject"}},required:["script"]}},(async({script:e})=>(console.log("TOOL: inject_script",e),i(e),{ok:!0}))),d({name:"post_codicent_message",description:"Posts a message to Codicent, only when requested by the user.",parameters:{type:"object",properties:{content:{type:"string",description:'The codicent message text, e.g. "remember to call Linda"'},parent_id:{type:"string",description:'The parent message id of a previous message that you will add a new revision to, by setting parent_id to the origin message being "edited"'}},required:["content"]}},(async({content:e,parent_id:t})=>await a.sendMessage(e,t))),d({name:"update_codicent_message",description:"Posts an edited message, which replaces the old message.",parameters:{type:"object",properties:{content:{type:"string",description:'The updated codicent message text, e.g. "remember to call Johan", usually including the tags from the original message.'},parent_id:{type:"string",description:"The message id of a previous/old message to be updated."}},required:["content","parent_id"]}},(async({content:e,parent_id:t})=>await a.sendMessage(e,t))),d({name:"get_messages_list",description:"Gets messages tagged with given tag name, optionally limited by num_messages. The messages are listed in chronological order, latest first.",parameters:{type:"object",properties:{num_messages:{type:"integer",description:"The number of matching messages to return"},search_text:{type:"string",description:"Search text to filter messages by"},tag_name:{type:"string",description:"Name of tag to find messages by"},after_timestamp:{type:"string",description:"Only return messages after this timestamp"},before_timestamp:{type:"string",description:"Only return messages before this timestamp"}},required:["num_messages"]}},(async({num_messages:e,search_text:t,tag_name:s,after_timestamp:r,before_timestamp:i})=>{let n=await a.getMessages(s?[s]:[],void 0,e);t&&(n=n.filter((e=>e.content.includes(t)))),r&&(n=n.filter((e=>e.createdAt>r))),i&&(n=n.filter((e=>e.createdAt<i)));const o=n.slice(0,e);return console.log("get_messages_list result:",o),o})),d({name:"chat_with_codicent_ai",description:"Sends a message to Codicent AI and gets a response message back. Remember that you can always ask codicent via this tool to find out more about what you can achieve from chatting with the codicent AI.",parameters:{type:"object",properties:{message:{type:"string",description:"Text of message to the codicent"}},required:["message"]}},(async({message:e})=>await a.chat(e))),d({name:"create_todo",description:"Saves a todo message in Codicent.",parameters:{type:"object",properties:{text:{type:"string",description:"Text of todo"}},required:["text"]}},(async({text:e})=>await a.sendMessage("#todo "+e))),d({name:"place_order",description:"Places and order with the Codicent AI.",parameters:{type:"object",properties:{message:{type:"string",description:"The text message of the order as spoken by the user."}},required:["message"]}},(async({message:e})=>await a.sendMessage(`#do Jag kommer ge dig en text (nedan) på vad jag ska beställa. Använd bara den text du får av mig, inga tools.\n Du ska skapa en tabell med detaljerad information inklusive lagerstatus \n för varje artikel i beställningen. Svara först när du har all info på plats. Ställ inga frågor på vägen utan använd det du får av mig.\n \n ----\n EXEMPEL PÅ SVAR:\n ----\n Här är en tabell med detaljerad information inklusive lagerstatus för varje artikel i beställningen:\n \n Artikel\tHyresobjekt\tNamn\tLagertyp\tGrupp\tNamn.1\tSRA/SBEF\tLeverantör\tLevnr\tDepå\tLager\tReserverat\tUthyrt nu\tTillgängligt nu\tMärke/typ\tTillverkarnr\tTillv.år\tInköpsdato\tInköpspris\tVikt\n Elverk\t12345\tElverk 1\tHyresobjekt\tMaskiner\tElverk\tSRA\tLeverantör A\t001\tDepå 1\t5\t0\t1\t4\tHonda EU22i\t123456\t2020\t2020-01-01\t10000 SEK\t21 kg\n Elverk\t12345\tElverk 2\tHyresobjekt\tMaskiner\tElverk\tSRA\tLeverantör B\t002\tDepå 2\t3\t0\t1\t2\tYamaha EF2000iS\t654321\t2019\t2019-05-01\t9000 SEK\t20 kg\n Observera att denna tabell är baserad på den information som finns tillgänglig i lagerstatusen. Om du behöver ytterligare detaljer eller om något specifikt saknas, vänligen meddela mig.\n ----\n \n --- här följer texten på vad jag vill beställa ---\n \n \n ${e}`))),d({name:"remember_info",description:"Saves info in your internal memory for future use. Use this tool to save insights on how to perform our conversations and tasks related to them.",parameters:{type:"object",properties:{message:{type:"string",description:"Your insights to improve our future conversations."}},required:["message"]}},(async({message:e})=>await a.sendMessage(`#index #insights\n\n${e}`))),d({name:"save_to_crm",description:"Saves CRM related info to your memory (logbook).",parameters:{type:"object",properties:{message:{type:"string",description:"CRM log entry description/contents."},company:{type:"string",description:"Company name for CRM log entry."},contact:{type:"string",description:"Contact name for CRM log entry."}},required:["message","company"]}},(async({message:e,company:t,contact:s})=>await a.sendMessage(`#crm\n\nFöretag: ${t}\n\nInfo: ${e}${s?"\n\nKontakt: "+s:""}`))),d({name:"set_page_html",description:"Sets the innerHtml of the div covering the full app page. You can display any html/javascript/style/mermaid content here for the user to see ;-). This view is usually referred to as the canvas, or tavlan in Swedish.",parameters:{type:"object",properties:{html:{type:"string",description:"The inner html to set the page to."}},required:["html"]}},(async({html:e})=>(r(e),n.play(),{ok:!0}))),d({name:"hide_page_html",description:"Hides the inner html of the page.",parameters:{type:"object",properties:{}}},(async()=>(r(void 0),{ok:!0}))),d({name:"get_page_html",description:"Gets the inner html of the page.",parameters:{type:"object",properties:{}}},(async()=>({html:o}))),d({name:"get_tasks",description:"Gets the list of possible tasks that can be performed. This lists task names and their id:s. Use get_task to get the task instructions given a task id.",parameters:{type:"object",properties:{},required:[]}},(async e=>(await m()).map((e=>({id:e.id,name:e.title}))))),d({name:"get_task",description:"Gets the task instructions for a given task id. Use get_tasks to get a list of possible tasks (with their id:s).",parameters:{type:"object",properties:{task_id:{type:"string",description:"The task id to get instructions for."}},required:["task_id"]}},(async({task_id:e})=>{const t=(await m()).find((t=>t.id===e));return t?t.content:"Task not found"})),d({name:"get_chat_conversation",description:"Gets a chat conversation (message thread) by message ID. Returns all messages in the conversation thread in chronological order.",parameters:{type:"object",properties:{message_id:{type:"string",description:"The ID of any message in the conversation to retrieve the full thread."}},required:["message_id"]}},(async({message_id:e})=>{try{return{ok:!0,messages:await a.getChatHistory(e)}}catch(e){return{ok:!1,error:e.message||"Failed to get chat conversation"}}})),d({name:"get_gps_location",description:"Gets the current GPS location of the device. Returns latitude and longitude coordinates. Use this when the user asks about nearby places, directions, or anything location-dependent.",parameters:{type:"object",properties:{},required:[]}},(async e=>{try{const e=await s();return e?{ok:!0,latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy}:{ok:!1,error:"GPS not available"}}catch{return{ok:!1,error:"Failed to get GPS location"}}}));const{additionalTools:l=[],mergeStrategy:g="merge"}=c||{};return"replace"===g?l:"builtin-only"===g?e:[...e,...l]}),[a,r,i,o,n,c]);export{a as default};
@@ -7,7 +7,7 @@ export interface UserRole {
7
7
  role: string;
8
8
  claims?: string;
9
9
  }
10
- export declare const useUserRoles: (service: CodicentService, currentNickname?: string) => {
10
+ export declare const useUserRoles: (service: CodicentService, currentNickname?: string, currentCodicent?: string) => {
11
11
  userRoles: UserRole[];
12
12
  loading: boolean;
13
13
  error: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"useUserRoles.d.ts","sourceRoot":"","sources":["../../../src/hooks/useUserRoles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,YAAa,eAAe,oBAAoB,MAAM;;;;oCA8BhE,MAAM,KAAG,MAAM;gCAgBO,MAAM,KAAG,MAAM;8BAUjB,MAAM,QAAQ,QAAQ,KAAG,OAAO;+BAe/B,MAAM,KAAG,QAAQ,GAAG,SAAS;mCAKzB,MAAM,KAAG,MAAM,EAAE;8BASxB,QAAQ,GAAG,SAAS;8BAKR,MAAM;CAiBlD,CAAC"}
1
+ {"version":3,"file":"useUserRoles.d.ts","sourceRoot":"","sources":["../../../src/hooks/useUserRoles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,YAAa,eAAe,oBAAoB,MAAM,oBAAoB,MAAM;;;;oCAiC1F,MAAM,KAAG,MAAM;gCAgBO,MAAM,KAAG,MAAM;8BAUjB,MAAM,QAAQ,QAAQ,KAAG,OAAO;+BAe/B,MAAM,KAAG,QAAQ,GAAG,SAAS;mCAKzB,MAAM,KAAG,MAAM,EAAE;8BASxB,QAAQ,GAAG,SAAS;8BAKR,MAAM;CAiBlD,CAAC"}
@@ -1 +1 @@
1
- import{useState as e,useEffect as r,useCallback as t}from"react";import n from"../utils/MessageContent.js";const s=(s,o)=>{const[a,i]=e([]),[m,l]=e(!0),[c,u]=e(null);r((()=>{(async()=>{try{l(!0),u(null);const e=(await s.getMessagesFast(["user_role"],void 0,100)).map((e=>{const r=new n(e.content).data;return r&&"object"==typeof r?r:null})).filter((e=>null!==e));i(e)}catch(e){console.error("Failed to fetch user roles:",e),u(e instanceof Error?e.message:"Failed to fetch user roles")}finally{l(!1)}})()}),[s]);const f=t((e=>{if(!e)return"";const r=e.toLowerCase(),t=a.find((e=>{if(!e.nicknames)return!1;return e.nicknames.toLowerCase().split(",").map((e=>e.trim())).some((e=>e===r))}));return t?.name||e}),[a]),p=(e,r)=>{if(!e||!r)return!1;const t=e.toLowerCase();if(r.nicknames){if(r.nicknames.toLowerCase().split(",").map((e=>e.trim())).some((e=>e===t)))return!0}return r.name?.toLowerCase()===t||r.email?.toLowerCase()===t},C=e=>{if(e)return a.find((r=>p(e,r)))},g=t((()=>o?f(o):""),[o,f]);return{userRoles:a,loading:m,error:c,getNameFromNickname:f,getNicknameFromName:e=>{if(!e)return"";const r=a.find((r=>r.name?.toLowerCase()===e.toLowerCase()));if(r?.nicknames){return r.nicknames.split(",").map((e=>e.trim()))[0]||e}return e},isUserMatch:p,findUserRole:C,getClaimsForUser:e=>{const r=C(e);return r?.claims?r.claims.split(",").map((e=>e.trim())).filter(Boolean):[]},getCurrentUserRole:()=>{if(o)return C(o)},getCurrentUserName:g}};export{s as useUserRoles};
1
+ import{useState as e,useEffect as r,useCallback as t}from"react";import n from"../utils/MessageContent.js";const s=(s,o,a)=>{const[i,m]=e([]),[l,c]=e(!0),[u,f]=e(null);r((()=>{if(!o)return;if(!a)return;(async()=>{try{c(!0),f(null);const e=(await s.getMessagesFast(["user_role"],void 0,100)).map((e=>{const r=new n(e.content).data;return r&&"object"==typeof r?r:null})).filter((e=>null!==e));m(e)}catch(e){console.error("Failed to fetch user roles:",e),f(e instanceof Error?e.message:"Failed to fetch user roles")}finally{c(!1)}})()}),[s,o,a]);const p=t((e=>{if(!e)return"";const r=e.toLowerCase(),t=i.find((e=>{if(!e.nicknames)return!1;return e.nicknames.toLowerCase().split(",").map((e=>e.trim())).some((e=>e===r))}));return t?.name||e}),[i]),C=(e,r)=>{if(!e||!r)return!1;const t=e.toLowerCase();if(r.nicknames){if(r.nicknames.toLowerCase().split(",").map((e=>e.trim())).some((e=>e===t)))return!0}return r.name?.toLowerCase()===t||r.email?.toLowerCase()===t},g=e=>{if(e)return i.find((r=>C(e,r)))},w=t((()=>o?p(o):""),[o,p]);return{userRoles:i,loading:l,error:u,getNameFromNickname:p,getNicknameFromName:e=>{if(!e)return"";const r=i.find((r=>r.name?.toLowerCase()===e.toLowerCase()));if(r?.nicknames){return r.nicknames.split(",").map((e=>e.trim()))[0]||e}return e},isUserMatch:C,findUserRole:g,getClaimsForUser:e=>{const r=g(e);return r?.claims?r.claims.split(",").map((e=>e.trim())).filter(Boolean):[]},getCurrentUserRole:()=>{if(o)return g(o)},getCurrentUserName:w}};export{s as useUserRoles};
@@ -1 +1 @@
1
- import{__exports as t}from"../../../../../_virtual/CsvFormatterStream.js";import r from"stream";import"./formatter/index.js";import{__exports as o}from"../../../../../_virtual/index16.js";Object.defineProperty(t,"__esModule",{value:!0}),t.CsvFormatterStream=void 0;const s=r,e=o;class a extends s.Transform{constructor(t){super({writableObjectMode:t.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=t,this.rowFormatter=new e.RowFormatter(t),this.hasWrittenBOM=!t.writeBOM}transform(t){return this.rowFormatter.rowTransform=t,this}_transform(t,r,o){let s=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(t,((t,r)=>t?(s=!0,o(t)):(r&&r.forEach((t=>{this.push(Buffer.from(t,"utf8"))})),s=!0,o())))}catch(t){if(s)throw t;o(t)}}_flush(t){this.rowFormatter.finish(((r,o)=>r?t(r):(o&&o.forEach((t=>{this.push(Buffer.from(t,"utf8"))})),t())))}}t.CsvFormatterStream=a;export{t as default};
1
+ import{__exports as t}from"../../../../../_virtual/CsvFormatterStream.js";import r from"stream";import"./formatter/index.js";import{__exports as o}from"../../../../../_virtual/index17.js";Object.defineProperty(t,"__esModule",{value:!0}),t.CsvFormatterStream=void 0;const s=r,e=o;class a extends s.Transform{constructor(t){super({writableObjectMode:t.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=t,this.rowFormatter=new e.RowFormatter(t),this.hasWrittenBOM=!t.writeBOM}transform(t){return this.rowFormatter.rowTransform=t,this}_transform(t,r,o){let s=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(t,((t,r)=>t?(s=!0,o(t)):(r&&r.forEach((t=>{this.push(Buffer.from(t,"utf8"))})),s=!0,o())))}catch(t){if(s)throw t;o(t)}}_flush(t){this.rowFormatter.finish(((r,o)=>r?t(r):(o&&o.forEach((t=>{this.push(Buffer.from(t,"utf8"))})),t())))}}t.CsvFormatterStream=a;export{t as default};
@@ -1 +1 @@
1
- import{__exports as r}from"../../../../../../_virtual/index16.js";import"./RowFormatter.js";import"./FieldFormatter.js";import{__exports as e}from"../../../../../../_virtual/RowFormatter.js";import{__exports as t}from"../../../../../../_virtual/FieldFormatter.js";!function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.FieldFormatter=r.RowFormatter=void 0;var o=e;Object.defineProperty(r,"RowFormatter",{enumerable:!0,get:function(){return o.RowFormatter}});var a=t;Object.defineProperty(r,"FieldFormatter",{enumerable:!0,get:function(){return a.FieldFormatter}})}(r);
1
+ import{__exports as r}from"../../../../../../_virtual/index17.js";import"./RowFormatter.js";import"./FieldFormatter.js";import{__exports as e}from"../../../../../../_virtual/RowFormatter.js";import{__exports as t}from"../../../../../../_virtual/FieldFormatter.js";!function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.FieldFormatter=r.RowFormatter=void 0;var o=e;Object.defineProperty(r,"RowFormatter",{enumerable:!0,get:function(){return o.RowFormatter}});var a=t;Object.defineProperty(r,"FieldFormatter",{enumerable:!0,get:function(){return a.FieldFormatter}})}(r);
@@ -1 +1 @@
1
- import{__exports as r}from"../../../../../_virtual/CsvParserStream.js";import t from"string_decoder";import s from"stream";import"./transforms/index.js";import"./parser/index.js";import{__exports as e}from"../../../../../_virtual/index14.js";import{__exports as i}from"../../../../../_virtual/index15.js";Object.defineProperty(r,"__esModule",{value:!0}),r.CsvParserStream=void 0;const o=t,n=s,a=e,h=i;class d extends n.Transform{constructor(r){super({objectMode:r.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=r,this.parser=new h.Parser(r),this.headerTransformer=new a.HeaderTransformer(r),this.decoder=new o.StringDecoder(r.encoding),this.rowTransformerValidator=new a.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(r){return this.rowTransformerValidator.rowTransform=r,this}validate(r){return this.rowTransformerValidator.rowValidator=r,this}emit(r,...t){return"end"===r?(this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1):super.emit(r,...t)}_transform(r,t,s){if(this.hasHitRowLimit)return s();const e=d.wrapDoneCallback(s);try{const{lines:t}=this,s=t+this.decoder.write(r),i=this.parse(s,!0);return this.processRows(i,e)}catch(r){return e(r)}}_flush(r){const t=d.wrapDoneCallback(r);if(this.hasHitRowLimit)return t();try{const r=this.lines+this.decoder.end(),s=this.parse(r,!1);return this.processRows(s,t)}catch(r){return t(r)}}parse(r,t){if(!r)return[];const{line:s,rows:e}=this.parser.parse(r,t);return this.lines=s,e}processRows(r,t){const s=r.length,e=i=>{const o=r=>r?t(r):i%100!=0?e(i+1):void setImmediate((()=>e(i+1)));if(this.checkAndEmitHeaders(),i>=s||this.hasHitRowLimit)return t();if(this.parsedLineCount+=1,this.shouldSkipLine)return o();const n=r[i];this.rowCount+=1,this.parsedRowCount+=1;const a=this.rowCount;return this.transformRow(n,((r,t)=>{if(r)return this.rowCount-=1,o(r);if(!t)return o(new Error("expected transform result"));if(t.isValid){if(t.row)return this.pushRow(t.row,o)}else this.emit("data-invalid",t.row,a,t.reason);return o()}))};e(0)}transformRow(r,t){try{this.headerTransformer.transform(r,((s,e)=>s?t(s):e?e.isValid?e.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(e.row,t):this.skipRow(t):(this.rowCount-=1,this.parsedRowCount-=1,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:r}):this.skipRow(t):t(new Error("Expected result from header transform"))))}catch(r){t(r)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(r){return this.rowCount-=1,r(null,{row:null,isValid:!0})}pushRow(r,t){try{this.parserOptions.objectMode?this.push(r):this.push(JSON.stringify(r)),t()}catch(r){t(r)}}static wrapDoneCallback(r){let t=!1;return(s,...e)=>{if(s){if(t)throw s;return t=!0,void r(s)}r(...e)}}}r.CsvParserStream=d;export{r as default};
1
+ import{__exports as r}from"../../../../../_virtual/CsvParserStream.js";import t from"string_decoder";import s from"stream";import"./transforms/index.js";import"./parser/index.js";import{__exports as e}from"../../../../../_virtual/index15.js";import{__exports as i}from"../../../../../_virtual/index16.js";Object.defineProperty(r,"__esModule",{value:!0}),r.CsvParserStream=void 0;const o=t,n=s,a=e,h=i;class d extends n.Transform{constructor(r){super({objectMode:r.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=r,this.parser=new h.Parser(r),this.headerTransformer=new a.HeaderTransformer(r),this.decoder=new o.StringDecoder(r.encoding),this.rowTransformerValidator=new a.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(r){return this.rowTransformerValidator.rowTransform=r,this}validate(r){return this.rowTransformerValidator.rowValidator=r,this}emit(r,...t){return"end"===r?(this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1):super.emit(r,...t)}_transform(r,t,s){if(this.hasHitRowLimit)return s();const e=d.wrapDoneCallback(s);try{const{lines:t}=this,s=t+this.decoder.write(r),i=this.parse(s,!0);return this.processRows(i,e)}catch(r){return e(r)}}_flush(r){const t=d.wrapDoneCallback(r);if(this.hasHitRowLimit)return t();try{const r=this.lines+this.decoder.end(),s=this.parse(r,!1);return this.processRows(s,t)}catch(r){return t(r)}}parse(r,t){if(!r)return[];const{line:s,rows:e}=this.parser.parse(r,t);return this.lines=s,e}processRows(r,t){const s=r.length,e=i=>{const o=r=>r?t(r):i%100!=0?e(i+1):void setImmediate((()=>e(i+1)));if(this.checkAndEmitHeaders(),i>=s||this.hasHitRowLimit)return t();if(this.parsedLineCount+=1,this.shouldSkipLine)return o();const n=r[i];this.rowCount+=1,this.parsedRowCount+=1;const a=this.rowCount;return this.transformRow(n,((r,t)=>{if(r)return this.rowCount-=1,o(r);if(!t)return o(new Error("expected transform result"));if(t.isValid){if(t.row)return this.pushRow(t.row,o)}else this.emit("data-invalid",t.row,a,t.reason);return o()}))};e(0)}transformRow(r,t){try{this.headerTransformer.transform(r,((s,e)=>s?t(s):e?e.isValid?e.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(e.row,t):this.skipRow(t):(this.rowCount-=1,this.parsedRowCount-=1,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:r}):this.skipRow(t):t(new Error("Expected result from header transform"))))}catch(r){t(r)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(r){return this.rowCount-=1,r(null,{row:null,isValid:!0})}pushRow(r,t){try{this.parserOptions.objectMode?this.push(r):this.push(JSON.stringify(r)),t()}catch(r){t(r)}}static wrapDoneCallback(r){let t=!1;return(s,...e)=>{if(s){if(t)throw s;return t=!0,void r(s)}r(...e)}}}r.CsvParserStream=d;export{r as default};
@@ -1 +1 @@
1
- import{__exports as e}from"../../../../../../_virtual/index15.js";import"./Parser.js";import"./RowParser.js";import"./Scanner.js";import"./Token.js";import"./column/index.js";import{__exports as r}from"../../../../../../_virtual/Parser.js";import{__exports as o}from"../../../../../../_virtual/RowParser.js";import{__exports as n}from"../../../../../../_virtual/Scanner.js";import{__exports as t}from"../../../../../../_virtual/Token.js";import{__exports as a}from"../../../../../../_virtual/index24.js";!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=e.Token=e.Scanner=e.RowParser=e.Parser=void 0;var u=r;Object.defineProperty(e,"Parser",{enumerable:!0,get:function(){return u.Parser}});var s=o;Object.defineProperty(e,"RowParser",{enumerable:!0,get:function(){return s.RowParser}});var i=n;Object.defineProperty(e,"Scanner",{enumerable:!0,get:function(){return i.Scanner}});var m=t;Object.defineProperty(e,"Token",{enumerable:!0,get:function(){return m.Token}});var P=a;Object.defineProperty(e,"ColumnParser",{enumerable:!0,get:function(){return P.ColumnParser}}),Object.defineProperty(e,"NonQuotedColumnParser",{enumerable:!0,get:function(){return P.NonQuotedColumnParser}}),Object.defineProperty(e,"QuotedColumnParser",{enumerable:!0,get:function(){return P.QuotedColumnParser}})}(e);
1
+ import{__exports as e}from"../../../../../../_virtual/index16.js";import"./Parser.js";import"./RowParser.js";import"./Scanner.js";import"./Token.js";import"./column/index.js";import{__exports as r}from"../../../../../../_virtual/Parser.js";import{__exports as o}from"../../../../../../_virtual/RowParser.js";import{__exports as n}from"../../../../../../_virtual/Scanner.js";import{__exports as t}from"../../../../../../_virtual/Token.js";import{__exports as a}from"../../../../../../_virtual/index24.js";!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=e.Token=e.Scanner=e.RowParser=e.Parser=void 0;var u=r;Object.defineProperty(e,"Parser",{enumerable:!0,get:function(){return u.Parser}});var s=o;Object.defineProperty(e,"RowParser",{enumerable:!0,get:function(){return s.RowParser}});var i=n;Object.defineProperty(e,"Scanner",{enumerable:!0,get:function(){return i.Scanner}});var m=t;Object.defineProperty(e,"Token",{enumerable:!0,get:function(){return m.Token}});var P=a;Object.defineProperty(e,"ColumnParser",{enumerable:!0,get:function(){return P.ColumnParser}}),Object.defineProperty(e,"NonQuotedColumnParser",{enumerable:!0,get:function(){return P.NonQuotedColumnParser}}),Object.defineProperty(e,"QuotedColumnParser",{enumerable:!0,get:function(){return P.QuotedColumnParser}})}(e);
@@ -1 +1 @@
1
- import{__exports as r}from"../../../../../../_virtual/index14.js";import"./RowTransformerValidator.js";import"./HeaderTransformer.js";import{__exports as e}from"../../../../../../_virtual/RowTransformerValidator.js";import{__exports as o}from"../../../../../../_virtual/HeaderTransformer.js";!function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.HeaderTransformer=r.RowTransformerValidator=void 0;var a=e;Object.defineProperty(r,"RowTransformerValidator",{enumerable:!0,get:function(){return a.RowTransformerValidator}});var t=o;Object.defineProperty(r,"HeaderTransformer",{enumerable:!0,get:function(){return t.HeaderTransformer}})}(r);
1
+ import{__exports as r}from"../../../../../../_virtual/index15.js";import"./RowTransformerValidator.js";import"./HeaderTransformer.js";import{__exports as e}from"../../../../../../_virtual/RowTransformerValidator.js";import{__exports as o}from"../../../../../../_virtual/HeaderTransformer.js";!function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.HeaderTransformer=r.RowTransformerValidator=void 0;var a=e;Object.defineProperty(r,"RowTransformerValidator",{enumerable:!0,get:function(){return a.RowTransformerValidator}});var t=o;Object.defineProperty(r,"HeaderTransformer",{enumerable:!0,get:function(){return t.HeaderTransformer}})}(r);
@@ -1 +1 @@
1
- var r,t;function n(){if(t)return r;t=1,r=function(r,t){for(var e=[],a=0;a<r.length;a++){var u=t(r[a],a);n(u)?e.push.apply(e,u):e.push(u)}return e};var n=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};return r}export{n as __require};
1
+ var r=function(r,a){for(var n=[],o=0;o<r.length;o++){var e=a(r[o],o);t(e)?n.push.apply(n,e):n.push(e)}return n},t=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};export{r as c};
@@ -1 +1 @@
1
- import t from"../../../../../../../_virtual/index20.js";import{b as e}from"../../base-xform.js";import{c as r}from"../../composite-xform.js";import{d as o}from"./databar-ext-xform.js";import{i as a}from"./icon-set-ext-xform.js";const{v4:s}=t,i=e,n=r,d=o,c=a,p={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class m extends n{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new d,"x14:iconSet":this.iconSetXform=new c}}get tag(){return"x14:cfRule"}static isExt(t){return"dataBar"===t.type?d.isExt(t):!("iconSet"!==t.type||!t.custom&&!p[t.iconSet])}prepare(t){m.isExt(t)&&(t.x14Id=`{${s()}}`.toUpperCase())}render(t,e){if(m.isExt(e))switch(e.type){case"dataBar":this.renderDataBar(t,e);break;case"iconSet":this.renderIconSet(t,e)}}renderDataBar(t,e){t.openNode(this.tag,{type:"dataBar",id:e.x14Id}),this.databarXform.render(t,e),t.closeNode()}renderIconSet(t,e){t.openNode(this.tag,{type:"iconSet",priority:e.priority,id:e.x14Id||`{${s()}}`}),this.iconSetXform.render(t,e),t.closeNode()}createNewModel({attributes:t}){return{type:t.type,x14Id:t.id,priority:i.toIntValue(t.priority)}}onParserClose(t,e){Object.assign(this.model,e.model)}}var x=m;export{x as c};
1
+ import t from"../../../../../../../_virtual/index19.js";import{b as e}from"../../base-xform.js";import{c as r}from"../../composite-xform.js";import{d as o}from"./databar-ext-xform.js";import{i as a}from"./icon-set-ext-xform.js";const{v4:s}=t,i=e,n=r,d=o,c=a,p={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class m extends n{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new d,"x14:iconSet":this.iconSetXform=new c}}get tag(){return"x14:cfRule"}static isExt(t){return"dataBar"===t.type?d.isExt(t):!("iconSet"!==t.type||!t.custom&&!p[t.iconSet])}prepare(t){m.isExt(t)&&(t.x14Id=`{${s()}}`.toUpperCase())}render(t,e){if(m.isExt(e))switch(e.type){case"dataBar":this.renderDataBar(t,e);break;case"iconSet":this.renderIconSet(t,e)}}renderDataBar(t,e){t.openNode(this.tag,{type:"dataBar",id:e.x14Id}),this.databarXform.render(t,e),t.closeNode()}renderIconSet(t,e){t.openNode(this.tag,{type:"iconSet",priority:e.priority,id:e.x14Id||`{${s()}}`}),this.iconSetXform.render(t,e),t.closeNode()}createNewModel({attributes:t}){return{type:t.type,x14Id:t.id,priority:i.toIntValue(t.priority)}}onParserClose(t,e){Object.assign(this.model,e.model)}}var x=m;export{x as c};
@@ -1 +1 @@
1
- import r from"fs";import{__require as t}from"./old.js";var n,e;function a(){if(e)return n;e=1,n=l,l.realpath=l,l.sync=h,l.realpathSync=h,l.monkeypatch=function(){a.realpath=l,a.realpathSync=h},l.unmonkeypatch=function(){a.realpath=c,a.realpathSync=o};var a=r,c=a.realpath,o=a.realpathSync,u=process.version,p=/^v[0-5]\./.test(u),i=t();function f(r){return r&&"realpath"===r.syscall&&("ELOOP"===r.code||"ENOMEM"===r.code||"ENAMETOOLONG"===r.code)}function l(r,t,n){if(p)return c(r,t,n);"function"==typeof t&&(n=t,t=null),c(r,t,(function(e,a){f(e)?i.realpath(r,t,n):n(e,a)}))}function h(r,t){if(p)return o(r,t);try{return o(r,t)}catch(n){if(f(n))return i.realpathSync(r,t);throw n}}return n}export{a as __require};
1
+ import t from"fs";import"./old.js";import{__exports as r}from"../../_virtual/old.js";var a=h;h.realpath=h,h.sync=i,h.realpathSync=i,h.monkeypatch=function(){n.realpath=h,n.realpathSync=i},h.unmonkeypatch=function(){n.realpath=e,n.realpathSync=o};var n=t,e=n.realpath,o=n.realpathSync,c=process.version,p=/^v[0-5]\./.test(c),l=r;function f(t){return t&&"realpath"===t.syscall&&("ELOOP"===t.code||"ENOMEM"===t.code||"ENAMETOOLONG"===t.code)}function h(t,r,a){if(p)return e(t,r,a);"function"==typeof r&&(a=r,r=null),e(t,r,(function(n,e){f(n)?l.realpath(t,r,a):a(n,e)}))}function i(t,r){if(p)return o(t,r);try{return o(t,r)}catch(a){if(f(a))return l.realpathSync(t,r);throw a}}export{a as f};
@@ -1 +1 @@
1
- import{__exports as e}from"../../_virtual/old.js";import r from"path";import n from"fs";var t;function o(){if(t)return e;t=1;var o=r,i="win32"===process.platform,s=n,c=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function a(e){return"function"==typeof e?e:function(){var e;if(c){var r=new Error;e=function(e){e&&(r.message=e.message,n(e=r))}}else e=n;return e;function n(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var r="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(r):console.error(r)}}}}()}if(o.normalize,i)var l=/(.*?)(?:[\/\\]+|$)/g;else l=/(.*?)(?:[\/]+|$)/g;if(i)var f=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else f=/^[\/]*/;return e.realpathSync=function(e,r){if(e=o.resolve(e),r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];var n,t,c,a,u=e,p={},v={};function y(){var r=f.exec(e);n=r[0].length,t=r[0],c=r[0],a="",i&&!v[c]&&(s.lstatSync(c),v[c]=!0)}for(y();n<e.length;){l.lastIndex=n;var h=l.exec(e);if(a=t,t+=h[0],c=a+h[1],n=l.lastIndex,!(v[c]||r&&r[c]===c)){var g;if(r&&Object.prototype.hasOwnProperty.call(r,c))g=r[c];else{var m=s.lstatSync(c);if(!m.isSymbolicLink()){v[c]=!0,r&&(r[c]=c);continue}var x=null;if(!i){var O=m.dev.toString(32)+":"+m.ino.toString(32);p.hasOwnProperty(O)&&(x=p[O])}null===x&&(s.statSync(c),x=s.readlinkSync(c)),g=o.resolve(a,x),r&&(r[c]=g),i||(p[O]=x)}e=o.resolve(g,e.slice(n)),y()}}return r&&(r[u]=e),e},e.realpath=function(e,r,n){if("function"!=typeof n&&(n=a(r),r=null),e=o.resolve(e),r&&Object.prototype.hasOwnProperty.call(r,e))return process.nextTick(n.bind(null,null,r[e]));var t,c,u,p,v=e,y={},h={};function g(){var r=f.exec(e);t=r[0].length,c=r[0],u=r[0],p="",i&&!h[u]?s.lstat(u,(function(e){if(e)return n(e);h[u]=!0,m()})):process.nextTick(m)}function m(){if(t>=e.length)return r&&(r[v]=e),n(null,e);l.lastIndex=t;var o=l.exec(e);return p=c,c+=o[0],u=p+o[1],t=l.lastIndex,h[u]||r&&r[u]===u?process.nextTick(m):r&&Object.prototype.hasOwnProperty.call(r,u)?S(r[u]):s.lstat(u,x)}function x(e,t){if(e)return n(e);if(!t.isSymbolicLink())return h[u]=!0,r&&(r[u]=u),process.nextTick(m);if(!i){var o=t.dev.toString(32)+":"+t.ino.toString(32);if(y.hasOwnProperty(o))return O(null,y[o],u)}s.stat(u,(function(e){if(e)return n(e);s.readlink(u,(function(e,r){i||(y[o]=r),O(e,r)}))}))}function O(e,t,i){if(e)return n(e);var s=o.resolve(p,t);r&&(r[i]=s),S(s)}function S(r){e=o.resolve(r,e.slice(t)),g()}g()},e}export{o as __require};
1
+ import{__exports as e}from"../../_virtual/old.js";import r from"path";import t from"fs";var n=r,o="win32"===process.platform,i=t,s=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function a(e){return"function"==typeof e?e:function(){var e;if(s){var r=new Error;e=function(e){e&&(r.message=e.message,t(e=r))}}else e=t;return e;function t(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var r="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(r):console.error(r)}}}}()}if(n.normalize,o)var c=/(.*?)(?:[\/\\]+|$)/g;else c=/(.*?)(?:[\/]+|$)/g;if(o)var l=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else l=/^[\/]*/;e.realpathSync=function(e,r){if(e=n.resolve(e),r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];var t,s,a,f,u=e,p={},v={};function y(){var r=l.exec(e);t=r[0].length,s=r[0],a=r[0],f="",o&&!v[a]&&(i.lstatSync(a),v[a]=!0)}for(y();t<e.length;){c.lastIndex=t;var h=c.exec(e);if(f=s,s+=h[0],a=f+h[1],t=c.lastIndex,!(v[a]||r&&r[a]===a)){var g;if(r&&Object.prototype.hasOwnProperty.call(r,a))g=r[a];else{var m=i.lstatSync(a);if(!m.isSymbolicLink()){v[a]=!0,r&&(r[a]=a);continue}var x=null;if(!o){var O=m.dev.toString(32)+":"+m.ino.toString(32);p.hasOwnProperty(O)&&(x=p[O])}null===x&&(i.statSync(a),x=i.readlinkSync(a)),g=n.resolve(f,x),r&&(r[a]=g),o||(p[O]=x)}e=n.resolve(g,e.slice(t)),y()}}return r&&(r[u]=e),e},e.realpath=function(e,r,t){if("function"!=typeof t&&(t=a(r),r=null),e=n.resolve(e),r&&Object.prototype.hasOwnProperty.call(r,e))return process.nextTick(t.bind(null,null,r[e]));var s,f,u,p,v=e,y={},h={};function g(){var r=l.exec(e);s=r[0].length,f=r[0],u=r[0],p="",o&&!h[u]?i.lstat(u,(function(e){if(e)return t(e);h[u]=!0,m()})):process.nextTick(m)}function m(){if(s>=e.length)return r&&(r[v]=e),t(null,e);c.lastIndex=s;var n=c.exec(e);return p=f,f+=n[0],u=p+n[1],s=c.lastIndex,h[u]||r&&r[u]===u?process.nextTick(m):r&&Object.prototype.hasOwnProperty.call(r,u)?d(r[u]):i.lstat(u,x)}function x(e,n){if(e)return t(e);if(!n.isSymbolicLink())return h[u]=!0,r&&(r[u]=u),process.nextTick(m);if(!o){var s=n.dev.toString(32)+":"+n.ino.toString(32);if(y.hasOwnProperty(s))return O(null,y[s],u)}i.stat(u,(function(e){if(e)return t(e);i.readlink(u,(function(e,r){o||(y[s]=r),O(e,r)}))}))}function O(e,o,i){if(e)return t(e);var s=n.resolve(p,o);r&&(r[i]=s),d(s)}function d(r){e=n.resolve(r,e.slice(s)),g()}g()};export{e as default};
@@ -1 +1 @@
1
- import{__exports as e}from"../../_virtual/common.js";import r from"fs";import t from"path";import{__require as n}from"../minimatch/minimatch.js";import{__require as o}from"../path-is-absolute/index.js";function a(e,r){return Object.prototype.hasOwnProperty.call(e,r)}e.setopts=function(e,r,t){t||(t={});if(t.matchBase&&-1===r.indexOf("/")){if(t.noglobstar)throw new Error("base matching requires globstar");r="**/"+r}e.silent=!!t.silent,e.pattern=r,e.strict=!1!==t.strict,e.realpath=!!t.realpath,e.realpathCache=t.realpathCache||Object.create(null),e.follow=!!t.follow,e.dot=!!t.dot,e.mark=!!t.mark,e.nodir=!!t.nodir,e.nodir&&(e.mark=!0);e.sync=!!t.sync,e.nounique=!!t.nounique,e.nonull=!!t.nonull,e.nosort=!!t.nosort,e.nocase=!!t.nocase,e.stat=!!t.stat,e.noprocess=!!t.noprocess,e.absolute=!!t.absolute,e.fs=t.fs||c,e.maxLength=t.maxLength||1/0,e.cache=t.cache||Object.create(null),e.statCache=t.statCache||Object.create(null),e.symlinks=t.symlinks||Object.create(null),function(e,r){e.ignore=r.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]);e.ignore.length&&(e.ignore=e.ignore.map(u))}(e,t),e.changedCwd=!1;var n=process.cwd();a(t,"cwd")?(e.cwd=i.resolve(t.cwd),e.changedCwd=e.cwd!==n):e.cwd=n;e.root=t.root||i.resolve(e.cwd,"/"),e.root=i.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/"));e.cwdAbs=l(e.cwd)?e.cwd:f(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/"));e.nomount=!!t.nomount,t.nonegate=!0,t.nocomment=!0,t.allowWindowsEscape=!1,e.minimatch=new h(r,t),e.options=e.minimatch.options},e.ownProp=a,e.makeAbs=f,e.finish=function(e){for(var r=e.nounique,t=r?[]:Object.create(null),n=0,o=e.matches.length;n<o;n++){var a=e.matches[n];if(a&&0!==Object.keys(a).length){var c=Object.keys(a);r?t.push.apply(t,c):c.forEach((function(e){t[e]=!0}))}else if(e.nonull){var i=e.minimatch.globSet[n];r?t.push(i):t[i]=!0}}r||(t=Object.keys(t));e.nosort||(t=t.sort(m));if(e.mark){for(n=0;n<t.length;n++)t[n]=e._mark(t[n]);e.nodir&&(t=t.filter((function(r){var t=!/\/$/.test(r),n=e.cache[r]||e.cache[f(e,r)];return t&&n&&(t="DIR"!==n&&!Array.isArray(n)),t})))}e.ignore.length&&(t=t.filter((function(r){return!p(e,r)})));e.found=t},e.mark=function(e,r){var t=f(e,r),n=e.cache[t],o=r;if(n){var a="DIR"===n||Array.isArray(n),c="/"===r.slice(-1);if(a&&!c?o+="/":!a&&c&&(o=o.slice(0,-1)),o!==r){var i=f(e,o);e.statCache[i]=e.statCache[t],e.cache[i]=e.cache[t]}}return o},e.isIgnored=p,e.childrenIgnored=function(e,r){return!!e.ignore.length&&e.ignore.some((function(e){return!(!e.gmatcher||!e.gmatcher.match(r))}))};var c=r,i=t,s=n(),l=o(),h=s.Minimatch;function m(e,r){return e.localeCompare(r,"en")}function u(e){var r=null;if("/**"===e.slice(-3)){var t=e.replace(/(\/\*\*)+$/,"");r=new h(t,{dot:!0})}return{matcher:new h(e,{dot:!0}),gmatcher:r}}function f(e,r){var t=r;return t="/"===r.charAt(0)?i.join(e.root,r):l(r)||""===r?r:e.changedCwd?i.resolve(e.cwd,r):i.resolve(r),"win32"===process.platform&&(t=t.replace(/\\/g,"/")),t}function p(e,r){return!!e.ignore.length&&e.ignore.some((function(e){return e.matcher.match(r)||!(!e.gmatcher||!e.gmatcher.match(r))}))}export{e as default};
1
+ import{__exports as e}from"../../_virtual/common.js";import r from"fs";import t from"path";import{m as n}from"../minimatch/minimatch.js";import{__require as o}from"../path-is-absolute/index.js";function a(e,r){return Object.prototype.hasOwnProperty.call(e,r)}e.setopts=function(e,r,t){t||(t={});if(t.matchBase&&-1===r.indexOf("/")){if(t.noglobstar)throw new Error("base matching requires globstar");r="**/"+r}e.silent=!!t.silent,e.pattern=r,e.strict=!1!==t.strict,e.realpath=!!t.realpath,e.realpathCache=t.realpathCache||Object.create(null),e.follow=!!t.follow,e.dot=!!t.dot,e.mark=!!t.mark,e.nodir=!!t.nodir,e.nodir&&(e.mark=!0);e.sync=!!t.sync,e.nounique=!!t.nounique,e.nonull=!!t.nonull,e.nosort=!!t.nosort,e.nocase=!!t.nocase,e.stat=!!t.stat,e.noprocess=!!t.noprocess,e.absolute=!!t.absolute,e.fs=t.fs||c,e.maxLength=t.maxLength||1/0,e.cache=t.cache||Object.create(null),e.statCache=t.statCache||Object.create(null),e.symlinks=t.symlinks||Object.create(null),function(e,r){e.ignore=r.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]);e.ignore.length&&(e.ignore=e.ignore.map(u))}(e,t),e.changedCwd=!1;var n=process.cwd();a(t,"cwd")?(e.cwd=i.resolve(t.cwd),e.changedCwd=e.cwd!==n):e.cwd=n;e.root=t.root||i.resolve(e.cwd,"/"),e.root=i.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/"));e.cwdAbs=l(e.cwd)?e.cwd:f(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/"));e.nomount=!!t.nomount,t.nonegate=!0,t.nocomment=!0,t.allowWindowsEscape=!1,e.minimatch=new m(r,t),e.options=e.minimatch.options},e.ownProp=a,e.makeAbs=f,e.finish=function(e){for(var r=e.nounique,t=r?[]:Object.create(null),n=0,o=e.matches.length;n<o;n++){var a=e.matches[n];if(a&&0!==Object.keys(a).length){var c=Object.keys(a);r?t.push.apply(t,c):c.forEach((function(e){t[e]=!0}))}else if(e.nonull){var i=e.minimatch.globSet[n];r?t.push(i):t[i]=!0}}r||(t=Object.keys(t));e.nosort||(t=t.sort(h));if(e.mark){for(n=0;n<t.length;n++)t[n]=e._mark(t[n]);e.nodir&&(t=t.filter((function(r){var t=!/\/$/.test(r),n=e.cache[r]||e.cache[f(e,r)];return t&&n&&(t="DIR"!==n&&!Array.isArray(n)),t})))}e.ignore.length&&(t=t.filter((function(r){return!p(e,r)})));e.found=t},e.mark=function(e,r){var t=f(e,r),n=e.cache[t],o=r;if(n){var a="DIR"===n||Array.isArray(n),c="/"===r.slice(-1);if(a&&!c?o+="/":!a&&c&&(o=o.slice(0,-1)),o!==r){var i=f(e,o);e.statCache[i]=e.statCache[t],e.cache[i]=e.cache[t]}}return o},e.isIgnored=p,e.childrenIgnored=function(e,r){return!!e.ignore.length&&e.ignore.some((function(e){return!(!e.gmatcher||!e.gmatcher.match(r))}))};var c=r,i=t,s=n,l=o(),m=s.Minimatch;function h(e,r){return e.localeCompare(r,"en")}function u(e){var r=null;if("/**"===e.slice(-3)){var t=e.replace(/(\/\*\*)+$/,"");r=new m(t,{dot:!0})}return{matcher:new m(e,{dot:!0}),gmatcher:r}}function f(e,r){var t=r;return t="/"===r.charAt(0)?i.join(e.root,r):l(r)||""===r?r:e.changedCwd?i.resolve(e.cwd,r):i.resolve(r),"win32"===process.platform&&(t=t.replace(/\\/g,"/")),t}function p(e,r){return!!e.ignore.length&&e.ignore.some((function(e){return e.matcher.match(r)||!(!e.gmatcher||!e.gmatcher.match(r))}))}export{e as default};
@@ -1 +1 @@
1
- import{__require as t}from"../fs.realpath/index.js";import{__require as i}from"../minimatch/minimatch.js";import{__require as r}from"../inherits/inherits.js";import e from"events";import s from"path";import o from"assert";import{__require as n}from"../path-is-absolute/index.js";import{__require as a}from"./sync.js";import"./common.js";import{__require as h}from"../inflight/inflight.js";import"util";import{o as c}from"../once/once.js";import{__exports as u}from"../../_virtual/common.js";var f,p;function l(){if(p)return f;p=1,f=S;var l=t(),m=i();m.Minimatch;var _=r(),d=e.EventEmitter,v=s,y=o,b=n(),g=a(),E=u,k=E.setopts,A=E.ownProp,j=h(),w=E.childrenIgnored,I=E.isIgnored,O=c;function S(t,i,r){if("function"==typeof i&&(r=i,i={}),i||(i={}),i.sync){if(r)throw new TypeError("callback provided to sync glob");return g(t,i)}return new L(t,i,r)}S.sync=g;var R=S.GlobSync=g.GlobSync;function L(t,i,r){if("function"==typeof i&&(r=i,i=null),i&&i.sync){if(r)throw new TypeError("callback provided to sync glob");return new R(t,i)}if(!(this instanceof L))return new L(t,i,r);k(this,t,i),this._didRealPath=!1;var e=this.minimatch.set.length;this.matches=new Array(e),"function"==typeof r&&(r=O(r),this.on("error",r),this.on("end",(function(t){r(null,t)})));var s=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===e)return a();for(var o=!0,n=0;n<e;n++)this._process(this.minimatch.set[n],n,!1,a);function a(){--s._processing,s._processing<=0&&(o?process.nextTick((function(){s._finish()})):s._finish())}o=!1}return S.glob=S,S.hasMagic=function(t,i){var r=function(t,i){if(null===i||"object"!=typeof i)return t;for(var r=Object.keys(i),e=r.length;e--;)t[r[e]]=i[r[e]];return t}({},i);r.noprocess=!0;var e=new L(t,r).minimatch.set;if(!t)return!1;if(e.length>1)return!0;for(var s=0;s<e[0].length;s++)if("string"!=typeof e[0][s])return!0;return!1},S.Glob=L,_(L,d),L.prototype._finish=function(){if(y(this instanceof L),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();E.finish(this),this.emit("end",this.found)}},L.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var t=this.matches.length;if(0===t)return this._finish();for(var i=this,r=0;r<this.matches.length;r++)this._realpathSet(r,e)}function e(){0==--t&&i._finish()}},L.prototype._realpathSet=function(t,i){var r=this.matches[t];if(!r)return i();var e=Object.keys(r),s=this,o=e.length;if(0===o)return i();var n=this.matches[t]=Object.create(null);e.forEach((function(r,e){r=s._makeAbs(r),l.realpath(r,s.realpathCache,(function(e,a){e?"stat"===e.syscall?n[r]=!0:s.emit("error",e):n[a]=!0,0==--o&&(s.matches[t]=n,i())}))}))},L.prototype._mark=function(t){return E.mark(this,t)},L.prototype._makeAbs=function(t){return E.makeAbs(this,t)},L.prototype.abort=function(){this.aborted=!0,this.emit("abort")},L.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},L.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var i=0;i<t.length;i++){var r=t[i];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var e=this._processQueue.slice(0);this._processQueue.length=0;for(i=0;i<e.length;i++){var s=e[i];this._processing--,this._process(s[0],s[1],s[2],s[3])}}}},L.prototype._process=function(t,i,r,e){if(y(this instanceof L),y("function"==typeof e),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([t,i,r,e]);else{for(var s,o=0;"string"==typeof t[o];)o++;switch(o){case t.length:return void this._processSimple(t.join("/"),i,e);case 0:s=null;break;default:s=t.slice(0,o).join("/")}var n,a=t.slice(o);null===s?n=".":b(s)||b(t.map((function(t){return"string"==typeof t?t:"[*]"})).join("/"))?(s&&b(s)||(s="/"+s),n=s):n=s;var h=this._makeAbs(n);if(w(this,n))return e();a[0]===m.GLOBSTAR?this._processGlobStar(s,n,h,a,i,r,e):this._processReaddir(s,n,h,a,i,r,e)}},L.prototype._processReaddir=function(t,i,r,e,s,o,n){var a=this;this._readdir(r,o,(function(h,c){return a._processReaddir2(t,i,r,e,s,o,c,n)}))},L.prototype._processReaddir2=function(t,i,r,e,s,o,n,a){if(!n)return a();for(var h=e[0],c=!!this.minimatch.negate,u=h._glob,f=this.dot||"."===u.charAt(0),p=[],l=0;l<n.length;l++){if("."!==(_=n[l]).charAt(0)||f)(c&&!t?!_.match(h):_.match(h))&&p.push(_)}var m=p.length;if(0===m)return a();if(1===e.length&&!this.mark&&!this.stat){this.matches[s]||(this.matches[s]=Object.create(null));for(l=0;l<m;l++){var _=p[l];t&&(_="/"!==t?t+"/"+_:t+_),"/"!==_.charAt(0)||this.nomount||(_=v.join(this.root,_)),this._emitMatch(s,_)}return a()}e.shift();for(l=0;l<m;l++){_=p[l];t&&(_="/"!==t?t+"/"+_:t+_),this._process([_].concat(e),s,o,a)}a()},L.prototype._emitMatch=function(t,i){if(!this.aborted&&!I(this,i))if(this.paused)this._emitQueue.push([t,i]);else{var r=b(i)?i:this._makeAbs(i);if(this.mark&&(i=this._mark(i)),this.absolute&&(i=r),!this.matches[t][i]){if(this.nodir){var e=this.cache[r];if("DIR"===e||Array.isArray(e))return}this.matches[t][i]=!0;var s=this.statCache[r];s&&this.emit("stat",i,s),this.emit("match",i)}}},L.prototype._readdirInGlobStar=function(t,i){if(!this.aborted){if(this.follow)return this._readdir(t,!1,i);var r=this,e=j("lstat\0"+t,(function(e,s){if(e&&"ENOENT"===e.code)return i();var o=s&&s.isSymbolicLink();r.symlinks[t]=o,o||!s||s.isDirectory()?r._readdir(t,!1,i):(r.cache[t]="FILE",i())}));e&&r.fs.lstat(t,e)}},L.prototype._readdir=function(t,i,r){if(!this.aborted&&(r=j("readdir\0"+t+"\0"+i,r))){if(i&&!A(this.symlinks,t))return this._readdirInGlobStar(t,r);if(A(this.cache,t)){var e=this.cache[t];if(!e||"FILE"===e)return r();if(Array.isArray(e))return r(null,e)}this.fs.readdir(t,function(t,i,r){return function(e,s){e?t._readdirError(i,e,r):t._readdirEntries(i,s,r)}}(this,t,r))}},L.prototype._readdirEntries=function(t,i,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var e=0;e<i.length;e++){var s=i[e];s="/"===t?t+s:t+"/"+s,this.cache[s]=!0}return this.cache[t]=i,r(null,i)}},L.prototype._readdirError=function(t,i,r){if(!this.aborted){switch(i.code){case"ENOTSUP":case"ENOTDIR":var e=this._makeAbs(t);if(this.cache[e]="FILE",e===this.cwdAbs){var s=new Error(i.code+" invalid cwd "+this.cwd);s.path=this.cwd,s.code=i.code,this.emit("error",s),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:this.cache[this._makeAbs(t)]=!1,this.strict&&(this.emit("error",i),this.abort()),this.silent||console.error("glob error",i)}return r()}},L.prototype._processGlobStar=function(t,i,r,e,s,o,n){var a=this;this._readdir(r,o,(function(h,c){a._processGlobStar2(t,i,r,e,s,o,c,n)}))},L.prototype._processGlobStar2=function(t,i,r,e,s,o,n,a){if(!n)return a();var h=e.slice(1),c=t?[t]:[],u=c.concat(h);this._process(u,s,!1,a);var f=this.symlinks[r],p=n.length;if(f&&o)return a();for(var l=0;l<p;l++){if("."!==n[l].charAt(0)||this.dot){var m=c.concat(n[l],h);this._process(m,s,!0,a);var _=c.concat(n[l],e);this._process(_,s,!0,a)}}a()},L.prototype._processSimple=function(t,i,r){var e=this;this._stat(t,(function(s,o){e._processSimple2(t,i,s,o,r)}))},L.prototype._processSimple2=function(t,i,r,e,s){if(this.matches[i]||(this.matches[i]=Object.create(null)),!e)return s();if(t&&b(t)&&!this.nomount){var o=/[\/\\]$/.test(t);"/"===t.charAt(0)?t=v.join(this.root,t):(t=v.resolve(this.root,t),o&&(t+="/"))}"win32"===process.platform&&(t=t.replace(/\\/g,"/")),this._emitMatch(i,t),s()},L.prototype._stat=function(t,i){var r=this._makeAbs(t),e="/"===t.slice(-1);if(t.length>this.maxLength)return i();if(!this.stat&&A(this.cache,r)){var s=this.cache[r];if(Array.isArray(s)&&(s="DIR"),!e||"DIR"===s)return i(null,s);if(e&&"FILE"===s)return i()}var o=this.statCache[r];if(void 0!==o){if(!1===o)return i(null,o);var n=o.isDirectory()?"DIR":"FILE";return e&&"FILE"===n?i():i(null,n,o)}var a=this,h=j("stat\0"+r,(function(e,s){if(s&&s.isSymbolicLink())return a.fs.stat(r,(function(e,o){e?a._stat2(t,r,null,s,i):a._stat2(t,r,e,o,i)}));a._stat2(t,r,e,s,i)}));h&&a.fs.lstat(r,h)},L.prototype._stat2=function(t,i,r,e,s){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[i]=!1,s();var o="/"===t.slice(-1);if(this.statCache[i]=e,"/"===i.slice(-1)&&e&&!e.isDirectory())return s(null,!1,e);var n=!0;return e&&(n=e.isDirectory()?"DIR":"FILE"),this.cache[i]=this.cache[i]||n,o&&"FILE"===n?s():s(null,n,e)},f}export{l as __require};
1
+ import{f as t}from"../fs.realpath/index.js";import{m as i}from"../minimatch/minimatch.js";import{__require as r}from"../inherits/inherits.js";import e from"events";import s from"path";import o from"assert";import{__require as n}from"../path-is-absolute/index.js";import{__require as a}from"./sync.js";import"./common.js";import{i as h}from"../inflight/inflight.js";import"util";import{o as c}from"../once/once.js";import{__exports as f}from"../../_virtual/common.js";var u,p;function l(){if(p)return u;p=1,u=S;var l=t,m=i;m.Minimatch;var _=r(),d=e.EventEmitter,v=s,y=o,b=n(),g=a(),E=f,k=E.setopts,A=E.ownProp,j=h,w=E.childrenIgnored,I=E.isIgnored,O=c;function S(t,i,r){if("function"==typeof i&&(r=i,i={}),i||(i={}),i.sync){if(r)throw new TypeError("callback provided to sync glob");return g(t,i)}return new L(t,i,r)}S.sync=g;var R=S.GlobSync=g.GlobSync;function L(t,i,r){if("function"==typeof i&&(r=i,i=null),i&&i.sync){if(r)throw new TypeError("callback provided to sync glob");return new R(t,i)}if(!(this instanceof L))return new L(t,i,r);k(this,t,i),this._didRealPath=!1;var e=this.minimatch.set.length;this.matches=new Array(e),"function"==typeof r&&(r=O(r),this.on("error",r),this.on("end",(function(t){r(null,t)})));var s=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===e)return a();for(var o=!0,n=0;n<e;n++)this._process(this.minimatch.set[n],n,!1,a);function a(){--s._processing,s._processing<=0&&(o?process.nextTick((function(){s._finish()})):s._finish())}o=!1}return S.glob=S,S.hasMagic=function(t,i){var r=function(t,i){if(null===i||"object"!=typeof i)return t;for(var r=Object.keys(i),e=r.length;e--;)t[r[e]]=i[r[e]];return t}({},i);r.noprocess=!0;var e=new L(t,r).minimatch.set;if(!t)return!1;if(e.length>1)return!0;for(var s=0;s<e[0].length;s++)if("string"!=typeof e[0][s])return!0;return!1},S.Glob=L,_(L,d),L.prototype._finish=function(){if(y(this instanceof L),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();E.finish(this),this.emit("end",this.found)}},L.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var t=this.matches.length;if(0===t)return this._finish();for(var i=this,r=0;r<this.matches.length;r++)this._realpathSet(r,e)}function e(){0==--t&&i._finish()}},L.prototype._realpathSet=function(t,i){var r=this.matches[t];if(!r)return i();var e=Object.keys(r),s=this,o=e.length;if(0===o)return i();var n=this.matches[t]=Object.create(null);e.forEach((function(r,e){r=s._makeAbs(r),l.realpath(r,s.realpathCache,(function(e,a){e?"stat"===e.syscall?n[r]=!0:s.emit("error",e):n[a]=!0,0==--o&&(s.matches[t]=n,i())}))}))},L.prototype._mark=function(t){return E.mark(this,t)},L.prototype._makeAbs=function(t){return E.makeAbs(this,t)},L.prototype.abort=function(){this.aborted=!0,this.emit("abort")},L.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},L.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var i=0;i<t.length;i++){var r=t[i];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var e=this._processQueue.slice(0);this._processQueue.length=0;for(i=0;i<e.length;i++){var s=e[i];this._processing--,this._process(s[0],s[1],s[2],s[3])}}}},L.prototype._process=function(t,i,r,e){if(y(this instanceof L),y("function"==typeof e),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([t,i,r,e]);else{for(var s,o=0;"string"==typeof t[o];)o++;switch(o){case t.length:return void this._processSimple(t.join("/"),i,e);case 0:s=null;break;default:s=t.slice(0,o).join("/")}var n,a=t.slice(o);null===s?n=".":b(s)||b(t.map((function(t){return"string"==typeof t?t:"[*]"})).join("/"))?(s&&b(s)||(s="/"+s),n=s):n=s;var h=this._makeAbs(n);if(w(this,n))return e();a[0]===m.GLOBSTAR?this._processGlobStar(s,n,h,a,i,r,e):this._processReaddir(s,n,h,a,i,r,e)}},L.prototype._processReaddir=function(t,i,r,e,s,o,n){var a=this;this._readdir(r,o,(function(h,c){return a._processReaddir2(t,i,r,e,s,o,c,n)}))},L.prototype._processReaddir2=function(t,i,r,e,s,o,n,a){if(!n)return a();for(var h=e[0],c=!!this.minimatch.negate,f=h._glob,u=this.dot||"."===f.charAt(0),p=[],l=0;l<n.length;l++){if("."!==(_=n[l]).charAt(0)||u)(c&&!t?!_.match(h):_.match(h))&&p.push(_)}var m=p.length;if(0===m)return a();if(1===e.length&&!this.mark&&!this.stat){this.matches[s]||(this.matches[s]=Object.create(null));for(l=0;l<m;l++){var _=p[l];t&&(_="/"!==t?t+"/"+_:t+_),"/"!==_.charAt(0)||this.nomount||(_=v.join(this.root,_)),this._emitMatch(s,_)}return a()}e.shift();for(l=0;l<m;l++){_=p[l];t&&(_="/"!==t?t+"/"+_:t+_),this._process([_].concat(e),s,o,a)}a()},L.prototype._emitMatch=function(t,i){if(!this.aborted&&!I(this,i))if(this.paused)this._emitQueue.push([t,i]);else{var r=b(i)?i:this._makeAbs(i);if(this.mark&&(i=this._mark(i)),this.absolute&&(i=r),!this.matches[t][i]){if(this.nodir){var e=this.cache[r];if("DIR"===e||Array.isArray(e))return}this.matches[t][i]=!0;var s=this.statCache[r];s&&this.emit("stat",i,s),this.emit("match",i)}}},L.prototype._readdirInGlobStar=function(t,i){if(!this.aborted){if(this.follow)return this._readdir(t,!1,i);var r=this,e=j("lstat\0"+t,(function(e,s){if(e&&"ENOENT"===e.code)return i();var o=s&&s.isSymbolicLink();r.symlinks[t]=o,o||!s||s.isDirectory()?r._readdir(t,!1,i):(r.cache[t]="FILE",i())}));e&&r.fs.lstat(t,e)}},L.prototype._readdir=function(t,i,r){if(!this.aborted&&(r=j("readdir\0"+t+"\0"+i,r))){if(i&&!A(this.symlinks,t))return this._readdirInGlobStar(t,r);if(A(this.cache,t)){var e=this.cache[t];if(!e||"FILE"===e)return r();if(Array.isArray(e))return r(null,e)}this.fs.readdir(t,function(t,i,r){return function(e,s){e?t._readdirError(i,e,r):t._readdirEntries(i,s,r)}}(this,t,r))}},L.prototype._readdirEntries=function(t,i,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var e=0;e<i.length;e++){var s=i[e];s="/"===t?t+s:t+"/"+s,this.cache[s]=!0}return this.cache[t]=i,r(null,i)}},L.prototype._readdirError=function(t,i,r){if(!this.aborted){switch(i.code){case"ENOTSUP":case"ENOTDIR":var e=this._makeAbs(t);if(this.cache[e]="FILE",e===this.cwdAbs){var s=new Error(i.code+" invalid cwd "+this.cwd);s.path=this.cwd,s.code=i.code,this.emit("error",s),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:this.cache[this._makeAbs(t)]=!1,this.strict&&(this.emit("error",i),this.abort()),this.silent||console.error("glob error",i)}return r()}},L.prototype._processGlobStar=function(t,i,r,e,s,o,n){var a=this;this._readdir(r,o,(function(h,c){a._processGlobStar2(t,i,r,e,s,o,c,n)}))},L.prototype._processGlobStar2=function(t,i,r,e,s,o,n,a){if(!n)return a();var h=e.slice(1),c=t?[t]:[],f=c.concat(h);this._process(f,s,!1,a);var u=this.symlinks[r],p=n.length;if(u&&o)return a();for(var l=0;l<p;l++){if("."!==n[l].charAt(0)||this.dot){var m=c.concat(n[l],h);this._process(m,s,!0,a);var _=c.concat(n[l],e);this._process(_,s,!0,a)}}a()},L.prototype._processSimple=function(t,i,r){var e=this;this._stat(t,(function(s,o){e._processSimple2(t,i,s,o,r)}))},L.prototype._processSimple2=function(t,i,r,e,s){if(this.matches[i]||(this.matches[i]=Object.create(null)),!e)return s();if(t&&b(t)&&!this.nomount){var o=/[\/\\]$/.test(t);"/"===t.charAt(0)?t=v.join(this.root,t):(t=v.resolve(this.root,t),o&&(t+="/"))}"win32"===process.platform&&(t=t.replace(/\\/g,"/")),this._emitMatch(i,t),s()},L.prototype._stat=function(t,i){var r=this._makeAbs(t),e="/"===t.slice(-1);if(t.length>this.maxLength)return i();if(!this.stat&&A(this.cache,r)){var s=this.cache[r];if(Array.isArray(s)&&(s="DIR"),!e||"DIR"===s)return i(null,s);if(e&&"FILE"===s)return i()}var o=this.statCache[r];if(void 0!==o){if(!1===o)return i(null,o);var n=o.isDirectory()?"DIR":"FILE";return e&&"FILE"===n?i():i(null,n,o)}var a=this,h=j("stat\0"+r,(function(e,s){if(s&&s.isSymbolicLink())return a.fs.stat(r,(function(e,o){e?a._stat2(t,r,null,s,i):a._stat2(t,r,e,o,i)}));a._stat2(t,r,e,s,i)}));h&&a.fs.lstat(r,h)},L.prototype._stat2=function(t,i,r,e,s){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[i]=!1,s();var o="/"===t.slice(-1);if(this.statCache[i]=e,"/"===i.slice(-1)&&e&&!e.isDirectory())return s(null,!1,e);var n=!0;return e&&(n=e.isDirectory()?"DIR":"FILE"),this.cache[i]=this.cache[i]||n,o&&"FILE"===n?s():s(null,n,e)},u}export{l as __require};
@@ -1 +1 @@
1
- import{__require as t}from"../fs.realpath/index.js";import{__require as r}from"../minimatch/minimatch.js";import{__require as i}from"./glob.js";import"util";import s from"path";import e from"assert";import{__require as a}from"../path-is-absolute/index.js";import"./common.js";import{__exports as o}from"../../_virtual/common.js";var h,c;function n(){if(c)return h;c=1,h=b,b.GlobSync=k;var n=t(),f=r();f.Minimatch,i().Glob;var l=s,p=e,m=a(),u=o,d=u.setopts,_=u.ownProp,y=u.childrenIgnored,v=u.isIgnored;function b(t,r){if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new k(t,r).found}function k(t,r){if(!t)throw new Error("must provide pattern");if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof k))return new k(t,r);if(d(this,t,r),this.noprocess)return this;var i=this.minimatch.set.length;this.matches=new Array(i);for(var s=0;s<i;s++)this._process(this.minimatch.set[s],s,!1);this._finish()}return k.prototype._finish=function(){if(p.ok(this instanceof k),this.realpath){var t=this;this.matches.forEach((function(r,i){var s=t.matches[i]=Object.create(null);for(var e in r)try{e=t._makeAbs(e),s[n.realpathSync(e,t.realpathCache)]=!0}catch(r){if("stat"!==r.syscall)throw r;s[t._makeAbs(e)]=!0}}))}u.finish(this)},k.prototype._process=function(t,r,i){p.ok(this instanceof k);for(var s,e=0;"string"==typeof t[e];)e++;switch(e){case t.length:return void this._processSimple(t.join("/"),r);case 0:s=null;break;default:s=t.slice(0,e).join("/")}var a,o=t.slice(e);null===s?a=".":m(s)||m(t.map((function(t){return"string"==typeof t?t:"[*]"})).join("/"))?(s&&m(s)||(s="/"+s),a=s):a=s;var h=this._makeAbs(a);y(this,a)||(o[0]===f.GLOBSTAR?this._processGlobStar(s,a,h,o,r,i):this._processReaddir(s,a,h,o,r,i))},k.prototype._processReaddir=function(t,r,i,s,e,a){var o=this._readdir(i,a);if(o){for(var h=s[0],c=!!this.minimatch.negate,n=h._glob,f=this.dot||"."===n.charAt(0),p=[],m=0;m<o.length;m++){if("."!==(_=o[m]).charAt(0)||f)(c&&!t?!_.match(h):_.match(h))&&p.push(_)}var u=p.length;if(0!==u)if(1!==s.length||this.mark||this.stat){s.shift();for(m=0;m<u;m++){var d;_=p[m];d=t?[t,_]:[_],this._process(d.concat(s),e,a)}}else{this.matches[e]||(this.matches[e]=Object.create(null));for(var m=0;m<u;m++){var _=p[m];t&&(_="/"!==t.slice(-1)?t+"/"+_:t+_),"/"!==_.charAt(0)||this.nomount||(_=l.join(this.root,_)),this._emitMatch(e,_)}}}},k.prototype._emitMatch=function(t,r){if(!v(this,r)){var i=this._makeAbs(r);if(this.mark&&(r=this._mark(r)),this.absolute&&(r=i),!this.matches[t][r]){if(this.nodir){var s=this.cache[i];if("DIR"===s||Array.isArray(s))return}this.matches[t][r]=!0,this.stat&&this._stat(r)}}},k.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,!1);var r,i;try{i=this.fs.lstatSync(t)}catch(t){if("ENOENT"===t.code)return null}var s=i&&i.isSymbolicLink();return this.symlinks[t]=s,s||!i||i.isDirectory()?r=this._readdir(t,!1):this.cache[t]="FILE",r},k.prototype._readdir=function(t,r){if(r&&!_(this.symlinks,t))return this._readdirInGlobStar(t);if(_(this.cache,t)){var i=this.cache[t];if(!i||"FILE"===i)return null;if(Array.isArray(i))return i}try{return this._readdirEntries(t,this.fs.readdirSync(t))}catch(r){return this._readdirError(t,r),null}},k.prototype._readdirEntries=function(t,r){if(!this.mark&&!this.stat)for(var i=0;i<r.length;i++){var s=r[i];s="/"===t?t+s:t+"/"+s,this.cache[s]=!0}return this.cache[t]=r,r},k.prototype._readdirError=function(t,r){switch(r.code){case"ENOTSUP":case"ENOTDIR":var i=this._makeAbs(t);if(this.cache[i]="FILE",i===this.cwdAbs){var s=new Error(r.code+" invalid cwd "+this.cwd);throw s.path=this.cwd,s.code=r.code,s}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:if(this.cache[this._makeAbs(t)]=!1,this.strict)throw r;this.silent||console.error("glob error",r)}},k.prototype._processGlobStar=function(t,r,i,s,e,a){var o=this._readdir(i,a);if(o){var h=s.slice(1),c=t?[t]:[],n=c.concat(h);this._process(n,e,!1);var f=o.length;if(!this.symlinks[i]||!a)for(var l=0;l<f;l++){if("."!==o[l].charAt(0)||this.dot){var p=c.concat(o[l],h);this._process(p,e,!0);var m=c.concat(o[l],s);this._process(m,e,!0)}}}},k.prototype._processSimple=function(t,r){var i=this._stat(t);if(this.matches[r]||(this.matches[r]=Object.create(null)),i){if(t&&m(t)&&!this.nomount){var s=/[\/\\]$/.test(t);"/"===t.charAt(0)?t=l.join(this.root,t):(t=l.resolve(this.root,t),s&&(t+="/"))}"win32"===process.platform&&(t=t.replace(/\\/g,"/")),this._emitMatch(r,t)}},k.prototype._stat=function(t){var r=this._makeAbs(t),i="/"===t.slice(-1);if(t.length>this.maxLength)return!1;if(!this.stat&&_(this.cache,r)){var s=this.cache[r];if(Array.isArray(s)&&(s="DIR"),!i||"DIR"===s)return s;if(i&&"FILE"===s)return!1}var e=this.statCache[r];if(!e){var a;try{a=this.fs.lstatSync(r)}catch(t){if(t&&("ENOENT"===t.code||"ENOTDIR"===t.code))return this.statCache[r]=!1,!1}if(a&&a.isSymbolicLink())try{e=this.fs.statSync(r)}catch(t){e=a}else e=a}this.statCache[r]=e;s=!0;return e&&(s=e.isDirectory()?"DIR":"FILE"),this.cache[r]=this.cache[r]||s,(!i||"FILE"!==s)&&s},k.prototype._mark=function(t){return u.mark(this,t)},k.prototype._makeAbs=function(t){return u.makeAbs(this,t)},h}export{n as __require};
1
+ import{f as t}from"../fs.realpath/index.js";import{m as r}from"../minimatch/minimatch.js";import{__require as i}from"./glob.js";import"util";import s from"path";import e from"assert";import{__require as a}from"../path-is-absolute/index.js";import"./common.js";import{__exports as o}from"../../_virtual/common.js";var h,c;function n(){if(c)return h;c=1,h=b,b.GlobSync=k;var n=t,f=r;f.Minimatch,i().Glob;var l=s,p=e,m=a(),u=o,d=u.setopts,_=u.ownProp,y=u.childrenIgnored,v=u.isIgnored;function b(t,r){if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new k(t,r).found}function k(t,r){if(!t)throw new Error("must provide pattern");if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof k))return new k(t,r);if(d(this,t,r),this.noprocess)return this;var i=this.minimatch.set.length;this.matches=new Array(i);for(var s=0;s<i;s++)this._process(this.minimatch.set[s],s,!1);this._finish()}return k.prototype._finish=function(){if(p.ok(this instanceof k),this.realpath){var t=this;this.matches.forEach((function(r,i){var s=t.matches[i]=Object.create(null);for(var e in r)try{e=t._makeAbs(e),s[n.realpathSync(e,t.realpathCache)]=!0}catch(r){if("stat"!==r.syscall)throw r;s[t._makeAbs(e)]=!0}}))}u.finish(this)},k.prototype._process=function(t,r,i){p.ok(this instanceof k);for(var s,e=0;"string"==typeof t[e];)e++;switch(e){case t.length:return void this._processSimple(t.join("/"),r);case 0:s=null;break;default:s=t.slice(0,e).join("/")}var a,o=t.slice(e);null===s?a=".":m(s)||m(t.map((function(t){return"string"==typeof t?t:"[*]"})).join("/"))?(s&&m(s)||(s="/"+s),a=s):a=s;var h=this._makeAbs(a);y(this,a)||(o[0]===f.GLOBSTAR?this._processGlobStar(s,a,h,o,r,i):this._processReaddir(s,a,h,o,r,i))},k.prototype._processReaddir=function(t,r,i,s,e,a){var o=this._readdir(i,a);if(o){for(var h=s[0],c=!!this.minimatch.negate,n=h._glob,f=this.dot||"."===n.charAt(0),p=[],m=0;m<o.length;m++){if("."!==(_=o[m]).charAt(0)||f)(c&&!t?!_.match(h):_.match(h))&&p.push(_)}var u=p.length;if(0!==u)if(1!==s.length||this.mark||this.stat){s.shift();for(m=0;m<u;m++){var d;_=p[m];d=t?[t,_]:[_],this._process(d.concat(s),e,a)}}else{this.matches[e]||(this.matches[e]=Object.create(null));for(var m=0;m<u;m++){var _=p[m];t&&(_="/"!==t.slice(-1)?t+"/"+_:t+_),"/"!==_.charAt(0)||this.nomount||(_=l.join(this.root,_)),this._emitMatch(e,_)}}}},k.prototype._emitMatch=function(t,r){if(!v(this,r)){var i=this._makeAbs(r);if(this.mark&&(r=this._mark(r)),this.absolute&&(r=i),!this.matches[t][r]){if(this.nodir){var s=this.cache[i];if("DIR"===s||Array.isArray(s))return}this.matches[t][r]=!0,this.stat&&this._stat(r)}}},k.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,!1);var r,i;try{i=this.fs.lstatSync(t)}catch(t){if("ENOENT"===t.code)return null}var s=i&&i.isSymbolicLink();return this.symlinks[t]=s,s||!i||i.isDirectory()?r=this._readdir(t,!1):this.cache[t]="FILE",r},k.prototype._readdir=function(t,r){if(r&&!_(this.symlinks,t))return this._readdirInGlobStar(t);if(_(this.cache,t)){var i=this.cache[t];if(!i||"FILE"===i)return null;if(Array.isArray(i))return i}try{return this._readdirEntries(t,this.fs.readdirSync(t))}catch(r){return this._readdirError(t,r),null}},k.prototype._readdirEntries=function(t,r){if(!this.mark&&!this.stat)for(var i=0;i<r.length;i++){var s=r[i];s="/"===t?t+s:t+"/"+s,this.cache[s]=!0}return this.cache[t]=r,r},k.prototype._readdirError=function(t,r){switch(r.code){case"ENOTSUP":case"ENOTDIR":var i=this._makeAbs(t);if(this.cache[i]="FILE",i===this.cwdAbs){var s=new Error(r.code+" invalid cwd "+this.cwd);throw s.path=this.cwd,s.code=r.code,s}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:if(this.cache[this._makeAbs(t)]=!1,this.strict)throw r;this.silent||console.error("glob error",r)}},k.prototype._processGlobStar=function(t,r,i,s,e,a){var o=this._readdir(i,a);if(o){var h=s.slice(1),c=t?[t]:[],n=c.concat(h);this._process(n,e,!1);var f=o.length;if(!this.symlinks[i]||!a)for(var l=0;l<f;l++){if("."!==o[l].charAt(0)||this.dot){var p=c.concat(o[l],h);this._process(p,e,!0);var m=c.concat(o[l],s);this._process(m,e,!0)}}}},k.prototype._processSimple=function(t,r){var i=this._stat(t);if(this.matches[r]||(this.matches[r]=Object.create(null)),i){if(t&&m(t)&&!this.nomount){var s=/[\/\\]$/.test(t);"/"===t.charAt(0)?t=l.join(this.root,t):(t=l.resolve(this.root,t),s&&(t+="/"))}"win32"===process.platform&&(t=t.replace(/\\/g,"/")),this._emitMatch(r,t)}},k.prototype._stat=function(t){var r=this._makeAbs(t),i="/"===t.slice(-1);if(t.length>this.maxLength)return!1;if(!this.stat&&_(this.cache,r)){var s=this.cache[r];if(Array.isArray(s)&&(s="DIR"),!i||"DIR"===s)return s;if(i&&"FILE"===s)return!1}var e=this.statCache[r];if(!e){var a;try{a=this.fs.lstatSync(r)}catch(t){if(t&&("ENOENT"===t.code||"ENOTDIR"===t.code))return this.statCache[r]=!1,!1}if(a&&a.isSymbolicLink())try{e=this.fs.statSync(r)}catch(t){e=a}else e=a}this.statCache[r]=e;s=!0;return e&&(s=e.isDirectory()?"DIR":"FILE"),this.cache[r]=this.cache[r]||s,(!i||"FILE"!==s)&&s},k.prototype._mark=function(t){return u.mark(this,t)},k.prototype._makeAbs=function(t){return u.makeAbs(this,t)},h}export{n as __require};
@@ -1 +1 @@
1
- import{w as r}from"../wrappy/wrappy.js";import{o as n}from"../once/once.js";var e,t;function l(){if(t)return e;t=1;var l=r,o=Object.create(null),u=n;return e=l((function(r,n){return o[r]?(o[r].push(n),null):(o[r]=[n],function(r){return u((function n(){var e=o[r],t=e.length,l=function(r){for(var n=r.length,e=[],t=0;t<n;t++)e[t]=r[t];return e}(arguments);try{for(var u=0;u<t;u++)e[u].apply(null,l)}finally{e.length>t?(e.splice(0,t),process.nextTick((function(){n.apply(null,l)}))):delete o[r]}}))}(r))})),e}export{l as __require};
1
+ import{w as n}from"../wrappy/wrappy.js";import{o as r}from"../once/once.js";var t=n,e=Object.create(null),l=r,o=t((function(n,r){return e[n]?(e[n].push(r),null):(e[n]=[r],function(n){return l((function r(){var t=e[n],l=t.length,o=function(n){for(var r=n.length,t=[],e=0;e<r;e++)t[e]=n[e];return t}(arguments);try{for(var p=0;p<l;p++)t[p].apply(null,o)}finally{t.length>l?(t.splice(0,l),process.nextTick((function(){r.apply(null,o)}))):delete e[n]}}))}(n))}));export{o as i};
@@ -1 +1 @@
1
- import{__require as t}from"./node_modules/brace-expansion/index.js";var e,n;function r(){if(n)return e;n=1,e=f,f.Minimatch=l;var r=function(){try{return require("path")}catch(t){}}()||{sep:"/"};f.sep=r.sep;var i=f.GLOBSTAR=l.GLOBSTAR={},s=t(),a={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},o="[^/]",u=o+"*?",c="().*{}+?[]^$\\!".split("").reduce((function(t,e){return t[e]=!0,t}),{});var h=/\/+/;function p(t,e){e=e||{};var n={};return Object.keys(t).forEach((function(e){n[e]=t[e]})),Object.keys(e).forEach((function(t){n[t]=e[t]})),n}function f(t,e,n){return d(e),n||(n={}),!(!n.nocomment&&"#"===e.charAt(0))&&new l(e,n).match(t)}function l(t,e){if(!(this instanceof l))return new l(t,e);d(t),e||(e={}),t=t.trim(),e.allowWindowsEscape||"/"===r.sep||(t=t.split(r.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}function g(t,e){return e||(e=this instanceof l?this.options:{}),t=void 0===t?this.pattern:t,d(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:s(t)}f.filter=function(t,e){return e=e||{},function(n,r,i){return f(n,t,e)}},f.defaults=function(t){if(!t||"object"!=typeof t||!Object.keys(t).length)return f;var e=f,n=function(n,r,i){return e(n,r,p(t,i))};return(n.Minimatch=function(n,r){return new e.Minimatch(n,p(t,r))}).defaults=function(n){return e.defaults(p(t,n)).Minimatch},n.filter=function(n,r){return e.filter(n,p(t,r))},n.defaults=function(n){return e.defaults(p(t,n))},n.makeRe=function(n,r){return e.makeRe(n,p(t,r))},n.braceExpand=function(n,r){return e.braceExpand(n,p(t,r))},n.match=function(n,r,i){return e.match(n,r,p(t,i))},n},l.defaults=function(t){return f.defaults(t).Minimatch},l.prototype.debug=function(){},l.prototype.make=function(){var t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();e.debug&&(this.debug=function(){console.error.apply(console,arguments)});this.debug(this.pattern,n),n=this.globParts=n.map((function(t){return t.split(h)})),this.debug(this.pattern,n),n=n.map((function(t,e,n){return t.map(this.parse,this)}),this),this.debug(this.pattern,n),n=n.filter((function(t){return-1===t.indexOf(!1)})),this.debug(this.pattern,n),this.set=n},l.prototype.parseNegate=function(){var t=this.pattern,e=!1,n=this.options,r=0;if(n.nonegate)return;for(var i=0,s=t.length;i<s&&"!"===t.charAt(i);i++)e=!e,r++;r&&(this.pattern=t.substr(r));this.negate=e},f.braceExpand=function(t,e){return g(t,e)},l.prototype.braceExpand=g;var d=function(t){if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};l.prototype.parse=function(t,e){d(t);var n=this.options;if("**"===t){if(!n.noglobstar)return i;t="*"}if(""===t)return"";var r,s="",h=!!n.nocase,p=!1,f=[],l=[],g=!1,m=-1,v=-1,y="."===t.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",w=this;function x(){if(r){switch(r){case"*":s+=u,h=!0;break;case"?":s+=o,h=!0;break;default:s+="\\"+r}w.debug("clearStateChar %j %j",r,s),r=!1}}for(var E,j=0,k=t.length;j<k&&(E=t.charAt(j));j++)if(this.debug("%s\t%s %s %j",t,j,s,E),p&&c[E])s+="\\"+E,p=!1;else switch(E){case"/":return!1;case"\\":x(),p=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,j,s,E),g){this.debug(" in class"),"!"===E&&j===v+1&&(E="^"),s+=E;continue}w.debug("call clearStateChar %j",r),x(),r=E,n.noext&&x();continue;case"(":if(g){s+="(";continue}if(!r){s+="\\(";continue}f.push({type:r,start:j-1,reStart:s.length,open:a[r].open,close:a[r].close}),s+="!"===r?"(?:(?!(?:":"(?:",this.debug("plType %j %j",r,s),r=!1;continue;case")":if(g||!f.length){s+="\\)";continue}x(),h=!0;var O=f.pop();s+=O.close,"!"===O.type&&l.push(O),O.reEnd=s.length;continue;case"|":if(g||!f.length||p){s+="\\|",p=!1;continue}x(),s+="|";continue;case"[":if(x(),g){s+="\\"+E;continue}g=!0,v=j,m=s.length,s+=E;continue;case"]":if(j===v+1||!g){s+="\\"+E,p=!1;continue}var R=t.substring(v+1,j);try{RegExp("["+R+"]")}catch(t){var A=this.parse(R,b);s=s.substr(0,m)+"\\["+A[0]+"\\]",h=h||A[1],g=!1;continue}h=!0,g=!1,s+=E;continue;default:x(),p?p=!1:!c[E]||"^"===E&&g||(s+="\\"),s+=E}g&&(R=t.substr(v+1),A=this.parse(R,b),s=s.substr(0,m)+"\\["+A[0],h=h||A[1]);for(O=f.pop();O;O=f.pop()){var S=s.slice(O.reStart+O.open.length);this.debug("setting tail",s,O),S=S.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(t,e,n){return n||(n="\\"),e+e+n+"|"})),this.debug("tail=%j\n %s",S,S,O,s);var $="*"===O.type?u:"?"===O.type?o:"\\"+O.type;h=!0,s=s.slice(0,O.reStart)+$+"\\("+S}x(),p&&(s+="\\\\");var _=!1;switch(s.charAt(0)){case"[":case".":case"(":_=!0}for(var T=l.length-1;T>-1;T--){var M=l[T],B=s.slice(0,M.reStart),N=s.slice(M.reStart,M.reEnd-8),q=s.slice(M.reEnd-8,M.reEnd),C=s.slice(M.reEnd);q+=C;var G=B.split("(").length-1,L=C;for(j=0;j<G;j++)L=L.replace(/\)[+*?]?/,"");var P="";""===(C=L)&&e!==b&&(P="$"),s=B+N+C+P+q}""!==s&&h&&(s="(?=.)"+s);_&&(s=y+s);if(e===b)return[s,h];if(!h)return function(t){return t.replace(/\\(.)/g,"$1")}(t);var W=n.nocase?"i":"";try{var z=new RegExp("^"+s+"$",W)}catch(t){return new RegExp("$.")}return z._glob=t,z._src=s,z};var b={};return f.makeRe=function(t,e){return new l(t,e||{}).makeRe()},l.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,n=e.noglobstar?u:e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=e.nocase?"i":"",s=t.map((function(t){return t.map((function(t){return t===i?n:"string"==typeof t?function(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(t):t._src})).join("\\/")})).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,r)}catch(t){this.regexp=!1}return this.regexp},f.match=function(t,e,n){var r=new l(e,n=n||{});return t=t.filter((function(t){return r.match(t)})),r.options.nonull&&!t.length&&t.push(e),t},l.prototype.match=function(t,e){if(void 0===e&&(e=this.partial),this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;var n=this.options;"/"!==r.sep&&(t=t.split(r.sep).join("/")),t=t.split(h),this.debug(this.pattern,"split",t);var i,s,a=this.set;for(this.debug(this.pattern,"set",a),s=t.length-1;s>=0&&!(i=t[s]);s--);for(s=0;s<a.length;s++){var o=a[s],u=t;if(n.matchBase&&1===o.length&&(u=[i]),this.matchOne(u,o,e))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate},l.prototype.matchOne=function(t,e,n){var r=this.options;this.debug("matchOne",{this:this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var s=0,a=0,o=t.length,u=e.length;s<o&&a<u;s++,a++){this.debug("matchOne loop");var c,h=e[a],p=t[s];if(this.debug(e,h,p),!1===h)return!1;if(h===i){this.debug("GLOBSTAR",[e,h,p]);var f=s,l=a+1;if(l===u){for(this.debug("** at the end");s<o;s++)if("."===t[s]||".."===t[s]||!r.dot&&"."===t[s].charAt(0))return!1;return!0}for(;f<o;){var g=t[f];if(this.debug("\nglobstar while",t,f,e,l,g),this.matchOne(t.slice(f),e.slice(l),n))return this.debug("globstar found match!",f,o,g),!0;if("."===g||".."===g||!r.dot&&"."===g.charAt(0)){this.debug("dot detected!",t,f,e,l);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!n||(this.debug("\n>>> no match, partial?",t,f,e,l),f!==o))}if("string"==typeof h?(c=p===h,this.debug("string match",h,p,c)):(c=p.match(h),this.debug("pattern match",h,p,c)),!c)return!1}if(s===o&&a===u)return!0;if(s===o)return n;if(a===u)return s===o-1&&""===t[s];throw new Error("wtf?")},e}export{r as __require};
1
+ import{b as t}from"./node_modules/brace-expansion/index.js";var e=p;p.Minimatch=f;var n=function(){try{return require("path")}catch(t){}}()||{sep:"/"};p.sep=n.sep;var r=p.GLOBSTAR=f.GLOBSTAR={},i=t,s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},a="[^/]",o=a+"*?",c="().*{}+?[]^$\\!".split("").reduce((function(t,e){return t[e]=!0,t}),{});var u=/\/+/;function h(t,e){e=e||{};var n={};return Object.keys(t).forEach((function(e){n[e]=t[e]})),Object.keys(e).forEach((function(t){n[t]=e[t]})),n}function p(t,e,n){return g(e),n||(n={}),!(!n.nocomment&&"#"===e.charAt(0))&&new f(e,n).match(t)}function f(t,e){if(!(this instanceof f))return new f(t,e);g(t),e||(e={}),t=t.trim(),e.allowWindowsEscape||"/"===n.sep||(t=t.split(n.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}function l(t,e){return e||(e=this instanceof f?this.options:{}),t=void 0===t?this.pattern:t,g(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:i(t)}p.filter=function(t,e){return e=e||{},function(n,r,i){return p(n,t,e)}},p.defaults=function(t){if(!t||"object"!=typeof t||!Object.keys(t).length)return p;var e=p,n=function(n,r,i){return e(n,r,h(t,i))};return(n.Minimatch=function(n,r){return new e.Minimatch(n,h(t,r))}).defaults=function(n){return e.defaults(h(t,n)).Minimatch},n.filter=function(n,r){return e.filter(n,h(t,r))},n.defaults=function(n){return e.defaults(h(t,n))},n.makeRe=function(n,r){return e.makeRe(n,h(t,r))},n.braceExpand=function(n,r){return e.braceExpand(n,h(t,r))},n.match=function(n,r,i){return e.match(n,r,h(t,i))},n},f.defaults=function(t){return p.defaults(t).Minimatch},f.prototype.debug=function(){},f.prototype.make=function(){var t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();e.debug&&(this.debug=function(){console.error.apply(console,arguments)});this.debug(this.pattern,n),n=this.globParts=n.map((function(t){return t.split(u)})),this.debug(this.pattern,n),n=n.map((function(t,e,n){return t.map(this.parse,this)}),this),this.debug(this.pattern,n),n=n.filter((function(t){return-1===t.indexOf(!1)})),this.debug(this.pattern,n),this.set=n},f.prototype.parseNegate=function(){var t=this.pattern,e=!1,n=this.options,r=0;if(n.nonegate)return;for(var i=0,s=t.length;i<s&&"!"===t.charAt(i);i++)e=!e,r++;r&&(this.pattern=t.substr(r));this.negate=e},p.braceExpand=function(t,e){return l(t,e)},f.prototype.braceExpand=l;var g=function(t){if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};f.prototype.parse=function(t,e){g(t);var n=this.options;if("**"===t){if(!n.noglobstar)return r;t="*"}if(""===t)return"";var i,u="",h=!!n.nocase,p=!1,f=[],l=[],b=!1,m=-1,v=-1,y="."===t.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",w=this;function x(){if(i){switch(i){case"*":u+=o,h=!0;break;case"?":u+=a,h=!0;break;default:u+="\\"+i}w.debug("clearStateChar %j %j",i,u),i=!1}}for(var E,j=0,k=t.length;j<k&&(E=t.charAt(j));j++)if(this.debug("%s\t%s %s %j",t,j,u,E),p&&c[E])u+="\\"+E,p=!1;else switch(E){case"/":return!1;case"\\":x(),p=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,j,u,E),b){this.debug(" in class"),"!"===E&&j===v+1&&(E="^"),u+=E;continue}w.debug("call clearStateChar %j",i),x(),i=E,n.noext&&x();continue;case"(":if(b){u+="(";continue}if(!i){u+="\\(";continue}f.push({type:i,start:j-1,reStart:u.length,open:s[i].open,close:s[i].close}),u+="!"===i?"(?:(?!(?:":"(?:",this.debug("plType %j %j",i,u),i=!1;continue;case")":if(b||!f.length){u+="\\)";continue}x(),h=!0;var O=f.pop();u+=O.close,"!"===O.type&&l.push(O),O.reEnd=u.length;continue;case"|":if(b||!f.length||p){u+="\\|",p=!1;continue}x(),u+="|";continue;case"[":if(x(),b){u+="\\"+E;continue}b=!0,v=j,m=u.length,u+=E;continue;case"]":if(j===v+1||!b){u+="\\"+E,p=!1;continue}var R=t.substring(v+1,j);try{RegExp("["+R+"]")}catch(t){var A=this.parse(R,d);u=u.substr(0,m)+"\\["+A[0]+"\\]",h=h||A[1],b=!1;continue}h=!0,b=!1,u+=E;continue;default:x(),p?p=!1:!c[E]||"^"===E&&b||(u+="\\"),u+=E}b&&(R=t.substr(v+1),A=this.parse(R,d),u=u.substr(0,m)+"\\["+A[0],h=h||A[1]);for(O=f.pop();O;O=f.pop()){var S=u.slice(O.reStart+O.open.length);this.debug("setting tail",u,O),S=S.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(t,e,n){return n||(n="\\"),e+e+n+"|"})),this.debug("tail=%j\n %s",S,S,O,u);var $="*"===O.type?o:"?"===O.type?a:"\\"+O.type;h=!0,u=u.slice(0,O.reStart)+$+"\\("+S}x(),p&&(u+="\\\\");var T=!1;switch(u.charAt(0)){case"[":case".":case"(":T=!0}for(var M=l.length-1;M>-1;M--){var B=l[M],N=u.slice(0,B.reStart),_=u.slice(B.reStart,B.reEnd-8),C=u.slice(B.reEnd-8,B.reEnd),G=u.slice(B.reEnd);C+=G;var L=N.split("(").length-1,q=G;for(j=0;j<L;j++)q=q.replace(/\)[+*?]?/,"");var P="";""===(G=q)&&e!==d&&(P="$"),u=N+_+G+P+C}""!==u&&h&&(u="(?=.)"+u);T&&(u=y+u);if(e===d)return[u,h];if(!h)return function(t){return t.replace(/\\(.)/g,"$1")}(t);var W=n.nocase?"i":"";try{var z=new RegExp("^"+u+"$",W)}catch(t){return new RegExp("$.")}return z._glob=t,z._src=u,z};var d={};p.makeRe=function(t,e){return new f(t,e||{}).makeRe()},f.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,n=e.noglobstar?o:e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=e.nocase?"i":"",s=t.map((function(t){return t.map((function(t){return t===r?n:"string"==typeof t?function(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(t):t._src})).join("\\/")})).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,i)}catch(t){this.regexp=!1}return this.regexp},p.match=function(t,e,n){var r=new f(e,n=n||{});return t=t.filter((function(t){return r.match(t)})),r.options.nonull&&!t.length&&t.push(e),t},f.prototype.match=function(t,e){if(void 0===e&&(e=this.partial),this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;var r=this.options;"/"!==n.sep&&(t=t.split(n.sep).join("/")),t=t.split(u),this.debug(this.pattern,"split",t);var i,s,a=this.set;for(this.debug(this.pattern,"set",a),s=t.length-1;s>=0&&!(i=t[s]);s--);for(s=0;s<a.length;s++){var o=a[s],c=t;if(r.matchBase&&1===o.length&&(c=[i]),this.matchOne(c,o,e))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate},f.prototype.matchOne=function(t,e,n){var i=this.options;this.debug("matchOne",{this:this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var s=0,a=0,o=t.length,c=e.length;s<o&&a<c;s++,a++){this.debug("matchOne loop");var u,h=e[a],p=t[s];if(this.debug(e,h,p),!1===h)return!1;if(h===r){this.debug("GLOBSTAR",[e,h,p]);var f=s,l=a+1;if(l===c){for(this.debug("** at the end");s<o;s++)if("."===t[s]||".."===t[s]||!i.dot&&"."===t[s].charAt(0))return!1;return!0}for(;f<o;){var g=t[f];if(this.debug("\nglobstar while",t,f,e,l,g),this.matchOne(t.slice(f),e.slice(l),n))return this.debug("globstar found match!",f,o,g),!0;if("."===g||".."===g||!i.dot&&"."===g.charAt(0)){this.debug("dot detected!",t,f,e,l);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!n||(this.debug("\n>>> no match, partial?",t,f,e,l),f!==o))}if("string"==typeof h?(u=p===h,this.debug("string match",h,p,u)):(u=p.match(h),this.debug("pattern match",h,p,u)),!u)return!1}if(s===o&&a===c)return!0;if(s===o)return n;if(a===c)return s===o-1&&""===t[s];throw new Error("wtf?")};export{e as m};
@@ -1 +1 @@
1
- import{__require as t}from"../../../concat-map/index.js";import{b as r}from"../../../balanced-match/index.js";var n,e;function i(){if(e)return n;e=1;var i=t(),o=r;n=function(t){if(!t)return[];"{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2));return j(function(t){return t.split("\\\\").join(a).split("\\{").join(s).split("\\}").join(p).split("\\,").join(u).split("\\.").join(f)}(t),!0).map(h)};var a="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",p="\0CLOSE"+Math.random()+"\0",u="\0COMMA"+Math.random()+"\0",f="\0PERIOD"+Math.random()+"\0";function l(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function h(t){return t.split(a).join("\\").split(s).join("{").split(p).join("}").split(u).join(",").split(f).join(".")}function d(t){if(!t)return[""];var r=[],n=o("{","}",t);if(!n)return t.split(",");var e=n.pre,i=n.body,a=n.post,s=e.split(",");s[s.length-1]+="{"+i+"}";var p=d(a);return a.length&&(s[s.length-1]+=p.shift(),s.push.apply(s,p)),r.push.apply(r,s),r}function c(t){return"{"+t+"}"}function m(t){return/^-?0\d/.test(t)}function v(t,r){return t<=r}function g(t,r){return t>=r}function j(t,r){var n=[],e=o("{","}",t);if(!e||/\$$/.test(e.pre))return[t];var a,s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(e.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(e.body),f=s||u,h=e.body.indexOf(",")>=0;if(!f&&!h)return e.post.match(/,.*\}/)?j(t=e.pre+"{"+e.body+p+e.post):[t];if(f)a=e.body.split(/\.\./);else if(1===(a=d(e.body)).length&&1===(a=j(a[0],!1).map(c)).length)return(M=e.post.length?j(e.post,!1):[""]).map((function(t){return e.pre+a[0]+t}));var b,y=e.pre,M=e.post.length?j(e.post,!1):[""];if(f){var A=l(a[0]),x=l(a[1]),C=Math.max(a[0].length,a[1].length),O=3==a.length?Math.abs(l(a[2])):1,S=v;x<A&&(O*=-1,S=g);var $=a.some(m);b=[];for(var _=A;S(_,x);_+=O){var E;if(u)"\\"===(E=String.fromCharCode(_))&&(E="");else if(E=String(_),$){var I=C-E.length;if(I>0){var q=new Array(I+1).join("0");E=_<0?"-"+q+E.slice(1):q+E}}b.push(E)}}else b=i(a,(function(t){return j(t,!1)}));for(var z=0;z<b.length;z++)for(var L=0;L<M.length;L++){var P=y+b[z]+M[L];(!r||f||P)&&n.push(P)}return n}return n}export{i as __require};
1
+ import{c as t}from"../../../concat-map/index.js";import{b as n}from"../../../balanced-match/index.js";var r=t,e=n,i=function(t){if(!t)return[];"{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2));return g(function(t){return t.split("\\\\").join(o).split("\\{").join(a).split("\\}").join(s).split("\\,").join(p).split("\\.").join(u)}(t),!0).map(f)},o="\0SLASH"+Math.random()+"\0",a="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",p="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function l(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function f(t){return t.split(o).join("\\").split(a).join("{").split(s).join("}").split(p).join(",").split(u).join(".")}function h(t){if(!t)return[""];var n=[],r=e("{","}",t);if(!r)return t.split(",");var i=r.pre,o=r.body,a=r.post,s=i.split(",");s[s.length-1]+="{"+o+"}";var p=h(a);return a.length&&(s[s.length-1]+=p.shift(),s.push.apply(s,p)),n.push.apply(n,s),n}function d(t){return"{"+t+"}"}function c(t){return/^-?0\d/.test(t)}function m(t,n){return t<=n}function v(t,n){return t>=n}function g(t,n){var i=[],o=e("{","}",t);if(!o||/\$$/.test(o.pre))return[t];var a,p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),f=p||u,b=o.body.indexOf(",")>=0;if(!f&&!b)return o.post.match(/,.*\}/)?g(t=o.pre+"{"+o.body+s+o.post):[t];if(f)a=o.body.split(/\.\./);else if(1===(a=h(o.body)).length&&1===(a=g(a[0],!1).map(d)).length)return(M=o.post.length?g(o.post,!1):[""]).map((function(t){return o.pre+a[0]+t}));var j,y=o.pre,M=o.post.length?g(o.post,!1):[""];if(f){var A=l(a[0]),x=l(a[1]),C=Math.max(a[0].length,a[1].length),O=3==a.length?Math.abs(l(a[2])):1,S=m;x<A&&(O*=-1,S=v);var $=a.some(c);j=[];for(var E=A;S(E,x);E+=O){var I;if(u)"\\"===(I=String.fromCharCode(E))&&(I="");else if(I=String(E),$){var z=C-I.length;if(z>0){var L=new Array(z+1).join("0");I=E<0?"-"+L+I.slice(1):L+I}}j.push(I)}}else j=r(a,(function(t){return g(t,!1)}));for(var P=0;P<j.length;P++)for(var Z=0;Z<M.length;Z++){var w=y+j[P]+M[Z];(!n||f||w)&&i.push(w)}return i}export{i as b};
@@ -1 +1 @@
1
- import{__module as r}from"../../_virtual/index18.js";import{__require as e}from"./cjs/react-is.production.min.js";import{__require as o}from"./cjs/react-is.development.js";"production"===process.env.NODE_ENV?r.exports=e():r.exports=o();var s=r.exports;export{s as r};
1
+ import{__module as r}from"../../_virtual/index4.js";import{__require as e}from"./cjs/react-is.production.min.js";import{__require as o}from"./cjs/react-is.development.js";"production"===process.env.NODE_ENV?r.exports=e():r.exports=o();var s=r.exports;export{s as r};
@@ -1 +1 @@
1
- import{__module as r}from"../../_virtual/index19.js";import{__require as e}from"./cjs/scheduler.production.min.js";import{__require as o}from"./cjs/scheduler.development.js";"production"===process.env.NODE_ENV?r.exports=e():r.exports=o();var s=r.exports;export{s};
1
+ import{__module as r}from"../../_virtual/index5.js";import{__require as e}from"./cjs/scheduler.production.min.js";import{__require as o}from"./cjs/scheduler.development.js";"production"===process.env.NODE_ENV?r.exports=e():r.exports=o();var s=r.exports;export{s};
@@ -1 +1 @@
1
- import{commonjsGlobal as t,getDefaultExportFromCjs as r}from"../../../_virtual/_commonjsHelpers.js";import"../../style-to-object/cjs/index.js";import"./utilities.js";import{__exports as e}from"../../../_virtual/index4.js";import{__exports as i}from"../../../_virtual/utilities.js";var o=(t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(e),s=i;function a(t,r){var e={};return t&&"string"==typeof t?((0,o.default)(t,(function(t,i){t&&i&&(e[(0,s.camelCase)(t,r)]=i)})),e):e}a.default=a;var u=r(a);export{u as default};
1
+ import{commonjsGlobal as t,getDefaultExportFromCjs as r}from"../../../_virtual/_commonjsHelpers.js";import"../../style-to-object/cjs/index.js";import"./utilities.js";import{__exports as e}from"../../../_virtual/index3.js";import{__exports as i}from"../../../_virtual/utilities.js";var o=(t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(e),s=i;function a(t,r){var e={};return t&&"string"==typeof t?((0,o.default)(t,(function(t,i){t&&i&&(e[(0,s.camelCase)(t,r)]=i)})),e):e}a.default=a;var u=r(a);export{u as default};
@@ -1 +1 @@
1
- import{commonjsGlobal as r}from"../../../_virtual/_commonjsHelpers.js";import{__exports as e}from"../../../_virtual/index4.js";import{i as t}from"../../inline-style-parser/index.js";var o=r&&r.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(r,e){var t=null;if(!r||"string"!=typeof r)return t;var o=(0,i.default)(r),n="function"==typeof e;return o.forEach((function(r){if("declaration"===r.type){var o=r.property,i=r.value;n?e(o,i,r):i&&((t=t||{})[o]=i)}})),t};var i=o(t);
1
+ import{commonjsGlobal as r}from"../../../_virtual/_commonjsHelpers.js";import{__exports as e}from"../../../_virtual/index3.js";import{i as t}from"../../inline-style-parser/index.js";var o=r&&r.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(r,e){var t=null;if(!r||"string"!=typeof r)return t;var o=(0,i.default)(r),n="function"==typeof e;return o.forEach((function(r){if("declaration"===r.type){var o=r.property,i=r.value;n?e(o,i,r):i&&((t=t||{})[o]=i)}})),t};var i=o(t);
@@ -1 +1 @@
1
- import{__module as r}from"../../../../_virtual/index21.js";import e from"buffer";var n;function o(){return n||(n=1,function(r,n){var o=e,t=o.Buffer;function f(r,e){for(var n in r)e[n]=r[n]}function u(r,e,n){return t(r,e,n)}t.from&&t.alloc&&t.allocUnsafe&&t.allocUnsafeSlow?r.exports=o:(f(o,n),n.Buffer=u),f(t,u),u.from=function(r,e,n){if("number"==typeof r)throw new TypeError("Argument must not be a number");return t(r,e,n)},u.alloc=function(r,e,n){if("number"!=typeof r)throw new TypeError("Argument must be a number");var o=t(r);return void 0!==e?"string"==typeof n?o.fill(e,n):o.fill(e):o.fill(0),o},u.allocUnsafe=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return t(r)},u.allocUnsafeSlow=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return o.SlowBuffer(r)}}(r,r.exports)),r.exports}export{o as __require};
1
+ import{__module as r}from"../../../../_virtual/index20.js";import e from"buffer";var n;function o(){return n||(n=1,function(r,n){var o=e,t=o.Buffer;function f(r,e){for(var n in r)e[n]=r[n]}function u(r,e,n){return t(r,e,n)}t.from&&t.alloc&&t.allocUnsafe&&t.allocUnsafeSlow?r.exports=o:(f(o,n),n.Buffer=u),f(t,u),u.from=function(r,e,n){if("number"==typeof r)throw new TypeError("Argument must not be a number");return t(r,e,n)},u.alloc=function(r,e,n){if("number"!=typeof r)throw new TypeError("Argument must be a number");var o=t(r);return void 0!==e?"string"==typeof n?o.fill(e,n):o.fill(e):o.fill(0),o},u.allocUnsafe=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return t(r)},u.allocUnsafeSlow=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return o.SlowBuffer(r)}}(r,r.exports)),r.exports}export{o as __require};
@@ -1 +1 @@
1
- import{__module as r}from"../../../../_virtual/index17.js";import{g as t}from"../../../graceful-fs/graceful-fs.js";import e from"path";import{l as n}from"../../../lazystream/lib/lazystream.js";import{n as a}from"../../../normalize-path/index.js";import{l as o}from"../../../lodash.defaults/index.js";import i from"stream";import{r as f}from"../../../readable-stream/readable.js";import{f as u}from"./file.js";var l=t,s=e,c=n,m=a,p=o,d=i.Stream,h=f.PassThrough,g=r.exports={};g.file=u,g.collectStream=function(r,t){var e=[],n=0;r.on("error",t),r.on("data",(function(r){e.push(r),n+=r.length})),r.on("end",(function(){var r=Buffer.alloc(n),a=0;e.forEach((function(t){t.copy(r,a),a+=t.length})),t(null,r)}))},g.dateify=function(r){return(r=r||new Date)instanceof Date||(r="string"==typeof r?new Date(r):new Date),r},g.defaults=function(r,t,e){var n=arguments;return n[0]=n[0]||{},p(...n)},g.isStream=function(r){return r instanceof d},g.lazyReadStream=function(r){return new c.Readable((function(){return l.createReadStream(r)}))},g.normalizeInputSource=function(r){return null===r?Buffer.alloc(0):"string"==typeof r?Buffer.from(r):g.isStream(r)?r.pipe(new h):r},g.sanitizePath=function(r){return m(r,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")},g.trailingSlashIt=function(r){return"/"!==r.slice(-1)?r+"/":r},g.unixifyPath=function(r){return m(r,!1).replace(/^\w+:/,"")},g.walkdir=function(r,t,e){var n=[];"function"==typeof t&&(e=t,t=r),l.readdir(r,(function(a,o){var i,f,u=0;if(a)return e(a);!function a(){if(!(i=o[u++]))return e(null,n);f=s.join(r,i),l.stat(f,(function(r,e){n.push({path:f,relative:s.relative(t,f).replace(/\\/g,"/"),stats:e}),e&&e.isDirectory()?g.walkdir(f,t,(function(r,t){t.forEach((function(r){n.push(r)})),a()})):a()}))}()}))};var v=r.exports;export{v as a};
1
+ import{__module as r}from"../../../../_virtual/index14.js";import{g as t}from"../../../graceful-fs/graceful-fs.js";import e from"path";import{l as n}from"../../../lazystream/lib/lazystream.js";import{n as a}from"../../../normalize-path/index.js";import{l as o}from"../../../lodash.defaults/index.js";import i from"stream";import{r as f}from"../../../readable-stream/readable.js";import{f as u}from"./file.js";var l=t,s=e,c=n,m=a,p=o,d=i.Stream,h=f.PassThrough,g=r.exports={};g.file=u,g.collectStream=function(r,t){var e=[],n=0;r.on("error",t),r.on("data",(function(r){e.push(r),n+=r.length})),r.on("end",(function(){var r=Buffer.alloc(n),a=0;e.forEach((function(t){t.copy(r,a),a+=t.length})),t(null,r)}))},g.dateify=function(r){return(r=r||new Date)instanceof Date||(r="string"==typeof r?new Date(r):new Date),r},g.defaults=function(r,t,e){var n=arguments;return n[0]=n[0]||{},p(...n)},g.isStream=function(r){return r instanceof d},g.lazyReadStream=function(r){return new c.Readable((function(){return l.createReadStream(r)}))},g.normalizeInputSource=function(r){return null===r?Buffer.alloc(0):"string"==typeof r?Buffer.from(r):g.isStream(r)?r.pipe(new h):r},g.sanitizePath=function(r){return m(r,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")},g.trailingSlashIt=function(r){return"/"!==r.slice(-1)?r+"/":r},g.unixifyPath=function(r){return m(r,!1).replace(/^\w+:/,"")},g.walkdir=function(r,t,e){var n=[];"function"==typeof t&&(e=t,t=r),l.readdir(r,(function(a,o){var i,f,u=0;if(a)return e(a);!function a(){if(!(i=o[u++]))return e(null,n);f=s.join(r,i),l.stat(f,(function(r,e){n.push({path:f,relative:s.relative(t,f).replace(/\\/g,"/"),stats:e}),e&&e.isDirectory()?g.walkdir(f,t,(function(r,t){t.forEach((function(r){n.push(r)})),a()})):a()}))}()}))};var v=r.exports;export{v as a};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{makeStyles as t}from"@fluentui/react-components";import"../components/Markdown.js";import"../components/Textarea.js";import"../components/Button.js";import"../components/CompoundButton.js";import"../components/Spinner.js";import"../components/TextHeader.js";import"../components/TypingIndicator.js";import"../components/Dialog.js";import"../components/ChatInput.js";import"../components/CombinedPlaceholderDialog.js";import"../components/ChatMessage.js";import"../components/Header.js";import"react";import"@fluentui/react-icons";import"../services/codicent.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"../node_modules/exceljs/excel.js";import"./Canvas.js";import"./Chat.js";import"./Compose.js";import"./Snap.js";import"./Search.js";import"./Menu.js";import"./Log.js";import"./Login.js";import"./Home.js";import"./ListPage.js";import"./CrmPage.js";import"./CrmPagePersistent.js";import"./ImageView.js";import"./FormInvite.js";import"./FormAccept.js";import"./Sales.js";import"react-router-dom";import"./Purchase.js";import"../components/Content.js";import{Page as e}from"../components/Page.js";import"./QrScan.js";import"../hooks/useLocalization.js";import"../components/FileThumbnail.js";import"react-dom/client";import"../node_modules/@auth0/auth0-react/dist/auth0-react.esm.js";import"../hooks/useAppStyles.js";import"../components/MessageInput.js";import"../components/UploadFile.js";import"../components/SnapFooter.js";import"../components/Profile.js";import"../components/MessageItem.js";import"../components/AiInput.js";import"../components/SearchBox.js";import"../components/DataMessagePicker.js";import"../components/HtmlView.js";import"../components/Footer.js";import"../components/QrCodeDialog.js";import"../components/QrScanner.js";import"../components/OfflineMessage.js";import"../components/LanguageSelector.js";import"../components/ListView.js";import"../components/RecordModal.js";import"../components/BulkUploadDialog.js";import"../components/CookieBanner.js";const s=t({iframe:{width:"100%",height:"100%",border:"none"},scrollable:{overflow:"auto"},nonScrollable:{overflow:"hidden"},fixFrameHeight:{height:"calc(100% - 5px)"}}),r=({src:t,showFooter:r,title:i})=>{const m=s();return r?o(e,{hideFooter:!r,hideHeader:!0,children:o("iframe",{title:i,src:t,className:`${m.iframe} ${r?m.fixFrameHeight:""}`})}):o("iframe",{title:i,src:t,className:m.iframe})};export{r as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{makeStyles as t}from"@fluentui/react-components";import"../components/Markdown.js";import"../components/Textarea.js";import"../components/Button.js";import"../components/CompoundButton.js";import"../components/Spinner.js";import"../components/TextHeader.js";import"../components/TypingIndicator.js";import"../components/Dialog.js";import"../components/ChatInput.js";import"../components/CombinedPlaceholderDialog.js";import"../components/ChatMessage.js";import"../components/Header.js";import"react";import"@fluentui/react-icons";import"../services/codicent.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"exceljs";import"./Canvas.js";import"./Chat.js";import"./Compose.js";import"./Snap.js";import"./Search.js";import"./Menu.js";import"./Log.js";import"./Login.js";import"./Home.js";import"./ListPage.js";import"./CrmPage.js";import"./CrmPagePersistent.js";import"./ImageView.js";import"./FormInvite.js";import"./FormAccept.js";import"./Sales.js";import"react-router-dom";import"./Purchase.js";import"../components/Content.js";import{Page as e}from"../components/Page.js";import"./QrScan.js";import"../hooks/useLocalization.js";import"../components/FileThumbnail.js";import"react-dom/client";import"../node_modules/@auth0/auth0-react/dist/auth0-react.esm.js";import"../hooks/useAppStyles.js";import"../components/MessageInput.js";import"../components/UploadFile.js";import"../components/SnapFooter.js";import"../components/Profile.js";import"../components/MessageItem.js";import"../components/AiInput.js";import"../components/SearchBox.js";import"../components/DataMessagePicker.js";import"../components/HtmlView.js";import"../components/Footer.js";import"../components/QrCodeDialog.js";import"../components/QrScanner.js";import"../components/OfflineMessage.js";import"../components/LanguageSelector.js";import"../components/ListView.js";import"../components/RecordModal.js";import"../components/BulkUploadDialog.js";import"../components/CookieBanner.js";const s=t({iframe:{width:"100%",height:"100%",border:"none"},scrollable:{overflow:"auto"},nonScrollable:{overflow:"hidden"},fixFrameHeight:{height:"calc(100% - 5px)"}}),r=({src:t,showFooter:r,title:i})=>{const m=s();return r?o(e,{hideFooter:!r,hideHeader:!0,children:o("iframe",{title:i,src:t,className:`${m.iframe} ${r?m.fixFrameHeight:""}`})}):o("iframe",{title:i,src:t,className:m.iframe})};export{r as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useRef as t,useState as n,useEffect as r}from"react";import{makeStyles as s}from"@fluentui/react-components";import{useNavigate as i,useSearchParams as a}from"react-router-dom";import{CalendarWeekStart24Regular as m}from"@fluentui/react-icons";import"../components/Markdown.js";import"../components/Textarea.js";import"../components/Button.js";import"../components/CompoundButton.js";import"../components/Spinner.js";import c from"../components/TextHeader.js";import p from"../components/TypingIndicator.js";import l from"../components/Prompt.js";import d from"../components/ChatInput.js";import{CombinedPlaceholderDialog as g}from"../components/CombinedPlaceholderDialog.js";import h from"../components/ChatMessage.js";import"../components/Header.js";import u from"../hooks/useStateWithLocalStorage.js";import{CodicentService as j}from"../services/codicent.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import{getConfigValue as f}from"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"../node_modules/exceljs/excel.js";import"./AppFrame.js";import"./Canvas.js";import"./Compose.js";import"./Snap.js";import"./Search.js";import"./Menu.js";import"./Log.js";import"./Login.js";import"./Home.js";import"./ListPage.js";import"./CrmPage.js";import"./CrmPagePersistent.js";import"./ImageView.js";import"./FormInvite.js";import"./FormAccept.js";import"./Sales.js";import"./Purchase.js";import"../components/Content.js";import{Page as b}from"../components/Page.js";import"./QrScan.js";import C from"../hooks/useLocalization.js";import"../components/FileThumbnail.js";import"react-dom/client";import"../node_modules/@auth0/auth0-react/dist/auth0-react.esm.js";import{useChat as x}from"../hooks/useChat.js";import{useTemplateVariables as w}from"../hooks/useTemplateVariables.js";import"../hooks/useAppStyles.js";import"../components/MessageInput.js";import"../components/UploadFile.js";import"../components/SnapFooter.js";import"../components/Profile.js";import"../components/MessageItem.js";import"../components/AiInput.js";import"../components/SearchBox.js";import"../components/DataMessagePicker.js";import"../components/HtmlView.js";import"../components/Footer.js";import"../components/QrCodeDialog.js";import"../components/QrScanner.js";import"../components/OfflineMessage.js";import"../components/LanguageSelector.js";import"../components/ListView.js";import"../components/RecordModal.js";import"../components/BulkUploadDialog.js";import"../components/CookieBanner.js";const S=s({chatContainer:{width:"100%",flex:1,maxWidth:"1600px",height:"100%",display:"flex",flexDirection:"column",margin:"0 auto",overflow:"hidden","@media (max-width: 768px)":{maxWidth:"100%",borderRadius:"0"},"@media (max-width: 480px)":{},backgroundPosition:"calc(50%) center",backgroundRepeat:"no-repeat",backgroundSize:"contain",touchAction:"pan-y"},chatMessages:{display:"flex",flexDirection:"column",flex:1,padding:"16px",overflowY:"auto",touchAction:"pan-y"}}),v=({state:s,hideFooter:v,codicent:y,title:P,welcomeMessage:_})=>{const k=S(),{t:I,tAsync:F,getLanguageInfo:T}=C(),A=i(),M=t(null),[L,H]=a(),[V]=n((()=>{const e=L.get("codicent");return e?(sessionStorage.setItem("chat_codicent",e),e):y?(sessionStorage.removeItem("chat_codicent"),null):sessionStorage.getItem("chat_codicent")})),B=V||y,{messages:R,isBotTyping:N,handleSend:U,newChat:D,openChat:O}=x(s.stateMachine,B||void 0),[W,E]=n(null),[z,Q]=n(!1),[G,Y]=n(!1),{service:$,currentStateName:K}=s,[q,J]=n([]),[X,Z]=n([]),[ee,oe]=n(!1),[te,ne]=n(),[re,se]=u(s.context.selectedApp+"_prompts",[]),[ie,ae]=n(!1),{extractTemplateVariables:me,replaceTemplateVariables:ce,extractFilePlaceholders:pe,replaceFilePlaceholders:le,handleSelectFiles:de}=w($.uploadFile),ge=t(!1),he=t(null);r((()=>{const e=window.history.length>1,o=Boolean(document.referrer&&document.referrer!==window.location.href);Y(e||o)}),[]);r((()=>{f("SHOW_CHAT_PROMPTS")&&0===R.length&&s.service.getAppPrompts(B||void 0).then(se).catch((e=>{console.error("Failed to get prompts",e)}))}),[s.service,se,R.length,B]),r((()=>{setTimeout((()=>{M.current?.scrollIntoView({behavior:"smooth"})}),10)}),[R]),r((()=>{if(ge.current)return;ge.current=!0;const e=L.get("text"),o=L.get("id"),t=L.get("fid");if(V){console.log("Using temporary codicent from URL param:",V);const e=new URLSearchParams(L);e.delete("codicent"),H(e,{replace:!0})}if(e){(async()=>{const o=pe(e),t=me(e);D(),o.length>0||t.length>0?(Z(o),J(t),oe(!0),E(I(e))):E(I(e))})()}else o?O(o):t&&ne(t)}),[]),r((()=>{te&&"anonymous"===K&&he.current!==te&&(he.current=te,$.getFormById(te).then((async e=>{D();const o=T().language,t=e.prompt.replace("{{fid}}",te).replace("{{fname}}",e.name).replace("{{language}}",o);ae(!0);const n=await F(t);ae(!1),E(n),Y(!1)})))}),[te,D,$,E,K,F,T,ae]),r((()=>{if(W&&!ee){let e=W;X.length>0&&(e=le(e,X)),q.length>0&&(e=ce(e,q)),U(e),H({},{replace:!0}),E(null),J([]),Z([])}}),[W,ee,U,H,le,ce,X,q]);const ue=e=>{const o=L.get("append");o&&(e+="\n---\n"+o),U(e)};return e(b,{hideHeader:!0,hideFooter:!!te||v,children:[e("div",{id:"chat-container",className:k.chatContainer,style:{backgroundImage:`url(${f("CHAT_BACKGROUND_IMAGE_URL")})`},children:[G&&o("button",{onClick:()=>{G&&A(-1)},"aria-label":I("Tillbaka"),style:{position:"absolute",top:12,left:12,zIndex:100,background:"var(--colorNeutralBackground1)",border:"none",cursor:"pointer",padding:8,borderRadius:8,boxShadow:"0 2px 8px rgba(0,0,0,0.08)",display:"flex",alignItems:"center",justifyContent:"center"},children:o(m,{style:{transform:"rotate(180deg)"}})}),o("div",{style:{marginLeft:G?40:0},children:o(c,{title:P||I(f("APP_CHAT_TITLE")||"Chatt"),onNewChat:te?void 0:()=>Q(!0)})}),e("div",{className:k.chatMessages,children:[_&&o(h,{sender:"bot",content:_}),f("SHOW_CHAT_PROMPTS")&&re.length>0&&0===R.length&&o(h,{sender:"bot",content:I(f("CHAT_WELCOME")||I("Välkommen!")),children:re.map(((t,n)=>e("div",{children:["> ",o("a",{href:"./#/chat",onClick:()=>{ue(t.title+"\n---\n"+t.prompt)},children:I(t.title)}),o("br",{})]},`prompt-${n}`)))}),R.map(((t,n)=>e("div",{children:[(N&&n===R.length-1||!N&&n===R.length-2)&&o("div",{ref:M}),o(h,{sender:t.sender,content:t.content,isNew:t.isNew,showSuggestions:n===R.length-1,onSuggestionClicked:U},t.id)]},t.id))),ie&&o(h,{sender:"user",content:I("Översätter...")}),N&&o(p,{})]}),o(d,{codicent:B||s.context.selectedApp,disableSend:N,onSend:ue,onSelectFiles:de,getImageUrl:j.getImageUrl,getFileInfo:e=>$.getFileInfo(e)})]}),o(l,{open:z,title:I("Vill du rensa chatten?"),content:I("En ny startas, men chatten kommer först sparas."),onYes:()=>{Q(!1),D()},onNo:()=>Q(!1)}),o(g,{open:ee,templateVariables:q,filePlaceholders:X,onTemplateVariablesChange:J,onFilePlaceholdersChange:Z,onConfirm:()=>oe(!1),onCancel:()=>{oe(!1),E(null),J([]),Z([])},uploadFile:$.uploadFile})]})};export{v as default};
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useRef as t,useState as n,useEffect as r}from"react";import{makeStyles as s}from"@fluentui/react-components";import{useNavigate as i,useSearchParams as a}from"react-router-dom";import{CalendarWeekStart24Regular as m}from"@fluentui/react-icons";import"../components/Markdown.js";import"../components/Textarea.js";import"../components/Button.js";import"../components/CompoundButton.js";import"../components/Spinner.js";import c from"../components/TextHeader.js";import p from"../components/TypingIndicator.js";import l from"../components/Prompt.js";import d from"../components/ChatInput.js";import{CombinedPlaceholderDialog as g}from"../components/CombinedPlaceholderDialog.js";import h from"../components/ChatMessage.js";import"../components/Header.js";import u from"../hooks/useStateWithLocalStorage.js";import{CodicentService as j}from"../services/codicent.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import{getConfigValue as f}from"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"exceljs";import"./AppFrame.js";import"./Canvas.js";import"./Compose.js";import"./Snap.js";import"./Search.js";import"./Menu.js";import"./Log.js";import"./Login.js";import"./Home.js";import"./ListPage.js";import"./CrmPage.js";import"./CrmPagePersistent.js";import"./ImageView.js";import"./FormInvite.js";import"./FormAccept.js";import"./Sales.js";import"./Purchase.js";import"../components/Content.js";import{Page as b}from"../components/Page.js";import"./QrScan.js";import C from"../hooks/useLocalization.js";import"../components/FileThumbnail.js";import"react-dom/client";import"../node_modules/@auth0/auth0-react/dist/auth0-react.esm.js";import{useChat as x}from"../hooks/useChat.js";import{useTemplateVariables as w}from"../hooks/useTemplateVariables.js";import"../hooks/useAppStyles.js";import"../components/MessageInput.js";import"../components/UploadFile.js";import"../components/SnapFooter.js";import"../components/Profile.js";import"../components/MessageItem.js";import"../components/AiInput.js";import"../components/SearchBox.js";import"../components/DataMessagePicker.js";import"../components/HtmlView.js";import"../components/Footer.js";import"../components/QrCodeDialog.js";import"../components/QrScanner.js";import"../components/OfflineMessage.js";import"../components/LanguageSelector.js";import"../components/ListView.js";import"../components/RecordModal.js";import"../components/BulkUploadDialog.js";import"../components/CookieBanner.js";const S=s({chatContainer:{width:"100%",flex:1,maxWidth:"1600px",height:"100%",display:"flex",flexDirection:"column",margin:"0 auto",overflow:"hidden","@media (max-width: 768px)":{maxWidth:"100%",borderRadius:"0"},"@media (max-width: 480px)":{},backgroundPosition:"calc(50%) center",backgroundRepeat:"no-repeat",backgroundSize:"contain",touchAction:"pan-y"},chatMessages:{display:"flex",flexDirection:"column",flex:1,padding:"16px",overflowY:"auto",touchAction:"pan-y"}}),v=({state:s,hideFooter:v,codicent:y,title:P,welcomeMessage:k})=>{const I=S(),{t:_,tAsync:F,getLanguageInfo:T}=C(),A=i(),M=t(null),[L,H]=a(),[V]=n((()=>{const e=L.get("codicent");return e?(sessionStorage.setItem("chat_codicent",e),e):y?(sessionStorage.removeItem("chat_codicent"),null):sessionStorage.getItem("chat_codicent")})),B=V||y,{messages:R,isBotTyping:N,handleSend:U,newChat:D,openChat:O}=x(s.stateMachine,B||void 0),[W,E]=n(null),[z,Q]=n(!1),[G,Y]=n(!1),{service:$,currentStateName:K}=s,[q,J]=n([]),[X,Z]=n([]),[ee,oe]=n(!1),[te,ne]=n(),[re,se]=u(s.context.selectedApp+"_prompts",[]),[ie,ae]=n(!1),{extractTemplateVariables:me,replaceTemplateVariables:ce,extractFilePlaceholders:pe,replaceFilePlaceholders:le,handleSelectFiles:de}=w($.uploadFile),ge=t(!1),he=t(null);r((()=>{const e=window.history.length>1,o=Boolean(document.referrer&&document.referrer!==window.location.href);Y(e||o)}),[]);r((()=>{f("SHOW_CHAT_PROMPTS")&&0===R.length&&s.service.getAppPrompts(B||void 0).then(se).catch((e=>{console.error("Failed to get prompts",e)}))}),[s.service,se,R.length,B]),r((()=>{setTimeout((()=>{M.current?.scrollIntoView({behavior:"smooth"})}),10)}),[R]),r((()=>{if(ge.current)return;ge.current=!0;const e=L.get("text"),o=L.get("id"),t=L.get("fid");if(V){console.log("Using temporary codicent from URL param:",V);const e=new URLSearchParams(L);e.delete("codicent"),H(e,{replace:!0})}if(e){(async()=>{const o=pe(e),t=me(e);D(),o.length>0||t.length>0?(Z(o),J(t),oe(!0),E(_(e))):E(_(e))})()}else o?O(o):t&&ne(t)}),[]),r((()=>{te&&"anonymous"===K&&he.current!==te&&(he.current=te,$.getFormById(te).then((async e=>{D();const o=T().language,t=e.prompt.replace("{{fid}}",te).replace("{{fname}}",e.name).replace("{{language}}",o);ae(!0);const n=await F(t);ae(!1),E(n),Y(!1)})))}),[te,D,$,E,K,F,T,ae]),r((()=>{if(W&&!ee){let e=W;X.length>0&&(e=le(e,X)),q.length>0&&(e=ce(e,q)),U(e),H({},{replace:!0}),E(null),J([]),Z([])}}),[W,ee,U,H,le,ce,X,q]);const ue=e=>{const o=L.get("append");o&&(e+="\n---\n"+o),U(e)};return e(b,{hideHeader:!0,hideFooter:!!te||v,children:[e("div",{id:"chat-container",className:I.chatContainer,style:{backgroundImage:`url(${f("CHAT_BACKGROUND_IMAGE_URL")})`},children:[G&&o("button",{onClick:()=>{G&&A(-1)},"aria-label":_("Tillbaka"),style:{position:"absolute",top:12,left:12,zIndex:100,background:"var(--colorNeutralBackground1)",border:"none",cursor:"pointer",padding:8,borderRadius:8,boxShadow:"0 2px 8px rgba(0,0,0,0.08)",display:"flex",alignItems:"center",justifyContent:"center"},children:o(m,{style:{transform:"rotate(180deg)"}})}),o("div",{style:{marginLeft:G?40:0},children:o(c,{title:P||_(f("APP_CHAT_TITLE")||"Chatt"),onNewChat:te?void 0:()=>Q(!0)})}),e("div",{className:I.chatMessages,children:[k&&o(h,{sender:"bot",content:k}),f("SHOW_CHAT_PROMPTS")&&re.length>0&&0===R.length&&o(h,{sender:"bot",content:_(f("CHAT_WELCOME")||_("Välkommen!")),children:re.map(((t,n)=>e("div",{children:["> ",o("a",{href:"./#/chat",onClick:()=>{ue(t.title+"\n---\n"+t.prompt)},children:_(t.title)}),o("br",{})]},`prompt-${n}`)))}),R.map(((t,n)=>e("div",{children:[(N&&n===R.length-1||!N&&n===R.length-2)&&o("div",{ref:M}),o(h,{sender:t.sender,content:t.content,isNew:t.isNew,showSuggestions:n===R.length-1,onSuggestionClicked:U},t.id)]},t.id))),ie&&o(h,{sender:"user",content:_("Översätter...")}),N&&o(p,{})]}),o(d,{codicent:B||s.context.selectedApp,disableSend:N,onSend:ue,onSelectFiles:de,getImageUrl:j.getImageUrl,getFileInfo:e=>$.getFileInfo(e)})]}),o(l,{open:z,title:_("Vill du rensa chatten?"),content:_("En ny startas, men chatten kommer först sparas."),onYes:()=>{Q(!1),D()},onNo:()=>Q(!1)}),o(g,{open:ee,templateVariables:q,filePlaceholders:X,onTemplateVariablesChange:J,onFilePlaceholdersChange:Z,onConfirm:()=>oe(!1),onCancel:()=>{oe(!1),E(null),J([]),Z([])},uploadFile:$.uploadFile})]})};export{v as default};