@qilin-agent/experimental-inspector 0.0.0-stage → 3.1.3
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.
- package/README.i18n.yaml +49 -0
- package/README.md +179 -2
- package/README.zh.md +180 -0
- package/cordis.patch.yml +5 -0
- package/icon.svg +12 -0
- package/lib/client.js +3572 -0
- package/lib/client.page.js +314 -0
- package/lib/devtools/Images/3d-center.svg +3 -0
- package/lib/devtools/Images/3d-pan.svg +3 -0
- package/lib/devtools/Images/3d-rotate.svg +3 -0
- package/lib/devtools/Images/accelerometer-back.svg +69 -0
- package/lib/devtools/Images/accelerometer-bottom.png +0 -0
- package/lib/devtools/Images/accelerometer-front.svg +28 -0
- package/lib/devtools/Images/accelerometer-left.png +0 -0
- package/lib/devtools/Images/accelerometer-right.png +0 -0
- package/lib/devtools/Images/accelerometer-top.png +0 -0
- package/lib/devtools/Images/account-tree.svg +10 -0
- package/lib/devtools/Images/add-photo.svg +3 -0
- package/lib/devtools/Images/ai-explorer-badge.svg +114 -0
- package/lib/devtools/Images/align-content-center.svg +5 -0
- package/lib/devtools/Images/align-content-end.svg +5 -0
- package/lib/devtools/Images/align-content-space-around.svg +6 -0
- package/lib/devtools/Images/align-content-space-between.svg +4 -0
- package/lib/devtools/Images/align-content-space-evenly.svg +6 -0
- package/lib/devtools/Images/align-content-start.svg +5 -0
- package/lib/devtools/Images/align-content-stretch.svg +4 -0
- package/lib/devtools/Images/align-items-baseline.svg +4 -0
- package/lib/devtools/Images/align-items-center.svg +5 -0
- package/lib/devtools/Images/align-items-end.svg +5 -0
- package/lib/devtools/Images/align-items-start.svg +5 -0
- package/lib/devtools/Images/align-items-stretch.svg +6 -0
- package/lib/devtools/Images/align-self-center.svg +3 -0
- package/lib/devtools/Images/align-self-end.svg +4 -0
- package/lib/devtools/Images/align-self-start.svg +4 -0
- package/lib/devtools/Images/align-self-stretch.svg +5 -0
- package/lib/devtools/Images/animation.svg +3 -0
- package/lib/devtools/Images/arrow-back.svg +4 -0
- package/lib/devtools/Images/arrow-collapse.svg +3 -0
- package/lib/devtools/Images/arrow-down.svg +10 -0
- package/lib/devtools/Images/arrow-drop-down-dark.svg +3 -0
- package/lib/devtools/Images/arrow-drop-down-light.svg +3 -0
- package/lib/devtools/Images/arrow-drop-down.svg +3 -0
- package/lib/devtools/Images/arrow-forward.svg +4 -0
- package/lib/devtools/Images/arrow-right-circle.svg +3 -0
- package/lib/devtools/Images/arrow-up-down-circle.svg +3 -0
- package/lib/devtools/Images/arrow-up-down.svg +3 -0
- package/lib/devtools/Images/arrow-up.svg +10 -0
- package/lib/devtools/Images/attach-file.svg +3 -0
- package/lib/devtools/Images/baseline-high-availability.svg +17 -0
- package/lib/devtools/Images/baseline-limited-availability.svg +19 -0
- package/lib/devtools/Images/baseline-low-availability.svg +31 -0
- package/lib/devtools/Images/bell.svg +3 -0
- package/lib/devtools/Images/bezier-curve-filled.svg +3 -0
- package/lib/devtools/Images/bin.svg +1 -0
- package/lib/devtools/Images/bottom-panel-close.svg +1 -0
- package/lib/devtools/Images/bottom-panel-open.svg +1 -0
- package/lib/devtools/Images/brackets.svg +1 -0
- package/lib/devtools/Images/breakpoint-circle.svg +4 -0
- package/lib/devtools/Images/breakpoint-crossed-filled.svg +1 -0
- package/lib/devtools/Images/breakpoint-crossed.svg +1 -0
- package/lib/devtools/Images/brush-2.svg +3 -0
- package/lib/devtools/Images/brush-filled.svg +1 -0
- package/lib/devtools/Images/brush.svg +1 -0
- package/lib/devtools/Images/bucket.svg +4 -0
- package/lib/devtools/Images/bug.svg +3 -0
- package/lib/devtools/Images/button-magic.svg +3 -0
- package/lib/devtools/Images/calendar-today.svg +3 -0
- package/lib/devtools/Images/center-focus-weak.svg +3 -0
- package/lib/devtools/Images/check-circle.svg +3 -0
- package/lib/devtools/Images/check-double.svg +3 -0
- package/lib/devtools/Images/checker.svg +12 -0
- package/lib/devtools/Images/checkmark.svg +1 -0
- package/lib/devtools/Images/chevron-double-right.svg +3 -0
- package/lib/devtools/Images/chevron-down.svg +3 -0
- package/lib/devtools/Images/chevron-left-dot.svg +4 -0
- package/lib/devtools/Images/chevron-left.svg +3 -0
- package/lib/devtools/Images/chevron-right.svg +3 -0
- package/lib/devtools/Images/chevron-up.svg +3 -0
- package/lib/devtools/Images/chromeLeft.avif +0 -0
- package/lib/devtools/Images/chromeMiddle.avif +0 -0
- package/lib/devtools/Images/chromeRight.avif +0 -0
- package/lib/devtools/Images/class.svg +6 -0
- package/lib/devtools/Images/clear-list.svg +3 -0
- package/lib/devtools/Images/clear.svg +3 -0
- package/lib/devtools/Images/cloud.svg +3 -0
- package/lib/devtools/Images/code-circle.svg +5 -0
- package/lib/devtools/Images/code-whisperer-badge.svg +166 -0
- package/lib/devtools/Images/code.svg +3 -0
- package/lib/devtools/Images/colon.svg +4 -0
- package/lib/devtools/Images/color-picker-filled.svg +3 -0
- package/lib/devtools/Images/color-picker.svg +3 -0
- package/lib/devtools/Images/compress.svg +8 -0
- package/lib/devtools/Images/console-conditional-breakpoint.svg +1 -0
- package/lib/devtools/Images/console-logpoint.svg +1 -0
- package/lib/devtools/Images/container.svg +4 -0
- package/lib/devtools/Images/cookie.svg +3 -0
- package/lib/devtools/Images/cookie_off.svg +3 -0
- package/lib/devtools/Images/copy.svg +3 -0
- package/lib/devtools/Images/corporate-fare.svg +3 -0
- package/lib/devtools/Images/credit-card.svg +3 -0
- package/lib/devtools/Images/cross-circle-filled.svg +3 -0
- package/lib/devtools/Images/cross-circle.svg +3 -0
- package/lib/devtools/Images/cross.svg +3 -0
- package/lib/devtools/Images/cssoverview_icons_2x.avif +0 -0
- package/lib/devtools/Images/database-off.svg +1 -0
- package/lib/devtools/Images/database.svg +3 -0
- package/lib/devtools/Images/deployed.svg +3 -0
- package/lib/devtools/Images/device-fold.svg +1 -0
- package/lib/devtools/Images/devices.svg +3 -0
- package/lib/devtools/Images/devtools-thumbnail.svg +57 -0
- package/lib/devtools/Images/devtools-tips.svg +61 -0
- package/lib/devtools/Images/devtools-user-badge.svg +129 -0
- package/lib/devtools/Images/devtools.svg +13 -0
- package/lib/devtools/Images/difference.svg +3 -0
- package/lib/devtools/Images/dock-bottom.svg +3 -0
- package/lib/devtools/Images/dock-left.svg +3 -0
- package/lib/devtools/Images/dock-right.svg +3 -0
- package/lib/devtools/Images/dock-window.svg +3 -0
- package/lib/devtools/Images/document.svg +3 -0
- package/lib/devtools/Images/dog-paw.svg +10 -0
- package/lib/devtools/Images/dom-detective-badge.svg +136 -0
- package/lib/devtools/Images/domain.svg +3 -0
- package/lib/devtools/Images/dots-horizontal.svg +1 -0
- package/lib/devtools/Images/dots-vertical.svg +3 -0
- package/lib/devtools/Images/download.svg +3 -0
- package/lib/devtools/Images/edit.svg +1 -0
- package/lib/devtools/Images/empty.svg +2 -0
- package/lib/devtools/Images/errorWave.svg +74 -0
- package/lib/devtools/Images/exclamation.svg +3 -0
- package/lib/devtools/Images/expand.svg +1 -0
- package/lib/devtools/Images/experiment-check.svg +1 -0
- package/lib/devtools/Images/experiment.svg +3 -0
- package/lib/devtools/Images/extension.svg +1 -0
- package/lib/devtools/Images/eye-crossed.svg +3 -0
- package/lib/devtools/Images/eye.svg +3 -0
- package/lib/devtools/Images/file-document.svg +3 -0
- package/lib/devtools/Images/file-fetch-xhr.svg +3 -0
- package/lib/devtools/Images/file-font.svg +4 -0
- package/lib/devtools/Images/file-generic.svg +3 -0
- package/lib/devtools/Images/file-image.svg +3 -0
- package/lib/devtools/Images/file-json.svg +4 -0
- package/lib/devtools/Images/file-manifest.svg +3 -0
- package/lib/devtools/Images/file-media.svg +3 -0
- package/lib/devtools/Images/file-script.svg +3 -0
- package/lib/devtools/Images/file-snippet.svg +4 -0
- package/lib/devtools/Images/file-stylesheet.svg +4 -0
- package/lib/devtools/Images/file-wasm.svg +5 -0
- package/lib/devtools/Images/file-websocket.svg +3 -0
- package/lib/devtools/Images/filter-clear.svg +3 -0
- package/lib/devtools/Images/filter-filled.svg +3 -0
- package/lib/devtools/Images/filter.svg +3 -0
- package/lib/devtools/Images/flex-direction.svg +5 -0
- package/lib/devtools/Images/flex-no-wrap.svg +5 -0
- package/lib/devtools/Images/flex-wrap.svg +8 -0
- package/lib/devtools/Images/flow.svg +3 -0
- package/lib/devtools/Images/flowsheet.svg +1 -0
- package/lib/devtools/Images/fold-more.svg +3 -0
- package/lib/devtools/Images/folder-asterisk.svg +10 -0
- package/lib/devtools/Images/folder-off.svg +3 -0
- package/lib/devtools/Images/folder.svg +3 -0
- package/lib/devtools/Images/frame-crossed.svg +3 -0
- package/lib/devtools/Images/frame-icon.svg +54 -0
- package/lib/devtools/Images/frame.svg +3 -0
- package/lib/devtools/Images/gdp-logo-dark.png +0 -0
- package/lib/devtools/Images/gdp-logo-light.png +0 -0
- package/lib/devtools/Images/gear-filled.svg +3 -0
- package/lib/devtools/Images/gear.svg +4 -0
- package/lib/devtools/Images/gears.svg +3 -0
- package/lib/devtools/Images/geminiInDevTools.png +0 -0
- package/lib/devtools/Images/geminiInDevTools_2x.png +0 -0
- package/lib/devtools/Images/global.svg +5 -0
- package/lib/devtools/Images/google.svg +3 -0
- package/lib/devtools/Images/goto-filled.svg +1 -0
- package/lib/devtools/Images/grid-direction.svg +6 -0
- package/lib/devtools/Images/grid-on.svg +10 -0
- package/lib/devtools/Images/group.svg +3 -0
- package/lib/devtools/Images/heap-snapshot.svg +6 -0
- package/lib/devtools/Images/heap-snapshots.svg +7 -0
- package/lib/devtools/Images/help.svg +3 -0
- package/lib/devtools/Images/history.svg +3 -0
- package/lib/devtools/Images/home.svg +3 -0
- package/lib/devtools/Images/hover.svg +6 -0
- package/lib/devtools/Images/iframe-crossed.svg +3 -0
- package/lib/devtools/Images/iframe.svg +3 -0
- package/lib/devtools/Images/import.svg +3 -0
- package/lib/devtools/Images/indeterminate-question-box.svg +3 -0
- package/lib/devtools/Images/info-filled.svg +3 -0
- package/lib/devtools/Images/info.svg +3 -0
- package/lib/devtools/Images/issue-cross-filled.svg +3 -0
- package/lib/devtools/Images/issue-exclamation-filled.svg +3 -0
- package/lib/devtools/Images/issue-questionmark-filled.svg +3 -0
- package/lib/devtools/Images/issue-text-filled.svg +3 -0
- package/lib/devtools/Images/justify-content-center.svg +5 -0
- package/lib/devtools/Images/justify-content-end.svg +5 -0
- package/lib/devtools/Images/justify-content-space-around.svg +6 -0
- package/lib/devtools/Images/justify-content-space-between.svg +4 -0
- package/lib/devtools/Images/justify-content-space-evenly.svg +6 -0
- package/lib/devtools/Images/justify-content-start.svg +5 -0
- package/lib/devtools/Images/justify-content-stretch.svg +4 -0
- package/lib/devtools/Images/justify-items-center.svg +4 -0
- package/lib/devtools/Images/justify-items-end.svg +4 -0
- package/lib/devtools/Images/justify-items-start.svg +4 -0
- package/lib/devtools/Images/justify-items-stretch.svg +4 -0
- package/lib/devtools/Images/keyboard-arrow-right.svg +1 -0
- package/lib/devtools/Images/keyboard-full.svg +10 -0
- package/lib/devtools/Images/keyboard-pen.svg +1 -0
- package/lib/devtools/Images/keyboard.svg +3 -0
- package/lib/devtools/Images/label-auto.svg +3 -0
- package/lib/devtools/Images/label.svg +10 -0
- package/lib/devtools/Images/large-arrow-right-filled.svg +1 -0
- package/lib/devtools/Images/layers-filled.svg +1 -0
- package/lib/devtools/Images/layers.svg +1 -0
- package/lib/devtools/Images/left-panel-close.svg +1 -0
- package/lib/devtools/Images/left-panel-open.svg +1 -0
- package/lib/devtools/Images/lightbulb-spark.svg +13 -0
- package/lib/devtools/Images/lightbulb.svg +3 -0
- package/lib/devtools/Images/lighthouse_logo.svg +158 -0
- package/lib/devtools/Images/list.svg +3 -0
- package/lib/devtools/Images/location-on.svg +3 -0
- package/lib/devtools/Images/lock-person.svg +1 -0
- package/lib/devtools/Images/lock.svg +3 -0
- package/lib/devtools/Images/mark-email-unread.svg +3 -0
- package/lib/devtools/Images/match-case.svg +3 -0
- package/lib/devtools/Images/match-whole-word.svg +1 -0
- package/lib/devtools/Images/memory.svg +6 -0
- package/lib/devtools/Images/minus.svg +3 -0
- package/lib/devtools/Images/mop.svg +1 -0
- package/lib/devtools/Images/mouse.svg +4 -0
- package/lib/devtools/Images/navigationControls.png +0 -0
- package/lib/devtools/Images/navigationControls_2x.png +0 -0
- package/lib/devtools/Images/network-settings.svg +3 -0
- package/lib/devtools/Images/node-stack-icon.svg +1 -0
- package/lib/devtools/Images/nodeIcon.avif +0 -0
- package/lib/devtools/Images/open-externally.svg +3 -0
- package/lib/devtools/Images/override.svg +11 -0
- package/lib/devtools/Images/palette.svg +10 -0
- package/lib/devtools/Images/pause-circle.svg +1 -0
- package/lib/devtools/Images/pause.svg +1 -0
- package/lib/devtools/Images/pen-spark.svg +3 -0
- package/lib/devtools/Images/performance-panel-delete-annotation.svg +32 -0
- package/lib/devtools/Images/performance-panel-diagram.svg +34 -0
- package/lib/devtools/Images/performance-panel-entry-label.svg +75 -0
- package/lib/devtools/Images/performance-panel-time-range.svg +15 -0
- package/lib/devtools/Images/performance.svg +3 -0
- package/lib/devtools/Images/person.svg +3 -0
- package/lib/devtools/Images/photo-camera.svg +10 -0
- package/lib/devtools/Images/play.svg +3 -0
- package/lib/devtools/Images/plus.svg +3 -0
- package/lib/devtools/Images/policy.svg +3 -0
- package/lib/devtools/Images/popoverArrows.png +0 -0
- package/lib/devtools/Images/popup.svg +3 -0
- package/lib/devtools/Images/preview_feature_video_thumbnail.svg +92 -0
- package/lib/devtools/Images/profile.svg +3 -0
- package/lib/devtools/Images/psychiatry.svg +3 -0
- package/lib/devtools/Images/puzzle.svg +3 -0
- package/lib/devtools/Images/record-start.svg +4 -0
- package/lib/devtools/Images/record-stop.svg +4 -0
- package/lib/devtools/Images/redo.svg +3 -0
- package/lib/devtools/Images/refresh.svg +10 -0
- package/lib/devtools/Images/regular-expression.svg +3 -0
- package/lib/devtools/Images/replace.svg +1 -0
- package/lib/devtools/Images/replay.svg +3 -0
- package/lib/devtools/Images/report.svg +1 -0
- package/lib/devtools/Images/resizeDiagonal.svg +1 -0
- package/lib/devtools/Images/resizeHorizontal.svg +1 -0
- package/lib/devtools/Images/resizeVertical.svg +1 -0
- package/lib/devtools/Images/resume.svg +1 -0
- package/lib/devtools/Images/revert.svg +3 -0
- package/lib/devtools/Images/review.svg +5 -0
- package/lib/devtools/Images/right-panel-close.svg +1 -0
- package/lib/devtools/Images/right-panel-open.svg +1 -0
- package/lib/devtools/Images/scissors.svg +3 -0
- package/lib/devtools/Images/screen-rotation.svg +1 -0
- package/lib/devtools/Images/search.svg +3 -0
- package/lib/devtools/Images/select-element.svg +3 -0
- package/lib/devtools/Images/send.svg +3 -0
- package/lib/devtools/Images/shadow.svg +3 -0
- package/lib/devtools/Images/shield.svg +3 -0
- package/lib/devtools/Images/small-status-dot.svg +3 -0
- package/lib/devtools/Images/smart-assistant.svg +3 -0
- package/lib/devtools/Images/snippet.svg +4 -0
- package/lib/devtools/Images/spark-info.svg +3 -0
- package/lib/devtools/Images/spark.svg +3 -0
- package/lib/devtools/Images/speculative-loads.svg +1 -0
- package/lib/devtools/Images/speedster-badge.svg +166 -0
- package/lib/devtools/Images/star.svg +3 -0
- package/lib/devtools/Images/step-into.svg +1 -0
- package/lib/devtools/Images/step-out.svg +1 -0
- package/lib/devtools/Images/step-over.svg +1 -0
- package/lib/devtools/Images/step.svg +1 -0
- package/lib/devtools/Images/stop.svg +3 -0
- package/lib/devtools/Images/symbol.svg +3 -0
- package/lib/devtools/Images/sync.svg +3 -0
- package/lib/devtools/Images/tab-move.svg +1 -0
- package/lib/devtools/Images/table.svg +3 -0
- package/lib/devtools/Images/terminal.svg +10 -0
- package/lib/devtools/Images/text-analysis.svg +3 -0
- package/lib/devtools/Images/thumb-down-filled.svg +3 -0
- package/lib/devtools/Images/thumb-down.svg +3 -0
- package/lib/devtools/Images/thumb-up-filled.svg +3 -0
- package/lib/devtools/Images/thumb-up.svg +3 -0
- package/lib/devtools/Images/tonality.svg +10 -0
- package/lib/devtools/Images/toolbarResizerVertical.png +0 -0
- package/lib/devtools/Images/top-panel-close.svg +1 -0
- package/lib/devtools/Images/top-panel-open.svg +1 -0
- package/lib/devtools/Images/touch-app.svg +4 -0
- package/lib/devtools/Images/touchCursor.png +0 -0
- package/lib/devtools/Images/touchCursor_2x.png +0 -0
- package/lib/devtools/Images/triangle-bottom-right.svg +3 -0
- package/lib/devtools/Images/triangle-down.svg +1 -0
- package/lib/devtools/Images/triangle-left.svg +1 -0
- package/lib/devtools/Images/triangle-right.svg +1 -0
- package/lib/devtools/Images/triangle-up.svg +3 -0
- package/lib/devtools/Images/trophy.svg +3 -0
- package/lib/devtools/Images/tune.svg +3 -0
- package/lib/devtools/Images/undo.svg +1 -0
- package/lib/devtools/Images/warning-filled.svg +3 -0
- package/lib/devtools/Images/warning.svg +3 -0
- package/lib/devtools/Images/watch.svg +3 -0
- package/lib/devtools/Images/whatsnew.svg +61 -0
- package/lib/devtools/Images/width.svg +3 -0
- package/lib/devtools/Images/zoom-in.svg +3 -0
- package/lib/devtools/LICENSE +27 -0
- package/lib/devtools/application_tokens.css +413 -0
- package/lib/devtools/chunks/FormatterActions-FcPgI0uV.js +19 -0
- package/lib/devtools/chunks/UIFilter-CIzBruM3.js +18 -0
- package/lib/devtools/chunks/UIRequestLocation-CtGcVN3I.js +48 -0
- package/lib/devtools/chunks/_qilin-devtools_empty-BvRk9kiK.js +0 -0
- package/lib/devtools/chunks/accessibility-CwvHp3sj.js +2718 -0
- package/lib/devtools/chunks/acorn-_jSanihy.js +3232 -0
- package/lib/devtools/chunks/adorners-D4aU6nuY.js +45 -0
- package/lib/devtools/chunks/ai_assistance-BU6E0Wio.js +4255 -0
- package/lib/devtools/chunks/angular-Dutmu-L9.js +117 -0
- package/lib/devtools/chunks/animation-TEwO5UI_.js +922 -0
- package/lib/devtools/chunks/application-SCf6MiCN.js +12740 -0
- package/lib/devtools/chunks/autofill-Dp3nMnuK.js +198 -0
- package/lib/devtools/chunks/autofill_manager-BXntqfdp.js +58 -0
- package/lib/devtools/chunks/bindings-DgoVEdsr.js +4105 -0
- package/lib/devtools/chunks/browser-DL1S1Kiu.js +62 -0
- package/lib/devtools/chunks/browser_debugger-p7Rr4IBR.js +629 -0
- package/lib/devtools/chunks/changes-DeW5MC9u.js +2 -0
- package/lib/devtools/chunks/changes-k42bihtm.js +393 -0
- package/lib/devtools/chunks/checkbox.css-CZJJ6atQ.js +4 -0
- package/lib/devtools/chunks/chunk-DF993M8W.js +11 -0
- package/lib/devtools/chunks/code_highlighter-BnTPt9_G.js +210 -0
- package/lib/devtools/chunks/codemirror-CBR9VJma.js +15842 -0
- package/lib/devtools/chunks/color_picker-Cuh_X19Y.js +1566 -0
- package/lib/devtools/chunks/common-DjRFwulW.js +15145 -0
- package/lib/devtools/chunks/common-Uu9A2glf.js +2 -0
- package/lib/devtools/chunks/common-qd_KLeYO.js +6639 -0
- package/lib/devtools/chunks/components-CnPGgDUW.js +704 -0
- package/lib/devtools/chunks/components-Cw5tHQqN.js +1338 -0
- package/lib/devtools/chunks/components-EJwviLtZ.js +1090 -0
- package/lib/devtools/chunks/console-D1WlMaFQ.js +3855 -0
- package/lib/devtools/chunks/console-yMm3XVTY.js +2 -0
- package/lib/devtools/chunks/console_counters-9SfIdrUo.js +103 -0
- package/lib/devtools/chunks/coverage-BbFH390Q.js +1176 -0
- package/lib/devtools/chunks/coverage-CLBpovLw.js +2 -0
- package/lib/devtools/chunks/cpp-CdElSCaB.js +435 -0
- package/lib/devtools/chunks/css_overview-cITV9auE.js +1288 -0
- package/lib/devtools/chunks/data_grid-pC5qqfsJ.js +1671 -0
- package/lib/devtools/chunks/developer_resources-4DqQIvy6.js +240 -0
- package/lib/devtools/chunks/diff-qn55JSCS.js +444 -0
- package/lib/devtools/chunks/dom_extension-BfrKZ4JG.js +172 -0
- package/lib/devtools/chunks/elements-CgEYz3mX.js +2 -0
- package/lib/devtools/chunks/elements-Dbx4q9-v.js +11407 -0
- package/lib/devtools/chunks/emulation-C6XKPPGu.js +1306 -0
- package/lib/devtools/chunks/emulation-D8xbdsAj.js +2 -0
- package/lib/devtools/chunks/emulation-EtJlEukP.js +2732 -0
- package/lib/devtools/chunks/emulation-cjFPXHT9.js +157 -0
- package/lib/devtools/chunks/event_listeners-BeTH3gi2.js +414 -0
- package/lib/devtools/chunks/explain-P_aDGFSD.js +747 -0
- package/lib/devtools/chunks/greendev-BU0QcVPX.js +152 -0
- package/lib/devtools/chunks/heap_snapshot-CZt2KUPL.js +427 -0
- package/lib/devtools/chunks/helper-CI72KvIC.js +33 -0
- package/lib/devtools/chunks/helpers--xrfGSwQ.js +29 -0
- package/lib/devtools/chunks/i18n-DvFMqQdJ.js +17 -0
- package/lib/devtools/chunks/icon_button-BebVdJD8.js +83 -0
- package/lib/devtools/chunks/inline_editor-D54X5UUr.js +1309 -0
- package/lib/devtools/chunks/inspector_main-DRbdXLmF.js +279 -0
- package/lib/devtools/chunks/issue_counter-CeOjTNGW.js +193 -0
- package/lib/devtools/chunks/issues-CegBKEda.js +1649 -0
- package/lib/devtools/chunks/issues_manager-D7nfNPN1.js +3009 -0
- package/lib/devtools/chunks/java-7g_qfFa2.js +263 -0
- package/lib/devtools/chunks/layer_viewer-CaFC5oyv.js +1423 -0
- package/lib/devtools/chunks/layers-CXqlD9zH.js +370 -0
- package/lib/devtools/chunks/legacy-Bqn4Q0Tf.js +41804 -0
- package/lib/devtools/chunks/legacy-DOCLCisy.js +1434 -0
- package/lib/devtools/chunks/less-DXiRNbd4.js +195 -0
- package/lib/devtools/chunks/lighthouse-DtpzvfT6.js +3920 -0
- package/lib/devtools/chunks/lighthouse-T9ZpmENr.js +2 -0
- package/lib/devtools/chunks/linear_memory_inspector-C50PtM45.js +305 -0
- package/lib/devtools/chunks/live-metrics-Bs7wxibB.js +284 -0
- package/lib/devtools/chunks/main-C5y6NscM.js +2 -0
- package/lib/devtools/chunks/main-DcgYyEI0.js +755 -0
- package/lib/devtools/chunks/markdown-tZoR6Bsu.js +1512 -0
- package/lib/devtools/chunks/markdown_view-C67b2DdG.js +461 -0
- package/lib/devtools/chunks/marked-zGgfoDxO.js +1362 -0
- package/lib/devtools/chunks/media-BhuqASbO.js +1337 -0
- package/lib/devtools/chunks/media-Wfo1AbXC.js +2 -0
- package/lib/devtools/chunks/menus-BAUukA5-.js +969 -0
- package/lib/devtools/chunks/mobile_throttling-C26zde8o.js +2 -0
- package/lib/devtools/chunks/mobile_throttling-Cw4AkJH4.js +1052 -0
- package/lib/devtools/chunks/network-C3gIloDN.js +2 -0
- package/lib/devtools/chunks/network-CaxdpGU2.js +9181 -0
- package/lib/devtools/chunks/objectValue.css-C9o9fdM2.js +4 -0
- package/lib/devtools/chunks/object_ui-BYgPTK_b.js +1461 -0
- package/lib/devtools/chunks/object_ui-E7eR7aD-.js +2 -0
- package/lib/devtools/chunks/perf_ui-BqzJrt4p.js +2 -0
- package/lib/devtools/chunks/perf_ui-CQMkYfn3.js +3143 -0
- package/lib/devtools/chunks/performance_monitor-B2kUoCv0.js +385 -0
- package/lib/devtools/chunks/php-tl5gKrxu.js +423 -0
- package/lib/devtools/chunks/platform-BzB373NB.js +600 -0
- package/lib/devtools/chunks/profiler-BGu3akEf.js +4608 -0
- package/lib/devtools/chunks/protocol_client-Cwf_jb8R.js +24329 -0
- package/lib/devtools/chunks/protocol_monitor-B9nMqAAE.js +2 -0
- package/lib/devtools/chunks/protocol_monitor-CvLQ8ms1.js +1224 -0
- package/lib/devtools/chunks/puppeteer-CaOjgj3v.js +13299 -0
- package/lib/devtools/chunks/python-D9AdRkMm.js +580 -0
- package/lib/devtools/chunks/quick_open-C3IZ69m9.js +2 -0
- package/lib/devtools/chunks/quick_open-DRITaPnZ.js +722 -0
- package/lib/devtools/chunks/recorder-C0f1n95b.js +5465 -0
- package/lib/devtools/chunks/recorder-actions-S2RfLX4H.js +6 -0
- package/lib/devtools/chunks/request_link_icon-fGy57GcW.js +87 -0
- package/lib/devtools/chunks/root-DbVQo07X.js +255 -0
- package/lib/devtools/chunks/sass-BPQlMmw2.js +370 -0
- package/lib/devtools/chunks/security-NbgKa3ux.js +898 -0
- package/lib/devtools/chunks/sensors-nM7qcBE4.js +752 -0
- package/lib/devtools/chunks/settings-aKtQC12v.js +1433 -0
- package/lib/devtools/chunks/settings_ui-CzxAFzIb.js +175 -0
- package/lib/devtools/chunks/snackbars-lPThuWYs.js +12010 -0
- package/lib/devtools/chunks/snippets-dIuBmVBv.js +173 -0
- package/lib/devtools/chunks/source_frame-CSjno3kf.js +1352 -0
- package/lib/devtools/chunks/sources-BIZssBei.js +8216 -0
- package/lib/devtools/chunks/sources-Bf8QJxju.js +2 -0
- package/lib/devtools/chunks/suggestion_input-Duuu5pyd.js +196 -0
- package/lib/devtools/chunks/svelte-DJS1itbE.js +744 -0
- package/lib/devtools/chunks/textInput.css-DPvwvIic.js +4 -0
- package/lib/devtools/chunks/text_editor-Dq1P6D2J.js +15706 -0
- package/lib/devtools/chunks/text_utils-ohNt_gua.js +608 -0
- package/lib/devtools/chunks/theme_support-CbSSLkbO.js +92 -0
- package/lib/devtools/chunks/third-party-web-DGiPoc0U.js +12626 -0
- package/lib/devtools/chunks/timeline-BE_ysZxO.js +2 -0
- package/lib/devtools/chunks/timeline-C4vCX79k.js +16347 -0
- package/lib/devtools/chunks/utils-CELci976.js +298 -0
- package/lib/devtools/chunks/vue-CjH9yovn.js +73 -0
- package/lib/devtools/chunks/wast-CbGHiqaW.js +109 -0
- package/lib/devtools/chunks/web_audio-IdfBLjwV.js +277 -0
- package/lib/devtools/chunks/webauthn-iRZlbjGV.js +522 -0
- package/lib/devtools/chunks/whats_new-DOTPf2xJ.js +177 -0
- package/lib/devtools/chunks/xml-DI9dcP5w.js +327 -0
- package/lib/devtools/connect.js +9 -0
- package/lib/devtools/design_system_tokens.css +1061 -0
- package/lib/devtools/device_mode_emulation_frame.html +25 -0
- package/lib/devtools/devtools_app.html +25 -0
- package/lib/devtools/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nest-hub-horizontal.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nest-hub-max-horizontal.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/lib/devtools/emulated_devices/optimized/optimized_images.gni +53 -0
- package/lib/devtools/entrypoints/device_mode_emulation_frame/device_mode_emulation_frame.js +4 -0
- package/lib/devtools/entrypoints/devtools_app/devtools_app.js +6240 -0
- package/lib/devtools/entrypoints/formatter_worker/formatter_worker-entrypoint.js +2810 -0
- package/lib/devtools/entrypoints/heap_snapshot_worker/heap_snapshot_worker-entrypoint.js +2142 -0
- package/lib/devtools/entrypoints/lighthouse_worker/lighthouse_worker.js +290095 -0
- package/lib/devtools/entrypoints/wasmparser_worker/wasmparser_worker-entrypoint.js +3403 -0
- package/lib/devtools/models/issues_manager/descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/CoepCorpNotSameOrigin.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
- package/lib/devtools/models/issues_manager/descriptions/CoepCorpNotSameSite.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
- package/lib/devtools/models/issues_manager/descriptions/CompatibilityModeQuirks.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/LowTextContrast.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteExcludeContextDowngradeRead.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteExcludeContextDowngradeSet.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteExcludeNavigationContextDowngrade.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteWarnCrossDowngradeRead.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteWarnCrossDowngradeSet.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/SameSiteWarnStrictLaxDowngradeStrict.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/arInsecureContext.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/arInvalidInfoHeader.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/arNoWebOrOsSupport.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/arOsSourceIgnored.md +18 -0
- package/lib/devtools/models/issues_manager/descriptions/arOsTriggerIgnored.md +19 -0
- package/lib/devtools/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +9 -0
- package/lib/devtools/models/issues_manager/descriptions/arSourceIgnored.md +13 -0
- package/lib/devtools/models/issues_manager/descriptions/arTriggerIgnored.md +12 -0
- package/lib/devtools/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +10 -0
- package/lib/devtools/models/issues_manager/descriptions/arWebAndOsHeaders.md +11 -0
- package/lib/devtools/models/issues_manager/descriptions/bounceTrackingMitigations.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
- package/lib/devtools/models/issues_manager/descriptions/connectionAllowlistInvalidHeader.md +12 -0
- package/lib/devtools/models/issues_manager/descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/connectionAllowlistItemNotInnerList.md +12 -0
- package/lib/devtools/models/issues_manager/descriptions/connectionAllowlistMoreThanOneList.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieCrossSiteRedirectDowngrade.md +12 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieExcludeBlockedWithinRelatedWebsiteSet.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieExcludeDomainNonAscii.md +11 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieExcludePortMismatch.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieExcludeSchemeMismatch.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieExcludeThirdPartyPhaseoutRead.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieExcludeThirdPartyPhaseoutSet.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieWarnDomainNonAscii.md +11 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieWarnMetadataGrantRead.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieWarnMetadataGrantSet.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieWarnThirdPartyPhaseoutRead.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/cookieWarnThirdPartyPhaseoutSet.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/corsAllowCredentialsRequired.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/corsDisabledScheme.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/corsDisallowedByMode.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/corsInvalidHeaderValues.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/corsLocalNetworkAccessPermissionDenied.md +19 -0
- package/lib/devtools/models/issues_manager/descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/corsOriginMismatch.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/corsPreflightResponseInvalid.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/corsRedirectContainsCredentials.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/corsWildcardOriginNotAllowed.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/cspEvalViolation.md +9 -0
- package/lib/devtools/models/issues_manager/descriptions/cspInlineViolation.md +10 -0
- package/lib/devtools/models/issues_manager/descriptions/cspTrustedTypesPolicyViolation.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/cspTrustedTypesSinkViolation.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/cspURLViolation.md +10 -0
- package/lib/devtools/models/issues_manager/descriptions/deprecation.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestCanceled.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestErrorIdToken.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthRequestTooManyRequests.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/fetchingPartitionedBlobURL.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormAriaLabelledByToNonExistingIdError.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormDuplicateIdForInputError.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormInputWithNoLabelError.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormLabelForNameError.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormModelContextMissingToolDescription.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormModelContextMissingToolName.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormModelContextParameterMissingName.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/genericResponseWasBlockedByORB.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/heavyAd.md +10 -0
- package/lib/devtools/models/issues_manager/descriptions/mixedContent.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/navigatingPartitionedBlobURL.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementActivationDisabled.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementInvalidType.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementLowContrast.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementRegistrationFailed.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementRequestInProgress.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementTypeNotSupported.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/permissionElementUntrustedEvent.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/placeholderDescriptionForInvisibleIssues.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/propertyRuleInvalidNameIssue.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/propertyRuleIssue.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/selectElementAccessibilityDisallowedSelectChild.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/selectivePermissionsIntervention.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedArrayBuffer.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorExpiredResponse.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorInsufficientResources.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorNavigationRequest.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorNoMatchField.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonSecureContext.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonStringIdField.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorRequestAborted.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorShuttingDown.md +1 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorTooLongIdField.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/sharedDictionaryWriteErrorUnsupportedType.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/sriInvalidSignatureHeader.md +14 -0
- package/lib/devtools/models/issues_manager/descriptions/sriInvalidSignatureInputHeader.md +15 -0
- package/lib/devtools/models/issues_manager/descriptions/sriMissingSignatureHeader.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/sriMissingSignatureInputHeader.md +7 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureHeaderValueIsIncorrectLength.md +11 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureHeaderValueIsNotByteSequence.md +14 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureHeaderValueIsParameterized.md +15 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureInputHeaderInvalidComponentName.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureInputHeaderInvalidComponentType.md +13 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureInputHeaderInvalidParameter.md +11 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureInputHeaderKeyIdLength.md +12 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureInputHeaderMissingLabel.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +8 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureInputHeaderValueMissingComponents.md +11 -0
- package/lib/devtools/models/issues_manager/descriptions/sriSignatureInputHeaderValueNotInnerList.md +11 -0
- package/lib/devtools/models/issues_manager/descriptions/sriValidationFailedIntegrityMismatch.md +10 -0
- package/lib/devtools/models/issues_manager/descriptions/sriValidationFailedInvalidLength.md +5 -0
- package/lib/devtools/models/issues_manager/descriptions/sriValidationFailedSignatureExpired.md +6 -0
- package/lib/devtools/models/issues_manager/descriptions/sriValidationFailedSignatureMismatch.md +11 -0
- package/lib/devtools/models/issues_manager/descriptions/stylesheetLateImport.md +4 -0
- package/lib/devtools/models/issues_manager/descriptions/stylesheetRequestFailed.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +3 -0
- package/lib/devtools/models/issues_manager/descriptions/unencodedDigestIncorrectDigestLength.md +12 -0
- package/lib/devtools/models/issues_manager/descriptions/unencodedDigestIncorrectDigestType.md +17 -0
- package/lib/devtools/models/issues_manager/descriptions/unencodedDigestMalformedDictionary.md +14 -0
- package/lib/devtools/models/issues_manager/descriptions/unencodedDigestUnknownAlgorithm.md +15 -0
- package/lib/devtools/models/live-metrics/web-vitals-injected/web-vitals-injected.generated.js +1 -0
- package/lib/devtools/panels/recorder/injected/injected.generated.js +1 -0
- package/lib/devtools/panels/whats_new/resources/WNDT.md +14 -0
- package/lib/devtools/resource-manifest.json +3818 -0
- package/lib/devtools/third_party/acorn/package/LICENSE +21 -0
- package/lib/devtools/third_party/axe-core/LICENSE +362 -0
- package/lib/devtools/third_party/chromium/LICENSE +27 -0
- package/lib/devtools/third_party/codemirror/package/LICENSE +21 -0
- package/lib/devtools/third_party/codemirror.next/LICENSE +21 -0
- package/lib/devtools/third_party/csp_evaluator/package/LICENSE +202 -0
- package/lib/devtools/third_party/diff/LICENSE +202 -0
- package/lib/devtools/third_party/i18n/LICENSE +202 -0
- package/lib/devtools/third_party/intl-messageformat/LICENSE +33 -0
- package/lib/devtools/third_party/intl-messageformat/package/LICENSE.md +33 -0
- package/lib/devtools/third_party/json5/LICENSE +23 -0
- package/lib/devtools/third_party/legacy-javascript/LICENSE +202 -0
- package/lib/devtools/third_party/lighthouse/LICENSE +202 -0
- package/lib/devtools/third_party/lit/LICENSE +28 -0
- package/lib/devtools/third_party/marked/LICENSE +39 -0
- package/lib/devtools/third_party/marked/package/LICENSE.md +44 -0
- package/lib/devtools/third_party/puppeteer/LICENSE +202 -0
- package/lib/devtools/third_party/puppeteer/third_party/mitt/LICENSE +21 -0
- package/lib/devtools/third_party/puppeteer/third_party/parsel/LICENSE +21 -0
- package/lib/devtools/third_party/puppeteer/third_party/rxjs/LICENSE +201 -0
- package/lib/devtools/third_party/puppeteer-replay/package/LICENSE +202 -0
- package/lib/devtools/third_party/source-map-scopes-codec/LICENSE +26 -0
- package/lib/devtools/third_party/source-map-scopes-codec/package/LICENSE +26 -0
- package/lib/devtools/third_party/third-party-web/LICENSE +20 -0
- package/lib/devtools/third_party/third-party-web/package/LICENSE +20 -0
- package/lib/devtools/third_party/vscode.web-custom-data/package/LICENSE.md +21 -0
- package/lib/devtools/third_party/wasmparser/package/LICENSE +177 -0
- package/lib/devtools/third_party/web-vitals/package/LICENSE +202 -0
- package/lib/index.js +2554 -0
- package/lib/types/client/bottom/keyboard.d.ts +10 -0
- package/lib/types/client/bottom/locales.d.ts +17 -0
- package/lib/types/client/bottom/page.d.ts +10 -0
- package/lib/types/client/bottom/resize.d.ts +12 -0
- package/lib/types/client/bridge/controller.d.ts +10 -0
- package/lib/types/client/bridge/dispatcher.d.ts +26 -0
- package/lib/types/client/bridge/lifecycle.d.ts +22 -0
- package/lib/types/client/bridge/locales.d.ts +3 -0
- package/lib/types/client/bridge/publisher.d.ts +42 -0
- package/lib/types/client/bridge/rpc.d.ts +13 -0
- package/lib/types/client/bridge/transport.d.ts +41 -0
- package/lib/types/client/cdp/console.d.ts +45 -0
- package/lib/types/client/cdp/debugger.d.ts +8 -0
- package/lib/types/client/cdp/errors.d.ts +8 -0
- package/lib/types/client/cdp/heap-profiler.d.ts +8 -0
- package/lib/types/client/cdp/index.d.ts +10 -0
- package/lib/types/client/cdp/objects.d.ts +69 -0
- package/lib/types/client/cdp/profiler.d.ts +8 -0
- package/lib/types/client/cdp/properties.d.ts +16 -0
- package/lib/types/client/cdp/runtime.d.ts +79 -0
- package/lib/types/client/cdp/sources.d.ts +53 -0
- package/lib/types/client/cdp/stack.d.ts +27 -0
- package/lib/types/client/index.d.ts +3 -0
- package/lib/types/client/inspection/cordis.d.ts +3 -0
- package/lib/types/client/inspection/network.d.ts +4 -0
- package/lib/types/client/inspection/realm.d.ts +27 -0
- package/lib/types/client/plugin.d.ts +29 -0
- package/lib/types/host/bridge/controller.d.ts +108 -0
- package/lib/types/host/bridge/dispatcher.d.ts +16 -0
- package/lib/types/host/bridge/lifecycle.d.ts +42 -0
- package/lib/types/host/bridge/publisher.d.ts +31 -0
- package/lib/types/host/bridge/rpc.d.ts +15 -0
- package/lib/types/host/bridge/transport.d.ts +28 -0
- package/lib/types/host/cdp/console.d.ts +14 -0
- package/lib/types/host/cdp/debugger.d.ts +8 -0
- package/lib/types/host/cdp/errors.d.ts +6 -0
- package/lib/types/host/cdp/heap-profiler.d.ts +8 -0
- package/lib/types/host/cdp/index.d.ts +10 -0
- package/lib/types/host/cdp/objects.d.ts +8 -0
- package/lib/types/host/cdp/profiler.d.ts +8 -0
- package/lib/types/host/cdp/properties.d.ts +7 -0
- package/lib/types/host/cdp/runtime.d.ts +16 -0
- package/lib/types/host/cdp/sources.d.ts +14 -0
- package/lib/types/host/cdp/stack.d.ts +4 -0
- package/lib/types/host/index.d.ts +3 -0
- package/lib/types/host/inspection/cordis.d.ts +3 -0
- package/lib/types/host/inspection/network.d.ts +23 -0
- package/lib/types/host/inspection/realm.d.ts +9 -0
- package/lib/types/host/plugin.d.ts +19 -0
- package/lib/types/index.d.ts +50 -0
- package/lib/types/shared/bridge/buffer.d.ts +62 -0
- package/lib/types/shared/bridge/codec.d.ts +4 -0
- package/lib/types/shared/bridge/control-codec.d.ts +27 -0
- package/lib/types/shared/bridge/ids.d.ts +19 -0
- package/lib/types/shared/bridge/messages/control.d.ts +64 -0
- package/lib/types/shared/bridge/messages/cordis.d.ts +4 -0
- package/lib/types/shared/bridge/messages/network.d.ts +4 -0
- package/lib/types/shared/bridge/messages/observation.d.ts +110 -0
- package/lib/types/shared/bridge/messages/query/codec.d.ts +40 -0
- package/lib/types/shared/bridge/messages/query/commands.d.ts +35 -0
- package/lib/types/shared/bridge/messages/query/frames.d.ts +31 -0
- package/lib/types/shared/bridge/messages/query/index.d.ts +5 -0
- package/lib/types/shared/bridge/messages/runtime/command-codec.d.ts +9 -0
- package/lib/types/shared/bridge/messages/runtime/commands.d.ts +76 -0
- package/lib/types/shared/bridge/messages/runtime/console-frames.d.ts +52 -0
- package/lib/types/shared/bridge/messages/runtime/frames.d.ts +98 -0
- package/lib/types/shared/bridge/messages/runtime/index.d.ts +5 -0
- package/lib/types/shared/bridge/messages/runtime/value-codec.d.ts +28 -0
- package/lib/types/shared/bridge/messages/sources/codec.d.ts +15 -0
- package/lib/types/shared/bridge/messages/sources/commands.d.ts +42 -0
- package/lib/types/shared/bridge/messages/sources/frames.d.ts +67 -0
- package/lib/types/shared/bridge/messages/sources/index.d.ts +5 -0
- package/lib/types/shared/bridge/publisher.d.ts +33 -0
- package/lib/types/shared/bridge/query-reader.d.ts +10 -0
- package/lib/types/shared/bridge/rpc.d.ts +62 -0
- package/lib/types/shared/bridge/validation.d.ts +3 -0
- package/lib/types/shared/bridge/version.d.ts +3 -0
- package/lib/types/shared/cdp/capabilities.d.ts +17 -0
- package/lib/types/shared/cdp/console.d.ts +28 -0
- package/lib/types/shared/cdp/debugger.d.ts +69 -0
- package/lib/types/shared/cdp/errors.d.ts +27 -0
- package/lib/types/shared/cdp/ids.d.ts +9 -0
- package/lib/types/shared/cdp/index.d.ts +11 -0
- package/lib/types/shared/cdp/operations.d.ts +86 -0
- package/lib/types/shared/cdp/property.d.ts +28 -0
- package/lib/types/shared/cdp/realm.d.ts +137 -0
- package/lib/types/shared/cdp/remote-object.d.ts +44 -0
- package/lib/types/shared/cdp/sources.d.ts +18 -0
- package/lib/types/shared/cordis/collector.d.ts +26 -0
- package/lib/types/shared/cordis/ids.d.ts +7 -0
- package/lib/types/shared/cordis/model.d.ts +61 -0
- package/lib/types/shared/cordis/object-reference.d.ts +14 -0
- package/lib/types/shared/cordis/object-registry.d.ts +80 -0
- package/lib/types/shared/cordis/observer.d.ts +15 -0
- package/lib/types/shared/cordis/projector.d.ts +34 -0
- package/lib/types/shared/cordis/publisher.d.ts +13 -0
- package/lib/types/shared/cordis/reader.d.ts +18 -0
- package/lib/types/shared/cordis/snapshot.d.ts +39 -0
- package/lib/types/shared/dispose.d.ts +11 -0
- package/lib/types/shared/identity.d.ts +12 -0
- package/lib/types/shared/index.d.ts +18 -0
- package/lib/types/shared/json.d.ts +35 -0
- package/lib/types/shared/network/event-source.d.ts +20 -0
- package/lib/types/shared/network/observation.d.ts +52 -0
- package/lib/types/shared/service.d.ts +23 -0
- package/lib/types/shared/validation.d.ts +52 -0
- package/lib/types/shared/web.d.ts +16 -0
- package/lib/types/worker/bridge/endpoint.d.ts +49 -0
- package/lib/types/worker/bridge/hub.d.ts +108 -0
- package/lib/types/worker/bridge/runtime-rpc.d.ts +90 -0
- package/lib/types/worker/bridge/session.d.ts +15 -0
- package/lib/types/worker/bridge/source-rpc.d.ts +42 -0
- package/lib/types/worker/cdp/domains/debugger/cdp-params.d.ts +15 -0
- package/lib/types/worker/cdp/domains/debugger/index.d.ts +6 -0
- package/lib/types/worker/cdp/domains/debugger/projector.d.ts +22 -0
- package/lib/types/worker/cdp/domains/debugger/script-registry.d.ts +70 -0
- package/lib/types/worker/cdp/domains/debugger/session.d.ts +47 -0
- package/lib/types/worker/cdp/domains/dom/index.d.ts +4 -0
- package/lib/types/worker/cdp/domains/dom/model.d.ts +121 -0
- package/lib/types/worker/cdp/domains/dom/session.d.ts +78 -0
- package/lib/types/worker/cdp/domains/native.d.ts +25 -0
- package/lib/types/worker/cdp/domains/network/session.d.ts +46 -0
- package/lib/types/worker/cdp/domains/runtime/cdp-params.d.ts +82 -0
- package/lib/types/worker/cdp/domains/runtime/index.d.ts +3 -0
- package/lib/types/worker/cdp/domains/runtime/object-table.d.ts +117 -0
- package/lib/types/worker/cdp/domains/runtime/session.d.ts +97 -0
- package/lib/types/worker/cdp/ids.d.ts +37 -0
- package/lib/types/worker/cdp/protocol.d.ts +46 -0
- package/lib/types/worker/cdp/realm-sessions.d.ts +67 -0
- package/lib/types/worker/cdp/session.d.ts +39 -0
- package/lib/types/worker/cdp/target.d.ts +17 -0
- package/lib/types/worker/entry.d.ts +3 -0
- package/lib/types/worker/inspection/cordis-query.d.ts +11 -0
- package/lib/types/worker/inspection/cordis-store.d.ts +94 -0
- package/lib/types/worker/inspection/network-store.d.ts +110 -0
- package/lib/types/worker/inspection/query-router.d.ts +78 -0
- package/lib/types/worker/inspection/realm-store.d.ts +58 -0
- package/lib/types/worker/inspection/realm.d.ts +43 -0
- package/lib/types/worker/realms/client/bridge.d.ts +18 -0
- package/lib/types/worker/realms/client/console.d.ts +21 -0
- package/lib/types/worker/realms/client/debugger.d.ts +8 -0
- package/lib/types/worker/realms/client/index.d.ts +18 -0
- package/lib/types/worker/realms/client/runtime.d.ts +28 -0
- package/lib/types/worker/realms/client/scripts.d.ts +15 -0
- package/lib/types/worker/realms/client/sources.d.ts +30 -0
- package/lib/types/worker/realms/client/values.d.ts +55 -0
- package/lib/types/worker/realms/host/bridge.d.ts +49 -0
- package/lib/types/worker/realms/host/console.d.ts +25 -0
- package/lib/types/worker/realms/host/debugger.d.ts +25 -0
- package/lib/types/worker/realms/host/index.d.ts +13 -0
- package/lib/types/worker/realms/host/runtime.d.ts +54 -0
- package/lib/types/worker/realms/host/scripts.d.ts +9 -0
- package/lib/types/worker/realms/host/sources.d.ts +26 -0
- package/lib/types/worker/realms/host/values.d.ts +22 -0
- package/lib/types/worker/server.d.ts +16 -0
- package/lib/worker.js +7289 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +90 -3
|
@@ -0,0 +1,4255 @@
|
|
|
1
|
+
import { n as e } from "./chunk-DF993M8W.js";
|
|
2
|
+
import { H as t, W as n, r } from "./platform-BzB373NB.js";
|
|
3
|
+
import { A as i, D as a, Et as o, F as s, R as c, St as l, at as u, bt as ee, d as te, n as ne, p as re, wt as ie } from "./common-qd_KLeYO.js";
|
|
4
|
+
import { p as d, r as ae, s as oe } from "./root-DbVQo07X.js";
|
|
5
|
+
import { $ as se, $i as f, Af as ce, Ao as le, Ar as ue, Fo as p, Ft as de, Gf as fe, Hf as pe, Ht as me, Jo as he, Ko as ge, Lo as _e, Md as m, Na as ve, No as ye, Or as be, Po as h, Qi as xe, S as Se, U as Ce, Uo as we, Vc as Te, Vo as g, Wc as Ee, Wf as De, Wo as Oe, Wr as ke, Xf as Ae, Yo as je, Zi as _, Zo as v, aa as Me, al as Ne, cs as Pe, ei as Fe, ep as y, fa as b, ha as Ie, ii as Le, jr as x, ka as Re, kc as ze, ls as Be, mf as S, mo as Ve, na as He, ni as Ue, no as C, ol as We, op as Ge, pf as w, qo as Ke, qr as qe, rf as Je, rl as Ye, sc as Xe, sl as Ze, tl as T, un as Qe, uo as $e, vi as et, yo as tt, za as nt } from "./legacy-Bqn4Q0Tf.js";
|
|
6
|
+
import { g as rt } from "./text_utils-ohNt_gua.js";
|
|
7
|
+
import { P as it, S as E, T as at, j as ot, w as st } from "./bindings-DgoVEdsr.js";
|
|
8
|
+
import { $t as ct, Gt as lt, Jt as ut, K as dt, Kt as ft, Mt as pt, Xt as mt, Yt as D, Zt as ht, _n as gt, _t, at as vt, bn as yt, bt, c as xt, ct as St, dt as O, en as Ct, ft as wt, gt as Tt, ht as Et, it as Dt, jt as Ot, ln as kt, lt as At, mn as jt, nn as Mt, o as Nt, pt as Pt, q as Ft, qt as It, tn as Lt, ut as Rt, vt as zt, xt as Bt, yt as Vt } from "./common-DjRFwulW.js";
|
|
9
|
+
import { t as Ht } from "./i18n-DvFMqQdJ.js";
|
|
10
|
+
import { En as Ut, Mt as Wt, Vr as Gt, t as Kt, vt as k } from "./snackbars-lPThuWYs.js";
|
|
11
|
+
import { n as qt } from "./marked-zGgfoDxO.js";
|
|
12
|
+
import { n as Jt, r as Yt } from "./UIRequestLocation-CtGcVN3I.js";
|
|
13
|
+
import { t as Xt } from "./textInput.css-DPvwvIic.js";
|
|
14
|
+
import { B as Zt, m as Qt, t as $t, u as en, x as tn } from "./elements-Dbx4q9-v.js";
|
|
15
|
+
import { t as nn } from "./utils-CELci976.js";
|
|
16
|
+
import { a as rn } from "./perf_ui-CQMkYfn3.js";
|
|
17
|
+
import { l as an, n as on, t as sn } from "./lighthouse-DtpzvfT6.js";
|
|
18
|
+
import { t as cn, x as ln } from "./network-CaxdpGU2.js";
|
|
19
|
+
import { $ as un, J as dn, O as fn, Q as pn, S as mn, X as hn, Y as gn, Z as _n, _t as vn, at as yn, b as bn, ct as xn, dt as Sn, et as Cn, ft as wn, g as Tn, gt as En, it as Dn, l as On, lt as kn, mt as An, nt as jn, ot as Mn, p as Nn, pt as Pn, rt as Fn, st as In, tt as Ln, ut as Rn, vt as zn, x as Bn, yt as Vn } from "./timeline-C4vCX79k.js";
|
|
20
|
+
import { t as Hn } from "./markdown_view-C67b2DdG.js";
|
|
21
|
+
import { a as Un, n as Wn } from "./changes-k42bihtm.js";
|
|
22
|
+
//#region \0qilin-devtools:css:/home/runner/work/QiLin/QiLin/node_modules/.pnpm/chrome-devtools-frontend@1.0.1638082/node_modules/chrome-devtools-frontend/front_end/panels/ai_assistance/aiAssistancePanel.css.mjs
|
|
23
|
+
var Gn = "/*\n * Copyright 2024 The Chromium Authors\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.toolbar-container {\n display: flex;\n flex-wrap: wrap;\n background-color: var(--sys-color-cdt-base-container);\n border-bottom: 1px solid var(--sys-color-divider);\n flex: 0 0 auto;\n justify-content: space-between;\n}\n\n.ai-assistance-view-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n align-items: center;\n overflow: hidden;\n\n & .fill-panel {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n\n devtools-split-view {\n width: 100%;\n height: 100%;\n }\n}\n\n.toolbar-feedback-link {\n color: var(--sys-color-primary);\n margin: 0 var(--sys-size-3);\n height: auto;\n font-size: var(--sys-typescale-body4-size);\n}\n", { html: Kn } = ye, qn = class extends Hn {
|
|
24
|
+
#e(e, t) {
|
|
25
|
+
return Kn`<devtools-link @click=${(t) => {
|
|
26
|
+
t.preventDefault(), t.stopPropagation(), u(e);
|
|
27
|
+
}}>${n(t, 100)}</devtools-link>`;
|
|
28
|
+
}
|
|
29
|
+
#t(e, t) {
|
|
30
|
+
if (e.startsWith("#req-")) {
|
|
31
|
+
let n = lt.instance().requests().find((t) => t.requestId() === e.substring(5));
|
|
32
|
+
return n ? this.#e(n, n.url()) : Kn`${t}`;
|
|
33
|
+
}
|
|
34
|
+
if (e.startsWith("#file-")) {
|
|
35
|
+
let n = _t.getUISourceCodes().find((t) => _t.uiSourceCodeId.get(t) === Number(e.substring(6)));
|
|
36
|
+
return n ? this.#e(n, n.name()) : Kn`${t}`;
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
templateForToken(e) {
|
|
41
|
+
if (e.type === "link") {
|
|
42
|
+
let t = this.#t(e.href, e.text);
|
|
43
|
+
if (t) return t;
|
|
44
|
+
}
|
|
45
|
+
if (e.type === "code") {
|
|
46
|
+
let t = e.text.split("\n");
|
|
47
|
+
t[0]?.trim() === "css" && (e.lang = "css", e.text = t.slice(1).join("\n"));
|
|
48
|
+
}
|
|
49
|
+
if (e.type === "codespan") {
|
|
50
|
+
let t = e.text.match(/^\[(.*)\]\((.+)\)$/);
|
|
51
|
+
if (t?.[2]) {
|
|
52
|
+
let e = this.#t(t[2], t[1]);
|
|
53
|
+
if (e) return e;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return super.templateForToken(e);
|
|
57
|
+
}
|
|
58
|
+
}, { html: Jn } = _e, { until: Yn } = Oe, Xn = class extends qn {
|
|
59
|
+
mainDocumentURL;
|
|
60
|
+
constructor(e = "") {
|
|
61
|
+
super(), this.mainDocumentURL = e;
|
|
62
|
+
}
|
|
63
|
+
#e(e) {
|
|
64
|
+
let t = e.ownerDocument?.documentURL ?? "";
|
|
65
|
+
return Lt(this.mainDocumentURL, t);
|
|
66
|
+
}
|
|
67
|
+
templateForToken(e) {
|
|
68
|
+
if (e.type === "link" && e.href.startsWith("#")) {
|
|
69
|
+
let t = this.#t(e.href);
|
|
70
|
+
if (t) return Jn`<span>${Yn((t.type === "path" ? this.#r(t.path, e.text) : this.#n(t.nodeId, e.text)).then((t) => t || e.text), e.text)}</span>`;
|
|
71
|
+
}
|
|
72
|
+
return super.templateForToken(e);
|
|
73
|
+
}
|
|
74
|
+
#t(e) {
|
|
75
|
+
if (e.startsWith("#path-")) return {
|
|
76
|
+
type: "path",
|
|
77
|
+
path: e.replace("#path-", "")
|
|
78
|
+
};
|
|
79
|
+
if (e.startsWith("#1,HTML")) return {
|
|
80
|
+
type: "path",
|
|
81
|
+
path: e.slice(1)
|
|
82
|
+
};
|
|
83
|
+
let t = "";
|
|
84
|
+
if (e.startsWith("#node-") ? t = e.replace("#node-", "") : e.startsWith("#") && (t = e.slice(1)), t.trim() !== "") {
|
|
85
|
+
let e = Number(t);
|
|
86
|
+
if (Number.isInteger(e)) return {
|
|
87
|
+
type: "node",
|
|
88
|
+
nodeId: e
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
async #n(e, t) {
|
|
94
|
+
if (e === void 0) return;
|
|
95
|
+
let n = m.instance().primaryPageTarget()?.model(T);
|
|
96
|
+
if (!n) return;
|
|
97
|
+
let r = (await n.pushNodesByBackendIdsToFrontend(new Set([e])))?.get(e);
|
|
98
|
+
if (r && this.#e(r)) return xt.instance().linkify(r, { textContent: t });
|
|
99
|
+
}
|
|
100
|
+
async #r(e, t) {
|
|
101
|
+
let n = m.instance().primaryPageTarget()?.model(T);
|
|
102
|
+
if (!n) return;
|
|
103
|
+
let r = await n.pushNodeByPathToFrontend(e);
|
|
104
|
+
if (!r) return;
|
|
105
|
+
let i = n.nodeForId(r);
|
|
106
|
+
if (i && this.#e(i)) return xt.instance().linkify(i, { textContent: t });
|
|
107
|
+
}
|
|
108
|
+
}, Zn = "/*\n * Copyright 2024 The Chromium Authors\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n@scope to (devtools-widget > *) {\n .ai-assistance-feedback-row {\n font-family: var(--default-font-family);\n width: 100%;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin-block: calc(-1 * var(--sys-size-3));\n margin-top: var(--sys-size-5);\n overflow: hidden;\n mask-image: linear-gradient(to right, var(--ref-palette-neutral0) calc(100% - var(--sys-size-15)), transparent 100%);\n\n &.not-v2 {\n /* Can be removed when AIv2 ships */\n gap: var(--sys-size-8);\n }\n\n .action-buttons {\n display: flex;\n align-items: center;\n gap: var(--sys-size-2);\n padding: var(--sys-size-4) 0;\n }\n\n .vertical-separator {\n height: 16px;\n width: 1px;\n vertical-align: top;\n margin: 0 var(--sys-size-2);\n background: var(--sys-color-divider);\n display: inline-block;\n }\n\n .suggestions-container {\n overflow: hidden;\n position: relative;\n display: flex;\n\n .suggestions-scroll-container {\n display: flex;\n overflow: auto hidden;\n scrollbar-width: none;\n gap: var(--sys-size-3);\n padding: var(--sys-size-3);\n }\n\n .scroll-button-container {\n position: absolute;\n top: 0;\n height: 100%;\n display: flex;\n align-items: center;\n width: var(--sys-size-15);\n z-index: 999;\n }\n\n .scroll-button-container.hidden {\n display: none;\n }\n\n .scroll-button-container.left {\n left: 0;\n background:\n linear-gradient(\n 90deg,\n var(--sys-color-cdt-base-container) 0%,\n var(--sys-color-cdt-base-container) 50%,\n transparent\n );\n }\n\n .scroll-button-container.right {\n right: 0;\n background:\n linear-gradient(\n 90deg,\n transparent,\n var(--sys-color-cdt-base-container) 50%\n );\n justify-content: flex-end;\n }\n }\n }\n\n .feedback-form {\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-5);\n margin-top: var(--sys-size-4);\n background-color: var(--sys-color-surface3);\n padding: var(--sys-size-6);\n border-radius: var(--sys-shape-corner-medium-small);\n max-width: var(--sys-size-32);\n\n .feedback-input {\n height: var(--sys-size-11);\n padding: 0 var(--sys-size-5);\n background-color: var(--sys-color-surface3);\n width: auto;\n }\n\n .feedback-input::placeholder {\n color: var(--sys-color-on-surface-subtle);\n font: var(--sys-typescale-body4-regular);\n }\n\n .feedback-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .feedback-title {\n margin: 0;\n font: var(--sys-typescale-body3-medium);\n }\n\n .feedback-disclaimer {\n padding: 0 var(--sys-size-4);\n }\n }\n\n .user-query-wrapper {\n display: flex;\n justify-content: flex-end;\n padding: 0 var(--sys-size-5);\n align-items: center;\n }\n\n .chat-message {\n user-select: text;\n cursor: initial;\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-5);\n width: 100%;\n padding: var(--sys-size-7) var(--sys-size-5);\n font-size: 12px;\n word-break: normal;\n overflow-wrap: anywhere;\n border-bottom: var(--sys-size-1) solid var(--sys-color-divider);\n\n\n &.query.ai-v2 {\n width: fit-content;\n max-width: 80%;\n text-align: left;\n padding: var(--sys-size-4) var(--sys-size-6);\n font: var(--sys-typescale-body4-regular);\n /* top left - top right - bottom right - bottom left */\n border-radius: var(--sys-shape-corner-medium) var(--sys-shape-corner-extra-small) var(--sys-shape-corner-medium) var(--sys-shape-corner-medium);\n background-color: var(--sys-color-surface5);\n color: var(--sys-color-on-surface);\n\n &.is-first-message {\n /* So the first message doesn't bump right against the top\n * toolbar */\n margin-top: var(--sys-size-6);\n }\n }\n\n &.ai-v2 {\n border-bottom: none;\n }\n\n .ai-css-change {\n margin: var(--sys-size-6) 0;\n }\n\n &:not(.ai-v2) .answer-body-wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-5);\n width: 100%;\n }\n\n &.ai-v2 .answer-body-wrapper {\n @container(min-width: 700px) {\n /* Purposefully not using design system variables, this is a\n * specific size to indent the content in and align it with the\n * walkthrough CTA. */\n padding-left: 35px;\n }\n }\n\n &.is-last-message {\n border-bottom: 0;\n }\n\n .message-info {\n display: flex;\n align-items: center;\n height: var(--sys-size-11);\n gap: var(--sys-size-4);\n font: var(--sys-typescale-body4-bold);\n\n h2 {\n font: var(--sys-typescale-body4-bold);\n }\n }\n\n .actions {\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-8);\n max-width: 100%;\n }\n\n .aborted {\n color: var(--sys-color-on-surface-subtle);\n }\n\n .image-link {\n width: fit-content;\n border-radius: var(--sys-shape-corner-small);\n outline-offset: var(--sys-size-2);\n\n img {\n max-height: var(--sys-size-20);\n max-width: 100%;\n border-radius: var(--sys-shape-corner-small);\n border: 1px solid var(--sys-color-neutral-outline);\n width: fit-content;\n vertical-align: bottom;\n }\n }\n\n .unavailable-image {\n margin: var(--sys-size-4) 0;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: var(--sys-size-17);\n width: var(--sys-size-18);\n background-color: var(--sys-color-surface3);\n border-radius: var(--sys-shape-corner-small);\n border: 1px solid var(--sys-color-neutral-outline);\n\n devtools-icon {\n color: var(--sys-color-state-disabled);\n }\n }\n }\n\n .indicator {\n color: var(--sys-color-green-bright);\n }\n\n .summary {\n display: grid;\n grid-template-columns: auto 1fr auto;\n padding: var(--sys-size-3);\n line-height: var(--sys-size-9);\n cursor: default;\n gap: var(--sys-size-3);\n justify-content: center;\n align-items: center;\n\n .title {\n margin: 0;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n font: var(--sys-typescale-body4-regular);\n\n .paused {\n font: var(--sys-typescale-body4-bold);\n }\n }\n }\n\n .step-code {\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-2);\n }\n\n .js-code-output {\n devtools-code-block {\n --code-block-max-code-height: 50px;\n }\n }\n\n .context-details {\n devtools-code-block {\n --code-block-max-code-height: 80px;\n }\n }\n\n .step {\n width: fit-content;\n background-color: var(--sys-color-surface3);\n border-radius: 16px;\n position: relative;\n\n &.empty {\n pointer-events: none;\n\n .arrow {\n display: none;\n }\n }\n\n &:not(&[open]):hover::after {\n content: '';\n height: 100%;\n width: 100%;\n border-radius: inherit;\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n background-color: var(--sys-color-state-hover-on-subtle);\n }\n\n &.paused {\n .indicator {\n color: var(--sys-color-on-surface-subtle);\n }\n }\n\n &.canceled {\n .summary {\n color: var(--sys-color-state-disabled);\n text-decoration: line-through;\n }\n\n .indicator {\n color: var(--sys-color-state-disabled);\n }\n }\n\n devtools-markdown-view {\n --code-background-color: var(--sys-color-surface1);\n }\n\n devtools-icon {\n vertical-align: bottom;\n }\n\n devtools-spinner {\n width: var(--sys-size-9);\n height: var(--sys-size-9);\n padding: var(--sys-size-2);\n }\n\n &[open] {\n width: auto;\n\n summary {\n margin-bottom: var(--sys-size-2);\n }\n\n .summary .title {\n white-space: normal;\n overflow: unset;\n }\n\n .summary .arrow {\n transform: rotate(180deg);\n }\n }\n\n summary::marker {\n content: '';\n }\n\n summary {\n border-radius: 16px;\n\n &:focus-visible {\n outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);\n outline-offset: var(--sys-size-2);\n }\n }\n\n .step-details {\n padding: 0 var(--sys-size-5) var(--sys-size-4) var(--sys-size-12);\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-6);\n\n devtools-code-block {\n --code-block-background-color: var(--sys-color-surface1);\n }\n }\n }\n\n\n .error-step {\n color: var(--sys-color-error);\n }\n\n .side-effect-confirmation {\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-5);\n padding-bottom: var(--sys-size-4);\n }\n\n .side-effect-buttons-container {\n display: flex;\n gap: var(--sys-size-4);\n }\n\n .walkthrough-toggle-container {\n display: flex;\n gap: var(--sys-size-2);\n align-items: center;\n\n &.has-widgets {\n gap: var(--sys-size-6);\n }\n\n .chevron {\n color: var(--sys-color-primary);\n width: var(--sys-size-8);\n height: var(--sys-size-8);\n margin-left: var(--sys-size-2);\n }\n }\n\n\n .computed-styles-widget {\n display: block;\n width: fit-content;\n }\n\n .styling-preview-widget {\n width: 100%;\n min-height: 100px;\n }\n\n .main-widgets-wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-5);\n }\n\n .step-widgets-wrapper {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--sys-size-5);\n }\n\n .widget-header {\n display: flex;\n justify-content: space-between;\n height: var(--sys-size-11);\n align-items: center;\n background: var(--sys-color-surface5);\n padding: var(--sys-size-2) var(--sys-size-4);\n border-top-left-radius: var(--sys-shape-corner-small);\n border-top-right-radius: var(--sys-shape-corner-small);\n\n .widget-name {\n font: var(--sys-typescale-body4-regular);\n margin: 0;\n max-width: 80%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap; /* stop the titles going onto multiple lines */\n }\n\n /* This widget's title is some text + then a DOM node link, so it\n * needs some extra styling */\n .computed-style-title-wrapper {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: var(--sys-size-3);\n }\n\n .computed-style-title-prefix {\n flex-shrink: 0;\n }\n\n .widget-reveal-container {\n padding: 0;\n background: none;\n border-radius: 0;\n }\n }\n\n .widget-reveal-button {\n display: flex;\n align-items: center;\n\n devtools-icon {\n margin-left: var(--sys-size-3);\n color: var(--sys-color-primary);\n width: var(--sys-size-8);\n height: var(--sys-size-8);\n }\n\n }\n\n .widget-and-revealer-container {\n width: 100%;\n min-width: var(--sys-size-30);\n max-width: var(--sys-size-33);\n }\n\n .widget-reveal-container {\n background: var(--sys-color-surface5);\n border-bottom-right-radius: var(--sys-shape-corner-small);\n border-bottom-left-radius: var(--sys-shape-corner-small);\n padding: 0 var(--sys-size-4) var(--sys-size-4) 0;\n }\n\n .revealer-only .widget-reveal-container {\n background: none;\n border-radius: unset;\n }\n\n .widget-content-container {\n padding: var(--sys-size-4) var(--sys-size-5);\n border-top-left-radius: var(--sys-shape-corner-medium);\n border-top-right-radius: var(--sys-shape-corner-medium);\n overflow-x: auto;\n background-color: var(--sys-color-surface3);\n\n --override-computed-style-property-white-space: normal;\n\n /* When header is present, content follows it and shouldn't have top radii */\n .widget-header+& {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n\n /* When header is present, content is the last child and needs bottom radii */\n .widget-header+&:last-child {\n border-bottom-left-radius: var(--sys-shape-corner-medium);\n border-bottom-right-radius: var(--sys-shape-corner-medium);\n }\n }\n\n .network-request-preview {\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-4);\n margin-bottom: var(--sys-size-5);\n padding-bottom: var(--sys-size-5);\n border-bottom: 1px solid var(--sys-color-divider);\n\n .network-request-header {\n display: flex;\n align-items: center;\n gap: var(--sys-size-5);\n\n .network-request-icon {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--sys-color-surface1);\n border-radius: var(--sys-shape-corner-small);\n border: 1px solid var(--sys-color-divider);\n overflow: hidden;\n\n img {\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n\n devtools-icon {\n width: 20px;\n height: 20px;\n }\n }\n\n .network-request-details {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n .network-request-name {\n font: var(--sys-typescale-body4-bold);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .network-request-size {\n font: var(--sys-typescale-body4-regular);\n color: var(--sys-color-on-surface-subtle);\n }\n }\n }\n }\n}\n", Qn = /* @__PURE__ */ e({ getButtonLabel: () => er });
|
|
109
|
+
function $n(e, t) {
|
|
110
|
+
if (e.length <= t) return {
|
|
111
|
+
truncatedText: e,
|
|
112
|
+
moreCharacters: 0
|
|
113
|
+
};
|
|
114
|
+
let n = e.lastIndexOf(" ", t), r = e.indexOf(" ", t), i = t;
|
|
115
|
+
i = n === -1 && r === -1 ? t : n === -1 ? r : r === -1 || t - n <= r - t ? n : r;
|
|
116
|
+
let a = e, o = 0;
|
|
117
|
+
return i < e.length && (a = e.slice(0, i), o = e.length - i), {
|
|
118
|
+
truncatedText: a,
|
|
119
|
+
moreCharacters: o
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function er(e) {
|
|
123
|
+
let t = "";
|
|
124
|
+
if (t = e.isLoading && !e.isExpanded && e.stepTitle ? e.stepTitle : `${e.isExpanded ? "Hide" : "Show"} ${e.hasWidgets ? "AI walkthrough" : "thinking"}`, e.isLoading) return `Loading: ${t}`;
|
|
125
|
+
let { truncatedText: n, moreCharacters: r } = $n(e.prompt, 50), i = r > 0 ? ` (and ${r} more characters)` : "";
|
|
126
|
+
return `${t} for prompt ${n}${i}`;
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region \0qilin-devtools:css:/home/runner/work/QiLin/QiLin/node_modules/.pnpm/chrome-devtools-frontend@1.0.1638082/node_modules/chrome-devtools-frontend/front_end/panels/ai_assistance/components/walkthroughView.css.mjs
|
|
130
|
+
var tr = "/*\n * Copyright 2026 The Chromium Authors\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n@scope (devtools-widget) {\n .walkthrough-view {\n height: 100%;\n background-color: var(--sys-color-cdt-base-container);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n }\n}\n\n@scope (devtools-widget > *) {\n .walkthrough-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 8px;\n height: 35px;\n border-bottom: 1px solid var(--sys-color-divider);\n flex-shrink: 0;\n }\n\n .walkthrough-title {\n font-size: 11px;\n font-weight: 500;\n color: var(--sys-color-on-surface);\n }\n\n .steps-container {\n flex: 1;\n overflow-y: auto;\n }\n\n .steps-scroll-content {\n padding: var(--sys-size-6);\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-6);\n }\n\n .walkthrough-step {\n display: flex;\n gap: var(--sys-size-6);\n align-items: flex-start;\n justify-content: flex-start;\n flex-shrink: 0;\n\n .step-number {\n font: var(--sys-typescale-body4-regular);\n color: var(--sys-color-on-surface-subtle);\n padding-top:var(--sys-size-4);\n flex-grow: 0;\n flex-shrink: 0;\n }\n }\n\n .step-wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-5);\n min-width: 0;\n width: 100%;\n }\n\n .step-container {\n display: flex;\n gap: var(--sys-size-5);\n align-items: flex-start;\n }\n\n .step-icon {\n color: var(--sys-color-on-surface-subtle);\n width: var(--sys-size-8);\n height: var(--sys-size-8);\n flex-shrink: 0;\n margin-top: var(--sys-size-2);\n }\n\n .step-content {\n flex: 1;\n font-size: 11px;\n color: var(--sys-color-on-surface);\n line-height: 1.4;\n }\n\n .empty-state {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n color: var(--sys-color-on-surface-subtle);\n font-size: 11px;\n }\n\n .inline-wrapper {\n display: flex;\n align-items: flex-start;\n gap: var(--sys-size-2);\n justify-content: flex-start;\n\n .inline-icon {\n display: block;\n margin-top: var(--sys-size-2);\n }\n }\n\n .walkthrough-inline {\n border-radius: var(--sys-shape-corner-full);\n overflow: hidden;\n width: fit-content;\n max-width: 100%;\n\n &[open] {\n border-radius: var(--sys-size-5);\n width: auto;\n background-color: var(--sys-color-surface2);\n margin-left: calc(var(--sys-size-6) / 2);\n flex-grow: 1;\n }\n }\n\n .walkthrough-inline > summary {\n display: flex;\n align-items: center;\n cursor: pointer;\n background-color: transparent;\n /* The same height as a DevTools Button */\n height: var(--sys-size-11);\n font: var(--sys-typescale-body4-regular);\n font-weight:var(--ref-typeface-weight-medium);\n user-select: none;\n list-style: none; /* Hide default triangle */\n justify-content: flex-start;\n gap: var(--sys-size-4);\n color: var(--sys-color-primary);\n padding: 0 var(--sys-size-6);\n overflow: hidden;\n\n devtools-icon {\n color: var(--sys-color-primary);\n }\n\n /* Align the summary to look like the tonal button */\n &[data-has-widgets] {\n background: var(--sys-color-tonal-container);\n color: var(--sys-color-on-tonal-container);\n border-radius: var(--sys-shape-corner-full);\n margin-left: var(--sys-size-6);\n\n devtools-icon {\n color: var(--sys-color-on-tonal-container);\n }\n }\n\n > .walkthrough-inline-title {\n font: var(--sys-typescale-body4-regular);\n font-weight: var(--ref-typeface-weight-medium);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n }\n\n &:focus-visible {\n outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);\n outline-offset: calc(-1 * var(--sys-size-2));\n }\n }\n\n .walkthrough-inline[open] > summary {\n border-radius: var(--sys-shape-corner-medium-small);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n background: var(--sys-color-surface5);\n color: var(--sys-color-on-surface);\n\n &[data-has-widgets] {\n margin-left: 0;\n }\n\n > devtools-icon[name='chevron-right'] {\n transform: rotate(270deg);\n }\n\n }\n\n .walkthrough-inline > summary::-webkit-details-marker {\n display: none;\n }\n\n .walkthrough-inline > summary:hover {\n background-color: var(--sys-color-state-hover-on-subtle);\n }\n\n .walkthrough-inline .steps-container {\n padding: var(--sys-size-6);\n border-top: 1px solid var(--sys-color-divider);\n background-color: transparent;\n }\n\n .walkthrough-inline > summary > devtools-icon[name='chevron-right'] {\n width: var(--sys-size-8);\n height: var(--sys-size-8);\n transition: transform 0.2s;\n margin-left: auto;\n }\n\n .walkthrough-inline .step {\n background-color: var(--sys-color-surface5);\n }\n}\n", nr = /* @__PURE__ */ e({
|
|
131
|
+
DEFAULT_VIEW: () => mr,
|
|
132
|
+
WalkthroughView: () => hr,
|
|
133
|
+
walkthroughCloseTitle: () => dr,
|
|
134
|
+
walkthroughTitle: () => ur
|
|
135
|
+
}), rr = l, { html: A, render: ir, Directives: ar } = ye, { ref: or } = ar, sr = 2, j = {
|
|
136
|
+
close: "Close",
|
|
137
|
+
title: "Agent walkthrough",
|
|
138
|
+
showThinking: "Show thinking",
|
|
139
|
+
showAgentWalkthrough: "Show agent walkthrough",
|
|
140
|
+
hideThinking: "Hide thinking",
|
|
141
|
+
hideAgentWalkthrough: "Hide agent walkthrough",
|
|
142
|
+
inProgress: "In progress"
|
|
143
|
+
}, cr = ie("panels/ai_assistance/components/WalkthroughView.ts", j), lr = ee.bind(void 0, cr);
|
|
144
|
+
function ur(e) {
|
|
145
|
+
return e.isLoading ? Tr(e.lastStep) : e.hasWidgets ? rr(j.showAgentWalkthrough) : rr(j.showThinking);
|
|
146
|
+
}
|
|
147
|
+
function dr(e) {
|
|
148
|
+
return e.isInlined ? lr(j.title) : e.hasWidgets ? rr(j.hideAgentWalkthrough) : rr(j.hideThinking);
|
|
149
|
+
}
|
|
150
|
+
function fr(e, t, n) {
|
|
151
|
+
let r = n.at(-1);
|
|
152
|
+
if (!e.isInlined || !r) return v;
|
|
153
|
+
function i(t) {
|
|
154
|
+
let n = t.target.open;
|
|
155
|
+
e.message && (n ? e.onOpen(e.message) : e.onToggle(n, e.message));
|
|
156
|
+
}
|
|
157
|
+
let a = n.some((e) => e.widgets?.length), o = ct();
|
|
158
|
+
return A`
|
|
159
|
+
<div class="inline-wrapper" ?data-open=${e.isExpanded} jslog=${C("walkthrough-container")}>
|
|
160
|
+
<span class="inline-icon">
|
|
161
|
+
${e.isLoading ? A`<devtools-spinner aria-label=${rr(j.inProgress)}></devtools-spinner>` : A`<devtools-icon name=${o}></devtools-icon>`}
|
|
162
|
+
</span>
|
|
163
|
+
<details class="walkthrough-inline" ?open=${e.isExpanded} @toggle=${i} jslog=${ve("walkthrough").track({ click: !0 })}>
|
|
164
|
+
<summary
|
|
165
|
+
?data-has-widgets=${!e.isLoading && a}
|
|
166
|
+
aria-label=${er({
|
|
167
|
+
isExpanded: e.isExpanded,
|
|
168
|
+
isLoading: e.isLoading,
|
|
169
|
+
hasWidgets: a,
|
|
170
|
+
prompt: e.prompt,
|
|
171
|
+
stepTitle: Tr(r)
|
|
172
|
+
})}
|
|
173
|
+
>
|
|
174
|
+
<h2 class="walkthrough-inline-title">
|
|
175
|
+
${e.isExpanded ? dr({
|
|
176
|
+
hasWidgets: a,
|
|
177
|
+
isInlined: !0
|
|
178
|
+
}) : ur({
|
|
179
|
+
isLoading: e.isLoading,
|
|
180
|
+
lastStep: r,
|
|
181
|
+
hasWidgets: a
|
|
182
|
+
})}
|
|
183
|
+
</h2>
|
|
184
|
+
<devtools-icon name="chevron-right"></devtools-icon>
|
|
185
|
+
</summary>
|
|
186
|
+
|
|
187
|
+
${t}
|
|
188
|
+
</details>
|
|
189
|
+
</div>
|
|
190
|
+
`;
|
|
191
|
+
}
|
|
192
|
+
function pr(e, t, n) {
|
|
193
|
+
return e.isInlined ? v : A`
|
|
194
|
+
<div class="walkthrough-view" jslog=${C("walkthrough-container")}>
|
|
195
|
+
<div class="walkthrough-header">
|
|
196
|
+
<h2 class="walkthrough-title">${lr(j.title)}</h2>
|
|
197
|
+
<devtools-button
|
|
198
|
+
.data=${{
|
|
199
|
+
variant: f.TOOLBAR,
|
|
200
|
+
iconName: "cross",
|
|
201
|
+
title: lr(j.close),
|
|
202
|
+
jslogContext: "close-walkthrough"
|
|
203
|
+
}}
|
|
204
|
+
@click=${() => {
|
|
205
|
+
e.message && e.onToggle(!1, e.message);
|
|
206
|
+
}}
|
|
207
|
+
></devtools-button>
|
|
208
|
+
</div>
|
|
209
|
+
${t}
|
|
210
|
+
${n === 0 ? A`
|
|
211
|
+
<div class="empty-state">
|
|
212
|
+
<p>No walkthrough steps available yet.</p>
|
|
213
|
+
</div>
|
|
214
|
+
` : v}
|
|
215
|
+
</div>
|
|
216
|
+
`;
|
|
217
|
+
}
|
|
218
|
+
var mr = (e, t, n) => {
|
|
219
|
+
let r = e.message?.parts.filter((e) => e.type === "step")?.map((e) => e.step) ?? [], i = r.filter((e) => !e.requestApproval), a = i.length > 0 ? A`
|
|
220
|
+
<div class="steps-container" @scroll=${e.handleScroll} ${or((e) => {
|
|
221
|
+
t.scrollContainer = e;
|
|
222
|
+
})}>
|
|
223
|
+
<div class="steps-scroll-content" ${or((e) => {
|
|
224
|
+
t.stepsContainer = e;
|
|
225
|
+
})}>
|
|
226
|
+
${i.map((t, n) => A`
|
|
227
|
+
<div class="walkthrough-step">
|
|
228
|
+
<span class="step-number">${n + 1}</span>
|
|
229
|
+
<div class="step-wrapper">
|
|
230
|
+
${Nr({
|
|
231
|
+
step: t,
|
|
232
|
+
isLoading: e.isLoading,
|
|
233
|
+
markdownRenderer: e.markdownRenderer,
|
|
234
|
+
isLast: n === i.length - 1
|
|
235
|
+
})}
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
`)}
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
` : v;
|
|
242
|
+
ir(A`
|
|
243
|
+
<style>
|
|
244
|
+
${Xt}
|
|
245
|
+
${Zn}
|
|
246
|
+
${tr}
|
|
247
|
+
</style>
|
|
248
|
+
${e.isInlined ? fr(e, a, r) : pr(e, a, i.length)}`, n);
|
|
249
|
+
}, hr = class extends Ue {
|
|
250
|
+
#e;
|
|
251
|
+
#t = null;
|
|
252
|
+
#n = !1;
|
|
253
|
+
#r = null;
|
|
254
|
+
#i = () => {};
|
|
255
|
+
#a = () => {};
|
|
256
|
+
#o = !1;
|
|
257
|
+
#s = !1;
|
|
258
|
+
#c = "";
|
|
259
|
+
#l = !0;
|
|
260
|
+
#u = !1;
|
|
261
|
+
#d = {};
|
|
262
|
+
#f = new ResizeObserver(() => this.#h());
|
|
263
|
+
#p = 0;
|
|
264
|
+
constructor(e, t = mr) {
|
|
265
|
+
super(e), this.#e = t, this.setMinimumSize(330, 0);
|
|
266
|
+
}
|
|
267
|
+
wasShown() {
|
|
268
|
+
super.wasShown(), this.#m();
|
|
269
|
+
}
|
|
270
|
+
willHide() {
|
|
271
|
+
super.willHide(), this.#f.disconnect();
|
|
272
|
+
}
|
|
273
|
+
#m() {
|
|
274
|
+
this.#d.stepsContainer && this.#f.observe(this.#d.stepsContainer);
|
|
275
|
+
}
|
|
276
|
+
#h() {
|
|
277
|
+
let e = this.#d.stepsContainer?.offsetWidth ?? 0;
|
|
278
|
+
if (e !== this.#p) {
|
|
279
|
+
this.#p = e;
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
!this.#l || !this.#n || this.scrollToBottom();
|
|
283
|
+
}
|
|
284
|
+
scrollToBottom() {
|
|
285
|
+
this.#d.stepsContainer && (this.#u = !0, window.requestAnimationFrame(() => {
|
|
286
|
+
let e = this.#d.stepsContainer?.lastElementChild;
|
|
287
|
+
e && e.scrollIntoView({
|
|
288
|
+
behavior: "smooth",
|
|
289
|
+
block: "end"
|
|
290
|
+
});
|
|
291
|
+
}));
|
|
292
|
+
}
|
|
293
|
+
#g = (e) => {
|
|
294
|
+
if (!(!e.target || !(e.target instanceof HTMLElement))) {
|
|
295
|
+
if (this.#u) {
|
|
296
|
+
e.target.scrollTop + e.target.clientHeight + sr >= e.target.scrollHeight && (this.#u = !1);
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
this.#l = e.target.scrollTop + e.target.clientHeight + sr >= e.target.scrollHeight;
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
set isLoading(e) {
|
|
303
|
+
this.#n = e, this.requestUpdate();
|
|
304
|
+
}
|
|
305
|
+
get isLoading() {
|
|
306
|
+
return this.#n;
|
|
307
|
+
}
|
|
308
|
+
get markdownRenderer() {
|
|
309
|
+
return this.#r;
|
|
310
|
+
}
|
|
311
|
+
set markdownRenderer(e) {
|
|
312
|
+
this.#r = e, this.requestUpdate();
|
|
313
|
+
}
|
|
314
|
+
get message() {
|
|
315
|
+
return this.#t;
|
|
316
|
+
}
|
|
317
|
+
get onOpen() {
|
|
318
|
+
return this.#a;
|
|
319
|
+
}
|
|
320
|
+
set onOpen(e) {
|
|
321
|
+
this.#a = e, this.requestUpdate();
|
|
322
|
+
}
|
|
323
|
+
set message(e) {
|
|
324
|
+
this.#t = e, this.requestUpdate();
|
|
325
|
+
}
|
|
326
|
+
set onToggle(e) {
|
|
327
|
+
this.#i = e, this.requestUpdate();
|
|
328
|
+
}
|
|
329
|
+
set isInlined(e) {
|
|
330
|
+
this.#o = e, this.requestUpdate();
|
|
331
|
+
}
|
|
332
|
+
set isExpanded(e) {
|
|
333
|
+
this.#s = e, this.requestUpdate();
|
|
334
|
+
}
|
|
335
|
+
get prompt() {
|
|
336
|
+
return this.#c;
|
|
337
|
+
}
|
|
338
|
+
set prompt(e) {
|
|
339
|
+
this.#c = e, this.requestUpdate();
|
|
340
|
+
}
|
|
341
|
+
performUpdate() {
|
|
342
|
+
if (!this.#r) return;
|
|
343
|
+
let e = this.#t ? Yr(this.#t) : null;
|
|
344
|
+
this.#e({
|
|
345
|
+
isLoading: this.#n,
|
|
346
|
+
markdownRenderer: this.#r,
|
|
347
|
+
onToggle: this.#i,
|
|
348
|
+
onOpen: this.#a,
|
|
349
|
+
isInlined: this.#o,
|
|
350
|
+
isExpanded: this.#s,
|
|
351
|
+
prompt: this.#c,
|
|
352
|
+
message: e,
|
|
353
|
+
handleScroll: this.#g
|
|
354
|
+
}, this.#d, this.contentElement), this.#m(), this.#l && this.#n && this.scrollToBottom();
|
|
355
|
+
}
|
|
356
|
+
}, gr = /* @__PURE__ */ e({
|
|
357
|
+
ChatMessage: () => ti,
|
|
358
|
+
ChatMessageEntity: () => Sr,
|
|
359
|
+
DEFAULT_VIEW: () => Cr,
|
|
360
|
+
getDeduplicatedWidgetsMessage: () => Yr,
|
|
361
|
+
getWidgetSignature: () => Jr,
|
|
362
|
+
renderStep: () => Nr,
|
|
363
|
+
titleForStep: () => Tr
|
|
364
|
+
}), { html: M, Directives: { ref: _r, ifDefined: vr } } = ye, N = l, { widget: P } = Le, yr = "https://crbug.com/508304827", br = 1, xr = 11, F = {
|
|
365
|
+
thumbsUp: "Good response",
|
|
366
|
+
thumbsDown: "Bad response",
|
|
367
|
+
provideFeedbackPlaceholder: "Provide additional feedback",
|
|
368
|
+
disclaimer: "Submitted feedback will also include your conversation",
|
|
369
|
+
submit: "Submit",
|
|
370
|
+
whyThisRating: "Why did you choose this rating? (optional)",
|
|
371
|
+
close: "Close",
|
|
372
|
+
report: "Report legal issue",
|
|
373
|
+
scrollToNext: "Scroll to next suggestions",
|
|
374
|
+
scrollToPrevious: "Scroll to previous suggestions",
|
|
375
|
+
copyResponse: "Copy response",
|
|
376
|
+
systemError: "Something unforeseen happened and I can no longer continue. Try your request again and see if that resolves the issue. If this keeps happening, update Chrome to the latest version.",
|
|
377
|
+
maxStepsError: "Seems like I am stuck with the investigation. It would be better if you start over.",
|
|
378
|
+
crossOriginError: "I have selected the new context but you will have to start a new chat.",
|
|
379
|
+
stoppedResponse: "You stopped this response",
|
|
380
|
+
confirmActionRequestApproval: "Continue",
|
|
381
|
+
declineActionRequestApproval: "Cancel",
|
|
382
|
+
ai: "AI",
|
|
383
|
+
gemini: "Gemini",
|
|
384
|
+
investigating: "Investigating",
|
|
385
|
+
paused: "Paused",
|
|
386
|
+
codeExecuted: "Code executed",
|
|
387
|
+
codeToExecute: "Code to execute",
|
|
388
|
+
dataReturned: "Data returned",
|
|
389
|
+
completed: "Completed",
|
|
390
|
+
inProgress: "In progress",
|
|
391
|
+
aborted: "Aborted",
|
|
392
|
+
imageInputSentToTheModel: "Image input sent to the model",
|
|
393
|
+
openImageInNewTab: "Open image in a new tab",
|
|
394
|
+
imageUnavailable: "Image unavailable",
|
|
395
|
+
reveal: "Reveal",
|
|
396
|
+
revealTrace: "Reveal trace",
|
|
397
|
+
revealComputedStyles: "Reveal computed styles",
|
|
398
|
+
revealCoreWebVitals: "Reveal Core Web Vitals",
|
|
399
|
+
revealStyleProperties: "Reveal style properties",
|
|
400
|
+
revealLcpBreakdown: "Reveal LCP breakdown",
|
|
401
|
+
revealLcpDiscovery: "Reveal LCP discovery",
|
|
402
|
+
revealClsCulprits: "Reveal layout shift culprits",
|
|
403
|
+
revealRenderBlockingBreakdown: "Reveal render-blocking requests",
|
|
404
|
+
revealLcpElement: "Reveal LCP element",
|
|
405
|
+
revealPerformanceSummary: "Reveal performance summary",
|
|
406
|
+
revealBottomUpTree: "Reveal bottom-up thread activity",
|
|
407
|
+
revealNetworkDependencyTree: "Reveal network dependency tree",
|
|
408
|
+
revealThirdParties: "Reveal 3rd parties",
|
|
409
|
+
coreVitals: "Core Web Vitals",
|
|
410
|
+
lighthouseReport: "Lighthouse report",
|
|
411
|
+
revealLighthouse: "Reveal Lighthouse report",
|
|
412
|
+
timelineEventSummary: "Event summary",
|
|
413
|
+
revealTimelineEventSummary: "Reveal event",
|
|
414
|
+
lcpBreakdown: "LCP breakdown",
|
|
415
|
+
lcpDiscovery: "LCP discovery",
|
|
416
|
+
clsCulprits: "Layout shift culprits",
|
|
417
|
+
renderBlockingBreakdown: "Render-blocking requests",
|
|
418
|
+
networkDependencyTree: "Network dependency tree",
|
|
419
|
+
thirdParties: "3rd parties",
|
|
420
|
+
lcpElement: "LCP element",
|
|
421
|
+
performanceSummary: "Performance summary",
|
|
422
|
+
exportForAgents: "Copy to coding agent",
|
|
423
|
+
bottomUpTree: "Bottom-up thread activity",
|
|
424
|
+
revealForcedReflow: "Reveal forced reflow",
|
|
425
|
+
forcedReflow: "Forced reflow",
|
|
426
|
+
revealCache: "Reveal efficient cache lifetimes",
|
|
427
|
+
cache: "Efficient cache lifetimes",
|
|
428
|
+
revealInpBreakdown: "Reveal INP breakdown",
|
|
429
|
+
inpBreakdown: "INP breakdown",
|
|
430
|
+
revealDocumentLatency: "Reveal document latency",
|
|
431
|
+
documentLatency: "Document latency",
|
|
432
|
+
revealDomSize: "Reveal DOM size",
|
|
433
|
+
domSize: "DOM size",
|
|
434
|
+
revealDuplicateJavaScript: "Reveal duplicated JavaScript",
|
|
435
|
+
duplicateJavaScript: "Duplicated JavaScript",
|
|
436
|
+
revealImageDelivery: "Reveal image delivery",
|
|
437
|
+
imageDelivery: "Image delivery",
|
|
438
|
+
revealFontDisplay: "Reveal font display",
|
|
439
|
+
fontDisplay: "Font display",
|
|
440
|
+
revealSlowCssSelector: "Reveal slow CSS selectors",
|
|
441
|
+
slowCssSelector: "Slow CSS selectors",
|
|
442
|
+
revealLegacyJavaScript: "Reveal legacy JavaScript",
|
|
443
|
+
legacyJavaScript: "Legacy JavaScript",
|
|
444
|
+
revealViewport: "Reveal viewport optimization",
|
|
445
|
+
viewport: "Viewport optimization",
|
|
446
|
+
revealNetworkRequest: "Reveal network request",
|
|
447
|
+
networkRequest: "Network request",
|
|
448
|
+
revealModernHttp: "Reveal modern HTTP usage",
|
|
449
|
+
modernHttp: "Modern HTTP usage",
|
|
450
|
+
revealCharacterSet: "Reveal character set declaration",
|
|
451
|
+
characterSet: "Character set declaration"
|
|
452
|
+
}, Sr = /* @__PURE__ */ function(e) {
|
|
453
|
+
return e.MODEL = "model", e.USER = "user", e;
|
|
454
|
+
}({}), Cr = (e, t, n) => {
|
|
455
|
+
let r = !!d.devToolsAiAssistanceV2?.enabled, i = e.message;
|
|
456
|
+
if (i.entity === "user") {
|
|
457
|
+
let t = i.imageInput && "inlineData" in i.imageInput ? $r(i.imageInput.inlineData) : v, a = g({
|
|
458
|
+
"chat-message": !0,
|
|
459
|
+
query: !0,
|
|
460
|
+
"is-last-message": e.isLastMessage,
|
|
461
|
+
"is-first-message": e.isFirstMessage,
|
|
462
|
+
"ai-v2": r
|
|
463
|
+
});
|
|
464
|
+
p(M`
|
|
465
|
+
<style>${Xt}</style>
|
|
466
|
+
<style>${Zn}</style>
|
|
467
|
+
<div class=${g({ "user-query-wrapper": r })}>
|
|
468
|
+
<section class=${a} jslog=${C("question")}>
|
|
469
|
+
${t}
|
|
470
|
+
<div class="message-content">${wr(i.text, e.markdownRenderer)}</div>
|
|
471
|
+
</section>
|
|
472
|
+
</div>
|
|
473
|
+
`, n);
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
let a = i.parts.filter((e) => e.type === "step").map((e) => e.step), o = ct();
|
|
477
|
+
p(M`
|
|
478
|
+
<style>${Xt}</style>
|
|
479
|
+
<style>${Zn}</style>
|
|
480
|
+
<section class=${g({
|
|
481
|
+
"chat-message": !0,
|
|
482
|
+
answer: !0,
|
|
483
|
+
"is-last-message": e.isLastMessage,
|
|
484
|
+
"is-first-message": e.isFirstMessage,
|
|
485
|
+
"ai-v2": r
|
|
486
|
+
})} jslog=${C("answer")}>
|
|
487
|
+
${r ? v : M`
|
|
488
|
+
<div class="message-info">
|
|
489
|
+
<devtools-icon name=${o}></devtools-icon>
|
|
490
|
+
<div class="message-name">
|
|
491
|
+
<h2>${Ct() ? N(F.gemini) : N(F.ai)}</h2>
|
|
492
|
+
</div>
|
|
493
|
+
</div>`}
|
|
494
|
+
${r ? Ar(e, a) : v}
|
|
495
|
+
<div class="answer-body-wrapper">
|
|
496
|
+
${ge(i.parts, (e, t) => t, (t, n) => {
|
|
497
|
+
let a = n === i.parts.length - 1;
|
|
498
|
+
return t.type === "answer" ? M`<p>${wr(t.text, e.markdownRenderer, { animate: !e.isReadOnly && e.isLoading && a && e.isLastMessage })}</p>` : t.type === "widget" ? M`${Ke(Xr(t.widgets, { wrapperClass: "main-widgets-wrapper" }))}` : !r && t.type === "step" ? Nr({
|
|
499
|
+
step: t.step,
|
|
500
|
+
isLoading: e.isLoading,
|
|
501
|
+
markdownRenderer: e.markdownRenderer,
|
|
502
|
+
isLast: a
|
|
503
|
+
}) : v;
|
|
504
|
+
})}
|
|
505
|
+
${Qr(i)}
|
|
506
|
+
${e.shouldShowCSSChangeSummary && r && e.changeSummary ? M`
|
|
507
|
+
<devtools-code-block
|
|
508
|
+
.code=${e.changeSummary}
|
|
509
|
+
.codeLang=${"css"}
|
|
510
|
+
.displayLimit=${xr}
|
|
511
|
+
.displayNotice=${!0}
|
|
512
|
+
class="ai-css-change"
|
|
513
|
+
></devtools-code-block>
|
|
514
|
+
` : v}
|
|
515
|
+
${e.showActions ? ei(e, t) : v}
|
|
516
|
+
</div>
|
|
517
|
+
${r ? jr(e, a) : v}
|
|
518
|
+
</section>
|
|
519
|
+
`, n);
|
|
520
|
+
};
|
|
521
|
+
function wr(e, t, { animate: n, ref: r } = {}) {
|
|
522
|
+
let i = [];
|
|
523
|
+
try {
|
|
524
|
+
i = qt(e);
|
|
525
|
+
for (let e of i) t.renderToken(e);
|
|
526
|
+
} catch {
|
|
527
|
+
return M`${e}`;
|
|
528
|
+
}
|
|
529
|
+
return M`<devtools-markdown-view
|
|
530
|
+
.data=${{
|
|
531
|
+
tokens: i,
|
|
532
|
+
renderer: t,
|
|
533
|
+
animationEnabled: n
|
|
534
|
+
}}
|
|
535
|
+
${r ? _r(r) : v}>
|
|
536
|
+
</devtools-markdown-view>`;
|
|
537
|
+
}
|
|
538
|
+
function Tr(e) {
|
|
539
|
+
return e.title ?? `${N(F.investigating)}…`;
|
|
540
|
+
}
|
|
541
|
+
function Er(e) {
|
|
542
|
+
let t = e.requestApproval ? M`<span class="paused">${N(F.paused)}: </span>` : v;
|
|
543
|
+
return M`<h3 class="title" aria-label=${Tr(e)}>${t}${Tr(e)}</h3>`;
|
|
544
|
+
}
|
|
545
|
+
function Dr(e) {
|
|
546
|
+
if (!e.code && !e.output) return v;
|
|
547
|
+
let t = e.output && !e.canceled ? N(F.codeExecuted) : N(F.codeToExecute);
|
|
548
|
+
return M`<div class="step-code">${e.code ? M`<div class="action-result">
|
|
549
|
+
<devtools-code-block
|
|
550
|
+
.code=${e.code.trim()}
|
|
551
|
+
.codeLang=${"js"}
|
|
552
|
+
.displayNotice=${!e.output}
|
|
553
|
+
.header=${t}
|
|
554
|
+
.showCopyButton=${!0}
|
|
555
|
+
></devtools-code-block>
|
|
556
|
+
</div>` : v}${e.output ? M`<div class="js-code-output">
|
|
557
|
+
<devtools-code-block
|
|
558
|
+
.code=${e.output}
|
|
559
|
+
.codeLang=${"js"}
|
|
560
|
+
.displayNotice=${!0}
|
|
561
|
+
.header=${N(F.dataReturned)}
|
|
562
|
+
.showCopyButton=${!1}
|
|
563
|
+
></devtools-code-block>
|
|
564
|
+
</div>` : v}</div>`;
|
|
565
|
+
}
|
|
566
|
+
function Or({ step: e, markdownRenderer: t, isLast: n }) {
|
|
567
|
+
let r = n && e.requestApproval ? Zr(e) : v, i = e.thought ? M`<p>${wr(e.thought, t)}</p>` : v, a = e.contextDetails ? M`${ge(e.contextDetails, (e) => M`<div class="context-details">
|
|
568
|
+
<devtools-code-block
|
|
569
|
+
.code=${e.text}
|
|
570
|
+
.codeLang=${e.codeLang || ""}
|
|
571
|
+
.displayNotice=${!1}
|
|
572
|
+
.header=${e.title}
|
|
573
|
+
.showCopyButton=${!0}
|
|
574
|
+
></devtools-code-block>
|
|
575
|
+
</div>`)}` : v;
|
|
576
|
+
return M`<div class="step-details">
|
|
577
|
+
${i}
|
|
578
|
+
${Dr(e)}
|
|
579
|
+
${r}
|
|
580
|
+
${a}
|
|
581
|
+
</div>`;
|
|
582
|
+
}
|
|
583
|
+
function kr(e, t) {
|
|
584
|
+
let { message: n, walkthrough: r } = e, i = t.at(-1);
|
|
585
|
+
if (r.isInlined || !i) return v;
|
|
586
|
+
let a = t.some((e) => e.widgets?.length), o = r.isExpanded && e.message.id === e.walkthrough.activeSidebarMessage?.id, s = o ? dr({ hasWidgets: a }) : ur({
|
|
587
|
+
isLoading: e.isLoading,
|
|
588
|
+
hasWidgets: a,
|
|
589
|
+
lastStep: i
|
|
590
|
+
}), c = a && !e.isLoading ? f.TONAL : f.TEXT, l = ct(), u = g({
|
|
591
|
+
"walkthrough-toggle-container": !0,
|
|
592
|
+
"has-widgets": a && !e.isLoading
|
|
593
|
+
}), ee = er({
|
|
594
|
+
isExpanded: o,
|
|
595
|
+
isLoading: e.isLoading,
|
|
596
|
+
hasWidgets: a,
|
|
597
|
+
prompt: e.prompt,
|
|
598
|
+
stepTitle: Tr(i)
|
|
599
|
+
});
|
|
600
|
+
return M`
|
|
601
|
+
<div class=${u}>
|
|
602
|
+
${e.isLoading ? M`<devtools-spinner></devtools-spinner>` : M`<devtools-icon name=${l}></devtools-icon>`}
|
|
603
|
+
<devtools-button
|
|
604
|
+
.variant=${c}
|
|
605
|
+
.size=${_.SMALL}
|
|
606
|
+
.title=${i.isLoading ? Tr(i) : s}
|
|
607
|
+
.accessibleLabel=${ee}
|
|
608
|
+
.jslogContext=${r.isExpanded ? "ai-hide-walkthrough-sidebar" : "ai-show-walkthrough-sidebar"}
|
|
609
|
+
data-show-walkthrough
|
|
610
|
+
@click=${() => {
|
|
611
|
+
r.activeSidebarMessage?.id === e.message.id && r.isExpanded ? r.onToggle(!1, n) : r.onOpen(n);
|
|
612
|
+
}}>${s}<devtools-icon class="chevron" .name=${o ? "cross" : "chevron-right"}></devtools-icon>
|
|
613
|
+
</devtools-button>
|
|
614
|
+
</div>
|
|
615
|
+
`;
|
|
616
|
+
}
|
|
617
|
+
function Ar(e, t) {
|
|
618
|
+
if (!t.at(-1)) return v;
|
|
619
|
+
let n = e.walkthrough.isInlined ? v : kr(e, t), r = e.walkthrough.isInlined ? e.walkthrough.inlineExpandedMessages.some((t) => t.id === e.message.id) : e.walkthrough.isExpanded && e.walkthrough.activeSidebarMessage?.id === e.message.id;
|
|
620
|
+
return M`
|
|
621
|
+
${n}
|
|
622
|
+
${e.walkthrough.isInlined ? M`
|
|
623
|
+
<div class="walkthrough-container">
|
|
624
|
+
${P(hr, {
|
|
625
|
+
message: e.message,
|
|
626
|
+
isLoading: e.isLoading && e.isLastMessage,
|
|
627
|
+
markdownRenderer: e.markdownRenderer,
|
|
628
|
+
isInlined: !0,
|
|
629
|
+
isExpanded: r,
|
|
630
|
+
prompt: e.prompt,
|
|
631
|
+
onToggle: e.walkthrough.onToggle,
|
|
632
|
+
onOpen: e.walkthrough.onOpen
|
|
633
|
+
})}
|
|
634
|
+
</div>
|
|
635
|
+
` : v}
|
|
636
|
+
`;
|
|
637
|
+
}
|
|
638
|
+
function jr(e, t) {
|
|
639
|
+
let n = t.filter((e) => e.requestApproval);
|
|
640
|
+
return n.length === 0 ? v : M`
|
|
641
|
+
${n.map((t) => M`
|
|
642
|
+
<div class="side-effect-container">
|
|
643
|
+
${Nr({
|
|
644
|
+
step: t,
|
|
645
|
+
isLoading: e.isLoading,
|
|
646
|
+
markdownRenderer: e.markdownRenderer,
|
|
647
|
+
isLast: !0
|
|
648
|
+
})}
|
|
649
|
+
</div> `)}
|
|
650
|
+
`;
|
|
651
|
+
}
|
|
652
|
+
function Mr({ step: e, isLoading: t, isLast: n }) {
|
|
653
|
+
if (t && n && !e.requestApproval) return M`<devtools-spinner aria-label=${N(F.inProgress)}></devtools-spinner>`;
|
|
654
|
+
let r = "checkmark", i = N(F.completed), a = "button";
|
|
655
|
+
return n && e.requestApproval ? (a = void 0, i = N(F.paused), r = "pause-circle") : e.canceled && (i = N(F.aborted), r = "cross"), M`<devtools-icon
|
|
656
|
+
class="indicator"
|
|
657
|
+
role=${vr(a)}
|
|
658
|
+
aria-label=${vr(i)}
|
|
659
|
+
.name=${r}
|
|
660
|
+
></devtools-icon>`;
|
|
661
|
+
}
|
|
662
|
+
function Nr({ step: e, isLoading: t, markdownRenderer: n, isLast: r }) {
|
|
663
|
+
return M`
|
|
664
|
+
<details class=${g({
|
|
665
|
+
step: !0,
|
|
666
|
+
empty: !e.thought && !e.code && !e.contextDetails && !e.requestApproval,
|
|
667
|
+
paused: !!e.requestApproval,
|
|
668
|
+
canceled: !!e.canceled
|
|
669
|
+
})}
|
|
670
|
+
jslog=${ve("step").track({ click: !0 })}
|
|
671
|
+
.open=${!!e.requestApproval}>
|
|
672
|
+
<summary>
|
|
673
|
+
<div class="summary">
|
|
674
|
+
${Mr({
|
|
675
|
+
step: e,
|
|
676
|
+
isLoading: t,
|
|
677
|
+
isLast: r
|
|
678
|
+
})}
|
|
679
|
+
${Er(e)}
|
|
680
|
+
<devtools-icon
|
|
681
|
+
class="arrow"
|
|
682
|
+
name="chevron-down"
|
|
683
|
+
></devtools-icon>
|
|
684
|
+
</div>
|
|
685
|
+
</summary>
|
|
686
|
+
${Or({
|
|
687
|
+
step: e,
|
|
688
|
+
markdownRenderer: n,
|
|
689
|
+
isLast: r
|
|
690
|
+
})}
|
|
691
|
+
</details>
|
|
692
|
+
${Ke(Xr(e.widgets, { wrapperClass: "step-widgets-wrapper" }))}
|
|
693
|
+
`;
|
|
694
|
+
}
|
|
695
|
+
var Pr = /* @__PURE__ */ new Map();
|
|
696
|
+
async function Fr(e) {
|
|
697
|
+
let t = Pr.get(e);
|
|
698
|
+
if (t) return t;
|
|
699
|
+
let n = m.instance().primaryPageTarget();
|
|
700
|
+
if (!n) return null;
|
|
701
|
+
let r = await new We(n, e).resolvePromise();
|
|
702
|
+
return r && Pr.set(e, r), r;
|
|
703
|
+
}
|
|
704
|
+
async function Ir(e) {
|
|
705
|
+
let t = await Fr(e.data.backendNodeId);
|
|
706
|
+
if (!t) return null;
|
|
707
|
+
let n = new Zt(t, e.data.computedStyles), r = null;
|
|
708
|
+
try {
|
|
709
|
+
r = new RegExp(e.data.properties.join("|"), "i");
|
|
710
|
+
} catch {
|
|
711
|
+
return null;
|
|
712
|
+
}
|
|
713
|
+
return {
|
|
714
|
+
renderedWidget: M`<devtools-widget
|
|
715
|
+
class="computed-styles-widget" ${P(tn, {
|
|
716
|
+
nodeStyle: n,
|
|
717
|
+
matchedStyles: e.data.matchedCascade,
|
|
718
|
+
propertyTraces: null,
|
|
719
|
+
allowUserControl: !1,
|
|
720
|
+
filterText: r,
|
|
721
|
+
enableNarrowViewResizing: !1
|
|
722
|
+
})}></devtools-widget>`,
|
|
723
|
+
revealable: new en(t),
|
|
724
|
+
accessibleRevealLabel: N(F.revealComputedStyles),
|
|
725
|
+
title: M`
|
|
726
|
+
<span class="computed-style-title-wrapper">
|
|
727
|
+
<span class="computed-style-title-prefix">Computed styles</span>
|
|
728
|
+
<span class="style-class-wrapper">
|
|
729
|
+
(<devtools-widget
|
|
730
|
+
${P(Nt, { node: t })}
|
|
731
|
+
></devtools-widget>)
|
|
732
|
+
</span>
|
|
733
|
+
</span>`,
|
|
734
|
+
jslogContext: "computed-styles"
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
async function Lr(e) {
|
|
738
|
+
return {
|
|
739
|
+
renderedWidget: M`<devtools-widget class="core-vitals-widget" ${P(gn, {
|
|
740
|
+
data: e.data,
|
|
741
|
+
skipBottomBorder: !0
|
|
742
|
+
})}>
|
|
743
|
+
</devtools-widget>`,
|
|
744
|
+
revealable: new vn(e.data.insightSetKey),
|
|
745
|
+
accessibleRevealLabel: N(F.revealCoreWebVitals),
|
|
746
|
+
title: N(F.coreVitals),
|
|
747
|
+
jslogContext: "core-web-vitals"
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
async function Rr(e) {
|
|
751
|
+
let t = await Fr(e.data.backendNodeId);
|
|
752
|
+
if (!t) return null;
|
|
753
|
+
let n = null;
|
|
754
|
+
try {
|
|
755
|
+
n = e.data.selector ? new RegExp(e.data.selector) : null;
|
|
756
|
+
} catch {
|
|
757
|
+
return null;
|
|
758
|
+
}
|
|
759
|
+
return {
|
|
760
|
+
renderedWidget: M`<devtools-widget
|
|
761
|
+
class="styling-preview-widget"
|
|
762
|
+
${P($t, {
|
|
763
|
+
domNode: t,
|
|
764
|
+
filter: n
|
|
765
|
+
})}>
|
|
766
|
+
</devtools-widget>`,
|
|
767
|
+
revealable: t,
|
|
768
|
+
accessibleRevealLabel: N(F.revealStyleProperties),
|
|
769
|
+
title: M`<devtools-widget
|
|
770
|
+
${P(Nt, { node: t })}
|
|
771
|
+
></devtools-widget>`,
|
|
772
|
+
jslogContext: "standalone-styles"
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
var zr = {
|
|
776
|
+
[k.LCP_BREAKDOWN]: {
|
|
777
|
+
component: Dn,
|
|
778
|
+
accessibleLabel: F.revealLcpBreakdown,
|
|
779
|
+
title: F.lcpBreakdown,
|
|
780
|
+
jslog: "lcp-breakdown-widget"
|
|
781
|
+
},
|
|
782
|
+
[k.RENDER_BLOCKING]: {
|
|
783
|
+
component: un,
|
|
784
|
+
accessibleLabel: F.revealRenderBlockingBreakdown,
|
|
785
|
+
title: F.renderBlockingBreakdown,
|
|
786
|
+
jslog: "render-blocking-widget"
|
|
787
|
+
},
|
|
788
|
+
[k.LCP_DISCOVERY]: {
|
|
789
|
+
component: Fn,
|
|
790
|
+
accessibleLabel: F.revealLcpDiscovery,
|
|
791
|
+
title: F.lcpDiscovery,
|
|
792
|
+
jslog: "lcp-discovery-widget"
|
|
793
|
+
},
|
|
794
|
+
[k.CLS_CULPRITS]: {
|
|
795
|
+
component: wn,
|
|
796
|
+
accessibleLabel: F.revealClsCulprits,
|
|
797
|
+
title: F.clsCulprits,
|
|
798
|
+
jslog: "cls-culprits-widget"
|
|
799
|
+
},
|
|
800
|
+
[k.NETWORK_DEPENDENCY_TREE]: {
|
|
801
|
+
component: Cn,
|
|
802
|
+
accessibleLabel: F.revealNetworkDependencyTree,
|
|
803
|
+
title: F.networkDependencyTree,
|
|
804
|
+
jslog: "network-dependency-tree-widget"
|
|
805
|
+
},
|
|
806
|
+
[k.THIRD_PARTIES]: {
|
|
807
|
+
component: _n,
|
|
808
|
+
accessibleLabel: F.revealThirdParties,
|
|
809
|
+
title: F.thirdParties,
|
|
810
|
+
jslog: "third-parties-widget"
|
|
811
|
+
},
|
|
812
|
+
[k.FORCED_REFLOW]: {
|
|
813
|
+
component: In,
|
|
814
|
+
accessibleLabel: F.revealForcedReflow,
|
|
815
|
+
title: F.forcedReflow,
|
|
816
|
+
jslog: "forced-reflow-widget"
|
|
817
|
+
},
|
|
818
|
+
[k.CACHE]: {
|
|
819
|
+
component: An,
|
|
820
|
+
accessibleLabel: F.revealCache,
|
|
821
|
+
title: F.cache,
|
|
822
|
+
jslog: "cache-widget"
|
|
823
|
+
},
|
|
824
|
+
[k.INP_BREAKDOWN]: {
|
|
825
|
+
component: yn,
|
|
826
|
+
accessibleLabel: F.revealInpBreakdown,
|
|
827
|
+
title: F.inpBreakdown,
|
|
828
|
+
jslog: "inp-breakdown-widget"
|
|
829
|
+
},
|
|
830
|
+
[k.DOCUMENT_LATENCY]: {
|
|
831
|
+
component: Sn,
|
|
832
|
+
accessibleLabel: F.revealDocumentLatency,
|
|
833
|
+
title: F.documentLatency,
|
|
834
|
+
jslog: "document-latency-widget"
|
|
835
|
+
},
|
|
836
|
+
[k.DOM_SIZE]: {
|
|
837
|
+
component: Rn,
|
|
838
|
+
accessibleLabel: F.revealDomSize,
|
|
839
|
+
title: F.domSize,
|
|
840
|
+
jslog: "dom-size-widget"
|
|
841
|
+
},
|
|
842
|
+
[k.DUPLICATE_JAVASCRIPT]: {
|
|
843
|
+
component: kn,
|
|
844
|
+
accessibleLabel: F.revealDuplicateJavaScript,
|
|
845
|
+
title: F.duplicateJavaScript,
|
|
846
|
+
jslog: "duplicate-javascript-widget"
|
|
847
|
+
},
|
|
848
|
+
[k.IMAGE_DELIVERY]: {
|
|
849
|
+
component: Mn,
|
|
850
|
+
accessibleLabel: F.revealImageDelivery,
|
|
851
|
+
title: F.imageDelivery,
|
|
852
|
+
jslog: "image-delivery-widget"
|
|
853
|
+
},
|
|
854
|
+
[k.FONT_DISPLAY]: {
|
|
855
|
+
component: xn,
|
|
856
|
+
accessibleLabel: F.revealFontDisplay,
|
|
857
|
+
title: F.fontDisplay,
|
|
858
|
+
jslog: "font-display-widget"
|
|
859
|
+
},
|
|
860
|
+
[k.SLOW_CSS_SELECTOR]: {
|
|
861
|
+
component: pn,
|
|
862
|
+
accessibleLabel: F.revealSlowCssSelector,
|
|
863
|
+
title: F.slowCssSelector,
|
|
864
|
+
jslog: "slow-css-selector-widget"
|
|
865
|
+
},
|
|
866
|
+
[k.LEGACY_JAVASCRIPT]: {
|
|
867
|
+
component: jn,
|
|
868
|
+
accessibleLabel: F.revealLegacyJavaScript,
|
|
869
|
+
title: F.legacyJavaScript,
|
|
870
|
+
jslog: "legacy-javascript-widget"
|
|
871
|
+
},
|
|
872
|
+
[k.VIEWPORT]: {
|
|
873
|
+
component: hn,
|
|
874
|
+
accessibleLabel: F.revealViewport,
|
|
875
|
+
title: F.viewport,
|
|
876
|
+
jslog: "viewport-widget"
|
|
877
|
+
},
|
|
878
|
+
[k.MODERN_HTTP]: {
|
|
879
|
+
component: Ln,
|
|
880
|
+
accessibleLabel: F.revealModernHttp,
|
|
881
|
+
title: F.modernHttp,
|
|
882
|
+
jslog: "modern-http-widget"
|
|
883
|
+
},
|
|
884
|
+
[k.CHARACTER_SET]: {
|
|
885
|
+
component: Pn,
|
|
886
|
+
accessibleLabel: F.revealCharacterSet,
|
|
887
|
+
title: F.characterSet,
|
|
888
|
+
jslog: "character-set-widget"
|
|
889
|
+
}
|
|
890
|
+
};
|
|
891
|
+
function Br(e, t, n, r, i, a) {
|
|
892
|
+
return {
|
|
893
|
+
renderedWidget: M`<devtools-widget
|
|
894
|
+
class=${n}
|
|
895
|
+
${P(e, {
|
|
896
|
+
model: t,
|
|
897
|
+
minimal: !0,
|
|
898
|
+
bounds: a ?? null
|
|
899
|
+
})}></devtools-widget>`,
|
|
900
|
+
revealable: new zn(t),
|
|
901
|
+
accessibleRevealLabel: N(r),
|
|
902
|
+
title: N(i),
|
|
903
|
+
jslogContext: n
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
async function Vr(e) {
|
|
907
|
+
let t = e.data.insight, n = e.data.insightData, r = zr[t];
|
|
908
|
+
if (!r) return null;
|
|
909
|
+
let i;
|
|
910
|
+
if (t === k.CLS_CULPRITS) {
|
|
911
|
+
let e = rn.instance().state()?.micro.entireTraceBounds;
|
|
912
|
+
if (!e) return null;
|
|
913
|
+
i = e;
|
|
914
|
+
}
|
|
915
|
+
return Br(r.component, n, r.jslog, r.accessibleLabel, r.title, i);
|
|
916
|
+
}
|
|
917
|
+
async function Hr(e) {
|
|
918
|
+
let t = Bt.mainThreadActivityBottomUp(e.data.bounds, e.data.parsedTrace);
|
|
919
|
+
if (!t) return null;
|
|
920
|
+
let n = t.events, r = Ut(e.data.bounds.min), i = Ut(e.data.bounds.max);
|
|
921
|
+
return {
|
|
922
|
+
renderedWidget: M`<devtools-widget
|
|
923
|
+
class="bottom-up-timeline-tree-widget"
|
|
924
|
+
${P(Tn, {
|
|
925
|
+
selectedEvents: n,
|
|
926
|
+
parsedTrace: e.data.parsedTrace,
|
|
927
|
+
startTime: r,
|
|
928
|
+
endTime: i,
|
|
929
|
+
compactMode: !0,
|
|
930
|
+
maxLinkLength: 15,
|
|
931
|
+
maxRows: 10
|
|
932
|
+
})}></devtools-widget>`,
|
|
933
|
+
revealable: new En(e.data.bounds),
|
|
934
|
+
accessibleRevealLabel: N(F.revealBottomUpTree),
|
|
935
|
+
title: N(F.bottomUpTree),
|
|
936
|
+
jslogContext: "bottom-up"
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
function Ur(e) {
|
|
940
|
+
if (e === null) return v;
|
|
941
|
+
function t() {
|
|
942
|
+
e !== null && u(e?.revealable);
|
|
943
|
+
}
|
|
944
|
+
let n = g({
|
|
945
|
+
"widget-and-revealer-container": !0,
|
|
946
|
+
"revealer-only": e.renderedWidget === null
|
|
947
|
+
}), r = M`
|
|
948
|
+
<devtools-button class="widget-reveal-button"
|
|
949
|
+
.variant=${f.TEXT}
|
|
950
|
+
.accessibleLabel=${e.accessibleRevealLabel}
|
|
951
|
+
.jslogContext=${"reveal"}
|
|
952
|
+
@click=${t}
|
|
953
|
+
>
|
|
954
|
+
${e.customRevealTitle ?? N(F.reveal)}
|
|
955
|
+
<devtools-icon name='tab-move'></devtools-icon>
|
|
956
|
+
</devtools-button>
|
|
957
|
+
`;
|
|
958
|
+
return M`
|
|
959
|
+
<div class=${n} jslog=${vr(e.jslogContext ? C(e.jslogContext) : void 0)}>
|
|
960
|
+
${e.title ? M`
|
|
961
|
+
<div class="widget-header">
|
|
962
|
+
<h4 class="widget-name">${e.title}</h4>
|
|
963
|
+
<div class="widget-reveal-container">
|
|
964
|
+
${r}
|
|
965
|
+
</div>
|
|
966
|
+
</div>
|
|
967
|
+
` : v}
|
|
968
|
+
${e.renderedWidget ? M`
|
|
969
|
+
<div class="widget-content-container">
|
|
970
|
+
${e.renderedWidget}
|
|
971
|
+
</div>` : v}
|
|
972
|
+
${e.title ? v : M`
|
|
973
|
+
<div class="widget-reveal-container">
|
|
974
|
+
${r}
|
|
975
|
+
</div>
|
|
976
|
+
`}
|
|
977
|
+
</div>
|
|
978
|
+
`;
|
|
979
|
+
}
|
|
980
|
+
async function Wr(e) {
|
|
981
|
+
let t = N(F.revealTrace);
|
|
982
|
+
return {
|
|
983
|
+
renderedWidget: null,
|
|
984
|
+
title: null,
|
|
985
|
+
revealable: new Bn(e.data.parsedTrace),
|
|
986
|
+
customRevealTitle: t,
|
|
987
|
+
accessibleRevealLabel: t,
|
|
988
|
+
jslogContext: "performance-trace"
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
async function Gr(e) {
|
|
992
|
+
let t = e.data.uiSourceCode, n = l(`Show ${t.name()}`);
|
|
993
|
+
return {
|
|
994
|
+
renderedWidget: null,
|
|
995
|
+
title: null,
|
|
996
|
+
revealable: t,
|
|
997
|
+
customRevealTitle: n,
|
|
998
|
+
accessibleRevealLabel: n,
|
|
999
|
+
jslogContext: "source-file-widget"
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
function Kr(e) {
|
|
1003
|
+
let t = e.url.split("/").pop() || e.url, n = o(e.size), r = i[e.resourceType], { iconName: a, color: s } = nn.iconDataForResourceType(r), c = e.imageContent?.asImagePreviewUrl();
|
|
1004
|
+
return M`
|
|
1005
|
+
<div class="network-request-preview">
|
|
1006
|
+
<div class="network-request-header">
|
|
1007
|
+
<div class="network-request-icon">
|
|
1008
|
+
${r.isImage() && c ? M`<img src=${c} alt=${t} />` : M`<devtools-icon name=${a} style=${he({ color: s ?? "" })}></devtools-icon>`}
|
|
1009
|
+
</div>
|
|
1010
|
+
<div class="network-request-details">
|
|
1011
|
+
<div class="network-request-name" title=${e.url}>${t}</div>
|
|
1012
|
+
<div class="network-request-size">${n}</div>
|
|
1013
|
+
</div>
|
|
1014
|
+
</div>
|
|
1015
|
+
</div>
|
|
1016
|
+
`;
|
|
1017
|
+
}
|
|
1018
|
+
async function qr(e) {
|
|
1019
|
+
let t = e.data.root;
|
|
1020
|
+
if (!(t instanceof Ne)) return null;
|
|
1021
|
+
let n = e.data.networkRequest;
|
|
1022
|
+
return {
|
|
1023
|
+
renderedWidget: M`
|
|
1024
|
+
${n ? Kr(n) : v}
|
|
1025
|
+
<devtools-widget class="dom-tree-widget" ${P(Qt, {
|
|
1026
|
+
maxTreeDepth: 2,
|
|
1027
|
+
enableContextMenu: !1,
|
|
1028
|
+
showComments: !1,
|
|
1029
|
+
showAIButton: !1,
|
|
1030
|
+
disableEdits: !0,
|
|
1031
|
+
expandRoot: !0,
|
|
1032
|
+
rootDOMNode: t,
|
|
1033
|
+
visibleWidth: 400,
|
|
1034
|
+
wrap: !0,
|
|
1035
|
+
maxRows: 10
|
|
1036
|
+
})}></devtools-widget>
|
|
1037
|
+
`,
|
|
1038
|
+
revealable: new We(t.domModel().target(), t.backendNodeId()),
|
|
1039
|
+
accessibleRevealLabel: N(F.revealLcpElement),
|
|
1040
|
+
title: N(F.lcpElement),
|
|
1041
|
+
jslogContext: "dom-snapshot"
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
function Jr(e) {
|
|
1045
|
+
switch (e.name) {
|
|
1046
|
+
case "COMPUTED_STYLES": return `${e.name}:${e.data.backendNodeId}`;
|
|
1047
|
+
case "CORE_VITALS": return `${e.name}:${e.data.insightSetKey}`;
|
|
1048
|
+
case "STYLE_PROPERTIES": return `${e.name}:${e.data.backendNodeId}:${e.data.selector ?? ""}`;
|
|
1049
|
+
case "DOM_TREE": return `${e.name}:${e.data.root.backendNodeId()}`;
|
|
1050
|
+
case "PERFORMANCE_TRACE": return `${e.name}`;
|
|
1051
|
+
case "PERF_INSIGHT": return `${e.name}:${e.data.insight}:${e.data.insightData.insightKey}:${e.data.insightData.navigation?.args?.data?.navigationId ?? "no-nav-id"}`;
|
|
1052
|
+
case "TIMELINE_RANGE_SUMMARY": return `${e.name}:${e.data.track}:${e.data.bounds.min}-${e.data.bounds.max}`;
|
|
1053
|
+
case "BOTTOM_UP_TREE": return `${e.name}:${e.data.bounds.min}-${e.data.bounds.max}`;
|
|
1054
|
+
case "SOURCE_FILE": return `${e.name}:${e.data.uiSourceCode.url()}`;
|
|
1055
|
+
case "LIGHTHOUSE_REPORT": return `${e.name}:${e.data.report.fetchTime}`;
|
|
1056
|
+
case "TIMELINE_EVENT_SUMMARY": return `${e.name}:${e.data.event.ts}:${e.data.event.name}`;
|
|
1057
|
+
case "NETWORK_REQUEST_GENERAL_HEADERS": return `${e.name}:${e.data.request.requestId()}`;
|
|
1058
|
+
default: r(e, "Unknown AiWidget name");
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
function Yr(e) {
|
|
1062
|
+
let t = /* @__PURE__ */ new Set(), n = (e) => e.filter((e) => {
|
|
1063
|
+
let n = Jr(e);
|
|
1064
|
+
return t.has(n) ? !1 : (t.add(n), !0);
|
|
1065
|
+
}), r = e.parts.map((e) => e.type === "widget" ? {
|
|
1066
|
+
...e,
|
|
1067
|
+
widgets: n(e.widgets)
|
|
1068
|
+
} : e.type === "step" && e.step.widgets ? {
|
|
1069
|
+
...e,
|
|
1070
|
+
step: {
|
|
1071
|
+
...e.step,
|
|
1072
|
+
widgets: n(e.step.widgets)
|
|
1073
|
+
}
|
|
1074
|
+
} : e);
|
|
1075
|
+
return {
|
|
1076
|
+
...e,
|
|
1077
|
+
parts: r
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
async function Xr(e, t = {}) {
|
|
1081
|
+
if (!d.devToolsAiAssistanceV2?.enabled || !e || e.length === 0) return v;
|
|
1082
|
+
let n = await Promise.all(e.map(async (e) => {
|
|
1083
|
+
let t = null;
|
|
1084
|
+
switch (e.name) {
|
|
1085
|
+
case "COMPUTED_STYLES":
|
|
1086
|
+
t = await Ir(e);
|
|
1087
|
+
break;
|
|
1088
|
+
case "CORE_VITALS":
|
|
1089
|
+
t = await Lr(e);
|
|
1090
|
+
break;
|
|
1091
|
+
case "STYLE_PROPERTIES":
|
|
1092
|
+
t = await Rr(e);
|
|
1093
|
+
break;
|
|
1094
|
+
case "DOM_TREE":
|
|
1095
|
+
t = await qr(e);
|
|
1096
|
+
break;
|
|
1097
|
+
case "PERFORMANCE_TRACE":
|
|
1098
|
+
t = await Wr(e);
|
|
1099
|
+
break;
|
|
1100
|
+
case "PERF_INSIGHT":
|
|
1101
|
+
t = await Vr(e);
|
|
1102
|
+
break;
|
|
1103
|
+
case "TIMELINE_RANGE_SUMMARY":
|
|
1104
|
+
t = await ni(e);
|
|
1105
|
+
break;
|
|
1106
|
+
case "BOTTOM_UP_TREE":
|
|
1107
|
+
t = await Hr(e);
|
|
1108
|
+
break;
|
|
1109
|
+
case "SOURCE_FILE":
|
|
1110
|
+
t = await Gr(e);
|
|
1111
|
+
break;
|
|
1112
|
+
case "LIGHTHOUSE_REPORT":
|
|
1113
|
+
t = await ri(e);
|
|
1114
|
+
break;
|
|
1115
|
+
case "TIMELINE_EVENT_SUMMARY":
|
|
1116
|
+
t = await ii(e);
|
|
1117
|
+
break;
|
|
1118
|
+
case "NETWORK_REQUEST_GENERAL_HEADERS":
|
|
1119
|
+
t = await ai(e);
|
|
1120
|
+
break;
|
|
1121
|
+
default: r(e, "Unknown AiWidget name");
|
|
1122
|
+
}
|
|
1123
|
+
return Ur(t);
|
|
1124
|
+
}));
|
|
1125
|
+
return t.wrapperClass ? M`<div class=${t.wrapperClass}>${n}</div>` : M`${n}`;
|
|
1126
|
+
}
|
|
1127
|
+
function Zr(e) {
|
|
1128
|
+
return e.requestApproval ? M`<div
|
|
1129
|
+
class="side-effect-confirmation"
|
|
1130
|
+
jslog=${C("side-effect-confirmation")}
|
|
1131
|
+
>
|
|
1132
|
+
${e.requestApproval.description ? M`<p>${e.requestApproval.description}</p>` : v}
|
|
1133
|
+
<div class="side-effect-buttons-container">
|
|
1134
|
+
<devtools-button
|
|
1135
|
+
.data=${{
|
|
1136
|
+
variant: f.OUTLINED,
|
|
1137
|
+
jslogContext: "decline-execute-code"
|
|
1138
|
+
}}
|
|
1139
|
+
@click=${() => e.requestApproval?.onAnswer(!1)}
|
|
1140
|
+
>${N(F.declineActionRequestApproval)}</devtools-button>
|
|
1141
|
+
<devtools-button
|
|
1142
|
+
.data=${{
|
|
1143
|
+
variant: f.PRIMARY,
|
|
1144
|
+
jslogContext: "accept-execute-code",
|
|
1145
|
+
iconName: "play"
|
|
1146
|
+
}}
|
|
1147
|
+
@click=${() => e.requestApproval?.onAnswer(!0)}
|
|
1148
|
+
>${N(F.confirmActionRequestApproval)}</devtools-button>
|
|
1149
|
+
</div>
|
|
1150
|
+
</div>` : v;
|
|
1151
|
+
}
|
|
1152
|
+
function Qr(e) {
|
|
1153
|
+
if (e.error) {
|
|
1154
|
+
let t;
|
|
1155
|
+
switch (e.error) {
|
|
1156
|
+
case It.UNKNOWN:
|
|
1157
|
+
case It.BLOCK:
|
|
1158
|
+
t = F.systemError;
|
|
1159
|
+
break;
|
|
1160
|
+
case It.MAX_STEPS:
|
|
1161
|
+
t = F.maxStepsError;
|
|
1162
|
+
break;
|
|
1163
|
+
case It.CROSS_ORIGIN:
|
|
1164
|
+
t = F.crossOriginError;
|
|
1165
|
+
break;
|
|
1166
|
+
case It.ABORT: return M`<p class="aborted" jslog=${C("aborted")}>${N(F.stoppedResponse)}</p>`;
|
|
1167
|
+
}
|
|
1168
|
+
return M`<p class="error" jslog=${C("error")}>${N(t)}</p>`;
|
|
1169
|
+
}
|
|
1170
|
+
return v;
|
|
1171
|
+
}
|
|
1172
|
+
function $r(e) {
|
|
1173
|
+
if (e.data === "") return M`<div class="unavailable-image" title=${F.imageUnavailable}>
|
|
1174
|
+
<devtools-icon name='file-image'></devtools-icon>
|
|
1175
|
+
</div>`;
|
|
1176
|
+
let t = `data:${e.mimeType};base64,${e.data}`;
|
|
1177
|
+
return M`<devtools-link
|
|
1178
|
+
class="image-link" title=${F.openImageInNewTab}
|
|
1179
|
+
href=${t}
|
|
1180
|
+
>
|
|
1181
|
+
<img src=${t} alt=${F.imageInputSentToTheModel} />
|
|
1182
|
+
</devtools-link>`;
|
|
1183
|
+
}
|
|
1184
|
+
function ei(e, t) {
|
|
1185
|
+
let n = d.devToolsAiAssistanceV2?.enabled;
|
|
1186
|
+
return M`
|
|
1187
|
+
<div class=${g({
|
|
1188
|
+
"ai-assistance-feedback-row": !0,
|
|
1189
|
+
"not-v2": !n
|
|
1190
|
+
})}>
|
|
1191
|
+
<div class="action-buttons">
|
|
1192
|
+
${e.showRateButtons ? M`
|
|
1193
|
+
<devtools-button
|
|
1194
|
+
.data=${{
|
|
1195
|
+
variant: f.ICON,
|
|
1196
|
+
size: _.SMALL,
|
|
1197
|
+
iconName: "thumb-up",
|
|
1198
|
+
toggledIconName: "thumb-up-filled",
|
|
1199
|
+
toggled: e.currentRating === Ge.POSITIVE,
|
|
1200
|
+
toggleType: xe.PRIMARY,
|
|
1201
|
+
title: N(F.thumbsUp),
|
|
1202
|
+
jslogContext: "thumbs-up"
|
|
1203
|
+
}}
|
|
1204
|
+
@click=${() => e.onRatingClick(Ge.POSITIVE)}
|
|
1205
|
+
></devtools-button>
|
|
1206
|
+
<devtools-button
|
|
1207
|
+
.data=${{
|
|
1208
|
+
variant: f.ICON,
|
|
1209
|
+
size: _.SMALL,
|
|
1210
|
+
iconName: "thumb-down",
|
|
1211
|
+
toggledIconName: "thumb-down-filled",
|
|
1212
|
+
toggled: e.currentRating === Ge.NEGATIVE,
|
|
1213
|
+
toggleType: xe.PRIMARY,
|
|
1214
|
+
title: N(F.thumbsDown),
|
|
1215
|
+
jslogContext: "thumbs-down"
|
|
1216
|
+
}}
|
|
1217
|
+
@click=${() => e.onRatingClick(Ge.NEGATIVE)}
|
|
1218
|
+
></devtools-button>
|
|
1219
|
+
${n ? v : M`<div class="vertical-separator"></div>`}
|
|
1220
|
+
` : v}
|
|
1221
|
+
<devtools-button
|
|
1222
|
+
.data=${{
|
|
1223
|
+
variant: f.ICON,
|
|
1224
|
+
size: _.SMALL,
|
|
1225
|
+
title: N(F.report),
|
|
1226
|
+
iconName: "report",
|
|
1227
|
+
jslogContext: "report"
|
|
1228
|
+
}}
|
|
1229
|
+
@click=${e.onReportClick}
|
|
1230
|
+
></devtools-button>
|
|
1231
|
+
${n ? v : M`
|
|
1232
|
+
<div class="vertical-separator"></div>
|
|
1233
|
+
<devtools-button
|
|
1234
|
+
.data=${{
|
|
1235
|
+
variant: f.ICON,
|
|
1236
|
+
size: _.SMALL,
|
|
1237
|
+
title: N(F.copyResponse),
|
|
1238
|
+
iconName: "copy",
|
|
1239
|
+
jslogContext: "copy-ai-response"
|
|
1240
|
+
}}
|
|
1241
|
+
aria-label=${N(F.copyResponse)}
|
|
1242
|
+
@click=${e.onCopyResponseClick}></devtools-button>
|
|
1243
|
+
`}
|
|
1244
|
+
${e.onExportClick && n && e.isLastMessage ? M`
|
|
1245
|
+
<devtools-button
|
|
1246
|
+
class="export-for-agents-button"
|
|
1247
|
+
.jslogContext=${"ai-export-for-agents"}
|
|
1248
|
+
.variant=${f.OUTLINED}
|
|
1249
|
+
.iconName=${"copy"}
|
|
1250
|
+
aria-label=${N(F.exportForAgents)}
|
|
1251
|
+
@click=${e.onExportClick}
|
|
1252
|
+
>${N(F.exportForAgents)}</devtools-button>
|
|
1253
|
+
${e.suggestions ? M`<div class="vertical-separator"></div>` : v}
|
|
1254
|
+
` : v}
|
|
1255
|
+
</div>
|
|
1256
|
+
${e.suggestions ? M`<div class="suggestions-container">
|
|
1257
|
+
<div class="scroll-button-container left hidden" ${_r((e) => {
|
|
1258
|
+
t.suggestionsLeftScrollButtonContainer = e;
|
|
1259
|
+
})}>
|
|
1260
|
+
<devtools-button
|
|
1261
|
+
class='scroll-button'
|
|
1262
|
+
.data=${{
|
|
1263
|
+
variant: f.ICON,
|
|
1264
|
+
size: _.SMALL,
|
|
1265
|
+
iconName: "chevron-left",
|
|
1266
|
+
title: N(F.scrollToPrevious),
|
|
1267
|
+
jslogContext: "chevron-left"
|
|
1268
|
+
}}
|
|
1269
|
+
@click=${() => e.scrollSuggestionsScrollContainer("left")}
|
|
1270
|
+
></devtools-button>
|
|
1271
|
+
</div>
|
|
1272
|
+
<div class="suggestions-scroll-container" @scroll=${e.onSuggestionsScrollOrResize} ${_r((e) => {
|
|
1273
|
+
t.suggestionsScrollContainer = e;
|
|
1274
|
+
})}>
|
|
1275
|
+
${e.suggestions.map((t) => M`<devtools-button
|
|
1276
|
+
class='suggestion'
|
|
1277
|
+
.data=${{
|
|
1278
|
+
variant: f.OUTLINED,
|
|
1279
|
+
title: t,
|
|
1280
|
+
jslogContext: "suggestion"
|
|
1281
|
+
}}
|
|
1282
|
+
@click=${() => e.onSuggestionClick(t)}
|
|
1283
|
+
>${t}</devtools-button>`)}
|
|
1284
|
+
</div>
|
|
1285
|
+
<div class="scroll-button-container right hidden" ${_r((e) => {
|
|
1286
|
+
t.suggestionsRightScrollButtonContainer = e;
|
|
1287
|
+
})}>
|
|
1288
|
+
<devtools-button
|
|
1289
|
+
class='scroll-button'
|
|
1290
|
+
.data=${{
|
|
1291
|
+
variant: f.ICON,
|
|
1292
|
+
size: _.SMALL,
|
|
1293
|
+
iconName: "chevron-right",
|
|
1294
|
+
title: N(F.scrollToNext),
|
|
1295
|
+
jslogContext: "chevron-right"
|
|
1296
|
+
}}
|
|
1297
|
+
@click=${() => e.scrollSuggestionsScrollContainer("right")}
|
|
1298
|
+
></devtools-button>
|
|
1299
|
+
</div>
|
|
1300
|
+
</div>` : v}
|
|
1301
|
+
</div>
|
|
1302
|
+
${e.isShowingFeedbackForm ? M`
|
|
1303
|
+
<form class="feedback-form" @submit=${e.onSubmit}>
|
|
1304
|
+
<div class="feedback-header">
|
|
1305
|
+
<h4 class="feedback-title">${N(F.whyThisRating)}</h4>
|
|
1306
|
+
<devtools-button
|
|
1307
|
+
aria-label=${N(F.close)}
|
|
1308
|
+
@click=${e.onClose}
|
|
1309
|
+
.data=${{
|
|
1310
|
+
variant: f.ICON,
|
|
1311
|
+
iconName: "cross",
|
|
1312
|
+
size: _.SMALL,
|
|
1313
|
+
title: N(F.close),
|
|
1314
|
+
jslogContext: "close"
|
|
1315
|
+
}}
|
|
1316
|
+
></devtools-button>
|
|
1317
|
+
</div>
|
|
1318
|
+
<input
|
|
1319
|
+
type="text"
|
|
1320
|
+
class="devtools-text-input feedback-input"
|
|
1321
|
+
@input=${(t) => e.onInputChange(t.target.value)}
|
|
1322
|
+
placeholder=${N(F.provideFeedbackPlaceholder)}
|
|
1323
|
+
jslog=${$e("feedback").track({ keydown: "Enter" })}
|
|
1324
|
+
>
|
|
1325
|
+
<span class="feedback-disclaimer">${N(F.disclaimer)}</span>
|
|
1326
|
+
<div>
|
|
1327
|
+
<devtools-button
|
|
1328
|
+
aria-label=${N(F.submit)}
|
|
1329
|
+
.data=${{
|
|
1330
|
+
type: "submit",
|
|
1331
|
+
disabled: e.isSubmitButtonDisabled,
|
|
1332
|
+
variant: f.OUTLINED,
|
|
1333
|
+
size: _.SMALL,
|
|
1334
|
+
title: N(F.submit),
|
|
1335
|
+
jslogContext: "send"
|
|
1336
|
+
}}
|
|
1337
|
+
>${N(F.submit)}</devtools-button>
|
|
1338
|
+
</div>
|
|
1339
|
+
</div>
|
|
1340
|
+
</form>
|
|
1341
|
+
` : v}
|
|
1342
|
+
`;
|
|
1343
|
+
}
|
|
1344
|
+
var ti = class extends Ue {
|
|
1345
|
+
message = {
|
|
1346
|
+
entity: "user",
|
|
1347
|
+
text: "",
|
|
1348
|
+
id: ""
|
|
1349
|
+
};
|
|
1350
|
+
isLoading = !1;
|
|
1351
|
+
isReadOnly = !1;
|
|
1352
|
+
prompt = "";
|
|
1353
|
+
canShowFeedbackForm = !1;
|
|
1354
|
+
isLastMessage = !1;
|
|
1355
|
+
isFirstMessage = !1;
|
|
1356
|
+
shouldShowCSSChangeSummary = !1;
|
|
1357
|
+
markdownRenderer;
|
|
1358
|
+
onSuggestionClick = () => {};
|
|
1359
|
+
onFeedbackSubmit = () => {};
|
|
1360
|
+
onCopyResponseClick = () => {};
|
|
1361
|
+
onExportClick = () => {};
|
|
1362
|
+
changeSummary;
|
|
1363
|
+
walkthrough = {
|
|
1364
|
+
onOpen: () => {},
|
|
1365
|
+
onToggle: () => {},
|
|
1366
|
+
isInlined: !1,
|
|
1367
|
+
isExpanded: !1,
|
|
1368
|
+
activeSidebarMessage: null,
|
|
1369
|
+
inlineExpandedMessages: []
|
|
1370
|
+
};
|
|
1371
|
+
#e = new ResizeObserver(() => this.#d());
|
|
1372
|
+
#t = new ne(100);
|
|
1373
|
+
#n = "";
|
|
1374
|
+
#r;
|
|
1375
|
+
#i = !1;
|
|
1376
|
+
#a = !0;
|
|
1377
|
+
#o;
|
|
1378
|
+
#s = {};
|
|
1379
|
+
#c = !1;
|
|
1380
|
+
constructor(e, t) {
|
|
1381
|
+
super(e), this.#o = t ?? Cr;
|
|
1382
|
+
}
|
|
1383
|
+
wasShown() {
|
|
1384
|
+
super.wasShown(), this.performUpdate(), this.#u();
|
|
1385
|
+
}
|
|
1386
|
+
performUpdate() {
|
|
1387
|
+
let e = this.message.entity === "model" ? Yr(this.message) : this.message;
|
|
1388
|
+
this.#o({
|
|
1389
|
+
message: e,
|
|
1390
|
+
isLoading: this.isLoading,
|
|
1391
|
+
isReadOnly: this.isReadOnly,
|
|
1392
|
+
canShowFeedbackForm: this.canShowFeedbackForm,
|
|
1393
|
+
markdownRenderer: this.markdownRenderer,
|
|
1394
|
+
isLastMessage: this.isLastMessage,
|
|
1395
|
+
isFirstMessage: this.isFirstMessage,
|
|
1396
|
+
prompt: this.prompt,
|
|
1397
|
+
shouldShowCSSChangeSummary: this.shouldShowCSSChangeSummary,
|
|
1398
|
+
onSuggestionClick: this.onSuggestionClick,
|
|
1399
|
+
onRatingClick: this.#p.bind(this),
|
|
1400
|
+
onReportClick: () => le(yr),
|
|
1401
|
+
onCopyResponseClick: () => {
|
|
1402
|
+
this.message.entity === "model" && this.onCopyResponseClick(this.message);
|
|
1403
|
+
},
|
|
1404
|
+
onExportClick: this.onExportClick,
|
|
1405
|
+
scrollSuggestionsScrollContainer: this.#f.bind(this),
|
|
1406
|
+
onSuggestionsScrollOrResize: this.#d.bind(this),
|
|
1407
|
+
onSubmit: this.#h.bind(this),
|
|
1408
|
+
onClose: this.#m.bind(this),
|
|
1409
|
+
onInputChange: this.#l.bind(this),
|
|
1410
|
+
isSubmitButtonDisabled: this.#a,
|
|
1411
|
+
showActions: !(this.isLastMessage && this.isLoading),
|
|
1412
|
+
showRateButtons: this.message.entity === "model" && !!this.message.rpcId,
|
|
1413
|
+
suggestions: this.isLastMessage && this.message.entity === "model" && !this.isReadOnly && this.message.parts.at(-1)?.type === "answer" ? this.message.parts.at(-1).suggestions : void 0,
|
|
1414
|
+
currentRating: this.#r,
|
|
1415
|
+
isShowingFeedbackForm: this.#i,
|
|
1416
|
+
onFeedbackSubmit: this.onFeedbackSubmit,
|
|
1417
|
+
changeSummary: this.changeSummary,
|
|
1418
|
+
walkthrough: this.walkthrough
|
|
1419
|
+
}, this.#s, this.contentElement), this.#s.suggestionsScrollContainer && !this.#c && (this.#e.observe(this.#s.suggestionsScrollContainer), this.#c = !0);
|
|
1420
|
+
}
|
|
1421
|
+
#l(e) {
|
|
1422
|
+
this.#n = e;
|
|
1423
|
+
let t = !e;
|
|
1424
|
+
t !== this.#a && (this.#a = t, this.performUpdate());
|
|
1425
|
+
}
|
|
1426
|
+
#u = () => {
|
|
1427
|
+
let e = this.#s.suggestionsScrollContainer, t = this.#s.suggestionsLeftScrollButtonContainer, n = this.#s.suggestionsRightScrollButtonContainer;
|
|
1428
|
+
if (!e || !t || !n) return;
|
|
1429
|
+
let r = e.scrollLeft > br, i = e.scrollLeft + e.offsetWidth + br < e.scrollWidth;
|
|
1430
|
+
t.classList.toggle("hidden", !r), n.classList.toggle("hidden", !i);
|
|
1431
|
+
};
|
|
1432
|
+
willHide() {
|
|
1433
|
+
super.willHide(), this.#e.disconnect(), this.#c = !1;
|
|
1434
|
+
}
|
|
1435
|
+
#d() {
|
|
1436
|
+
this.#t.schedule(() => (this.#u(), Promise.resolve()));
|
|
1437
|
+
}
|
|
1438
|
+
#f(e) {
|
|
1439
|
+
let t = this.#s.suggestionsScrollContainer;
|
|
1440
|
+
t && t.scroll({
|
|
1441
|
+
top: 0,
|
|
1442
|
+
left: e === "left" ? t.scrollLeft - t.clientWidth : t.scrollLeft + t.clientWidth,
|
|
1443
|
+
behavior: "smooth"
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
#p(e) {
|
|
1447
|
+
if (this.#r === e) {
|
|
1448
|
+
this.#r = void 0, this.#i = !1, this.#a = !0, this.message.entity === "model" && this.message.rpcId && this.onFeedbackSubmit(this.message.rpcId, Ge.SENTIMENT_UNSPECIFIED), this.performUpdate();
|
|
1449
|
+
return;
|
|
1450
|
+
}
|
|
1451
|
+
this.#r = e, this.#i = this.canShowFeedbackForm, this.message.entity === "model" && this.message.rpcId && this.onFeedbackSubmit(this.message.rpcId, e), this.performUpdate();
|
|
1452
|
+
}
|
|
1453
|
+
#m() {
|
|
1454
|
+
this.#i = !1, this.#a = !0, this.performUpdate();
|
|
1455
|
+
}
|
|
1456
|
+
#h(e) {
|
|
1457
|
+
e.preventDefault();
|
|
1458
|
+
let t = this.#n;
|
|
1459
|
+
!this.#r || !t || (this.message.entity === "model" && this.message.rpcId && this.onFeedbackSubmit(this.message.rpcId, this.#r, t), this.#i = !1, this.#a = !0, this.performUpdate());
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
async function ni(e) {
|
|
1463
|
+
let { bounds: t, parsedTrace: n, track: r } = e.data, i = [];
|
|
1464
|
+
if (r === "main") {
|
|
1465
|
+
let e;
|
|
1466
|
+
for (let r of n.data.Meta.mainFrameNavigations) if (r.ts <= t.min) e = r.args.data?.navigationId;
|
|
1467
|
+
else break;
|
|
1468
|
+
let r = Bt.findMainThread(e, n);
|
|
1469
|
+
r && (i = r.entries, Mt("TimelineRangeSummaryAiWidget found main thread. PID:", r.pid, "TID:", r.tid, "Number of entries:", r.entries.length));
|
|
1470
|
+
}
|
|
1471
|
+
if (!i) return Mt("Warning: could not find events for TimelineRangeSummaryAiWidget", e), null;
|
|
1472
|
+
let a = new Nn(), o = Wt.getOrCreate(n);
|
|
1473
|
+
return a.model = {
|
|
1474
|
+
selectedEvents: i,
|
|
1475
|
+
parsedTrace: n,
|
|
1476
|
+
entityMapper: o
|
|
1477
|
+
}, a.activeSelection = fn(t.min, t.max), a.refreshTree(!0), {
|
|
1478
|
+
renderedWidget: M`
|
|
1479
|
+
<devtools-widget
|
|
1480
|
+
${P(dn, { data: {
|
|
1481
|
+
parsedTrace: n,
|
|
1482
|
+
events: i,
|
|
1483
|
+
isInAIWidget: !0,
|
|
1484
|
+
startTime: Ut(t.min),
|
|
1485
|
+
endTime: Ut(t.max),
|
|
1486
|
+
thirdPartyTreeTemplate: M`${P(Nn, {
|
|
1487
|
+
maxRows: 10,
|
|
1488
|
+
isInAIWidget: !0,
|
|
1489
|
+
model: {
|
|
1490
|
+
selectedEvents: a.selectedEvents ?? null,
|
|
1491
|
+
parsedTrace: n,
|
|
1492
|
+
entityMapper: a.entityMapper()
|
|
1493
|
+
},
|
|
1494
|
+
activeSelection: { bounds: t },
|
|
1495
|
+
onBottomUpButtonClicked: (e) => {
|
|
1496
|
+
u(new En(t, e ?? void 0));
|
|
1497
|
+
}
|
|
1498
|
+
})}`
|
|
1499
|
+
} })}
|
|
1500
|
+
></devtools-widget>`,
|
|
1501
|
+
revealable: new Vn(t),
|
|
1502
|
+
accessibleRevealLabel: N(F.revealPerformanceSummary),
|
|
1503
|
+
title: N(F.performanceSummary),
|
|
1504
|
+
jslogContext: "timeline-range-summary"
|
|
1505
|
+
};
|
|
1506
|
+
}
|
|
1507
|
+
async function ri(e) {
|
|
1508
|
+
let t = an.renderLighthouseScores(e.data.report);
|
|
1509
|
+
if (!t) return null;
|
|
1510
|
+
let n = e.data.snapshotReport;
|
|
1511
|
+
return {
|
|
1512
|
+
renderedWidget: M`<div class="lighthouse-report-widget">${t}</div>`,
|
|
1513
|
+
revealable: new sn(e.data.report),
|
|
1514
|
+
accessibleRevealLabel: N(F.revealLighthouse),
|
|
1515
|
+
title: N(F.lighthouseReport),
|
|
1516
|
+
jslogContext: n ? "lighthouse-snapshot-report-widget" : "lighthouse-report-widget"
|
|
1517
|
+
};
|
|
1518
|
+
}
|
|
1519
|
+
async function ii(e) {
|
|
1520
|
+
return {
|
|
1521
|
+
renderedWidget: M`<devtools-widget class="timeline-event-summary-widget" ${P(() => On.makeEventWidget(e.data.event, e.data.parsedTrace))}></devtools-widget>`,
|
|
1522
|
+
revealable: new Xe(e.data.event),
|
|
1523
|
+
accessibleRevealLabel: N(F.revealTimelineEventSummary),
|
|
1524
|
+
title: N(F.timelineEventSummary),
|
|
1525
|
+
jslogContext: "timeline-event-summary-widget"
|
|
1526
|
+
};
|
|
1527
|
+
}
|
|
1528
|
+
async function ai(e) {
|
|
1529
|
+
return {
|
|
1530
|
+
renderedWidget: M`<devtools-widget class="network-request-general-headers-widget" ${P(() => ln.createGeneralHeadersView(e.data.request))}></devtools-widget>`,
|
|
1531
|
+
revealable: Jt.tab(e.data.request, Yt.HEADERS_COMPONENT),
|
|
1532
|
+
accessibleRevealLabel: N(F.revealNetworkRequest),
|
|
1533
|
+
title: N(F.networkRequest),
|
|
1534
|
+
jslogContext: "network-request-general-headers-widget"
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
//#endregion
|
|
1538
|
+
//#region \0qilin-devtools:css:/home/runner/work/QiLin/QiLin/node_modules/.pnpm/chrome-devtools-frontend@1.0.1638082/node_modules/chrome-devtools-frontend/front_end/panels/ai_assistance/selectWorkspaceDialog.css.mjs
|
|
1539
|
+
var oi = "/*\n * Copyright 2025 The Chromium Authors\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n@scope to (devtools-widget > *) {\n :scope {\n width: 100%;\n box-shadow: none;\n }\n\n .dialog-header {\n margin: var(--sys-size-6) var(--sys-size-8) var(--sys-size-5);\n font: var(--sys-typescale-headline5);\n }\n\n .buttons {\n margin: var(--sys-size-6) var(--sys-size-8) var(--sys-size-8);\n display: flex;\n justify-content: flex-start;\n gap: var(--sys-size-5);\n }\n\n .main-content {\n color: var(--sys-color-on-surface-subtle);\n margin: 0 var(--sys-size-8);\n line-height: 18px;\n }\n\n .add-folder-button {\n margin-left: auto;\n }\n\n ul {\n list-style-type: none;\n padding: 0;\n margin: var(--sys-size-6) 0 var(--sys-size-4) 0;\n max-height: var(--sys-size-20);\n overflow-y: auto;\n }\n\n li {\n display: flex;\n align-items: center;\n color: var(--sys-color-on-surface-subtle);\n border-radius: 0 var(--sys-shape-corner-full) var(--sys-shape-corner-full) 0;\n height: var(--sys-size-10);\n margin: 0 var(--sys-size-8);\n padding-left: var(--sys-size-9);\n }\n\n li:hover, li.selected {\n background-color: var(--sys-color-state-hover-on-subtle);\n }\n\n li:focus {\n background-color: var(--app-color-navigation-drawer-background-selected);\n }\n\n .folder-icon {\n color: var(--icon-file-default);\n margin-right: var(--sys-size-4);\n }\n\n li.selected .folder-icon {\n color: var(--icon-file-authored);\n }\n\n .select-project-root {\n margin-bottom: var(--sys-size-6);\n }\n\n .theme-with-dark-background, :host-context(.theme-with-dark-background) {\n /*\n * List item is focused and selected: there is no valid state where the list item is focused but not selected.\n */\n li:focus {\n color: var(--app-color-navigation-drawer-label-selected);\n background-color: var(--app-color-navigation-drawer-background-selected);\n\n & .folder-icon {\n color: var(--app-color-navigation-drawer-label-selected);\n }\n }\n }\n\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n}\n", I = {
|
|
1540
|
+
selectFolder: "Select folder",
|
|
1541
|
+
selectFolderAccessibleLabel: "Select a folder to apply changes",
|
|
1542
|
+
cancel: "Cancel",
|
|
1543
|
+
select: "Select",
|
|
1544
|
+
addFolder: "Add folder",
|
|
1545
|
+
selectProjectRoot: "Source code from the selected folder is sent to Google. This data may be seen by human reviewers to improve this feature.",
|
|
1546
|
+
selectProjectRootNoLogging: "Source code from the selected folder is sent to Google. This data will not be used to improve Google’s AI models. Your organization may change these settings at any time."
|
|
1547
|
+
}, L = l, si = (e, t, n) => {
|
|
1548
|
+
let r = e.folders.length > 0;
|
|
1549
|
+
p(h`
|
|
1550
|
+
<style>${oi}</style>
|
|
1551
|
+
<h2 class="dialog-header">${L(I.selectFolder)}</h2>
|
|
1552
|
+
<div class="main-content">
|
|
1553
|
+
<div class="select-project-root">${e.selectProjectRootText}</div>
|
|
1554
|
+
${e.showAutomaticWorkspaceNudge ? h`
|
|
1555
|
+
<!-- Hardcoding, because there is no 'getFormatLocalizedString' equivalent for 'lockedString' -->
|
|
1556
|
+
<div>
|
|
1557
|
+
Tip: provide a
|
|
1558
|
+
<devtools-link
|
|
1559
|
+
class="devtools-link"
|
|
1560
|
+
href="https://goo.gle/devtools-automatic-workspace-folders"
|
|
1561
|
+
jslogcontext="automatic-workspaces-documentation"
|
|
1562
|
+
>com.chrome.devtools.json</devtools-link>
|
|
1563
|
+
file to automatically connect your project to DevTools.
|
|
1564
|
+
</div>
|
|
1565
|
+
` : v}
|
|
1566
|
+
</div>
|
|
1567
|
+
${r ? h`
|
|
1568
|
+
<ul role="listbox" aria-label=${L(I.selectFolder)}
|
|
1569
|
+
aria-activedescendant=${e.folders.length > 0 ? `option-${e.selectedIndex}` : ""}>
|
|
1570
|
+
${e.folders.map((t, n) => h`
|
|
1571
|
+
<li
|
|
1572
|
+
id=${`option-${n}`}
|
|
1573
|
+
@mousedown=${() => e.onProjectSelected(n)}
|
|
1574
|
+
@keydown=${e.onListItemKeyDown}
|
|
1575
|
+
class=${n === e.selectedIndex ? "selected" : ""}
|
|
1576
|
+
aria-selected=${n === e.selectedIndex ? "true" : "false"}
|
|
1577
|
+
title=${t.path}
|
|
1578
|
+
role="option"
|
|
1579
|
+
tabindex=${n === e.selectedIndex ? "0" : "-1"}
|
|
1580
|
+
>
|
|
1581
|
+
<devtools-icon class="folder-icon" name="folder"></devtools-icon>
|
|
1582
|
+
<span class="ellipsis">${t.name}</span>
|
|
1583
|
+
</li>`)}
|
|
1584
|
+
</ul>
|
|
1585
|
+
` : v}
|
|
1586
|
+
<div class="buttons">
|
|
1587
|
+
<devtools-button
|
|
1588
|
+
title=${L(I.cancel)}
|
|
1589
|
+
aria-label="Cancel"
|
|
1590
|
+
.jslogContext=${"cancel"}
|
|
1591
|
+
@click=${e.onCancelButtonClick}
|
|
1592
|
+
.variant=${f.OUTLINED}>${L(I.cancel)}</devtools-button>
|
|
1593
|
+
<devtools-button
|
|
1594
|
+
class="add-folder-button"
|
|
1595
|
+
title=${L(I.addFolder)}
|
|
1596
|
+
aria-label="Add folder"
|
|
1597
|
+
.iconName=${"plus"}
|
|
1598
|
+
.jslogContext=${"add-folder"}
|
|
1599
|
+
@click=${e.onAddFolderButtonClick}
|
|
1600
|
+
.variant=${r ? f.TONAL : f.PRIMARY}>${L(I.addFolder)}</devtools-button>
|
|
1601
|
+
${r ? h`
|
|
1602
|
+
<devtools-button
|
|
1603
|
+
title=${L(I.select)}
|
|
1604
|
+
aria-label="Select"
|
|
1605
|
+
@click=${e.onSelectButtonClick}
|
|
1606
|
+
.jslogContext=${"select"}
|
|
1607
|
+
.variant=${f.PRIMARY}>${L(I.select)}</devtools-button>
|
|
1608
|
+
` : v}
|
|
1609
|
+
</div>
|
|
1610
|
+
`, n);
|
|
1611
|
+
}, ci = class e extends Fe {
|
|
1612
|
+
#e;
|
|
1613
|
+
#t = st.instance();
|
|
1614
|
+
#n = 0;
|
|
1615
|
+
#r;
|
|
1616
|
+
#i;
|
|
1617
|
+
#a = kt.instance();
|
|
1618
|
+
#o = [];
|
|
1619
|
+
constructor(e, t) {
|
|
1620
|
+
super(), this.#r = e.onProjectSelected, this.#i = e.dialog, this.#d(), e.currentProject && (this.#n = Math.max(0, this.#o.findIndex((t) => t.project === e.currentProject))), this.#e = t ?? si, this.requestUpdate(), this.updateComplete.then(() => {
|
|
1621
|
+
this.contentElement?.querySelector(".selected")?.focus();
|
|
1622
|
+
});
|
|
1623
|
+
}
|
|
1624
|
+
wasShown() {
|
|
1625
|
+
super.wasShown(), this.#t.addEventListener(E.ProjectAdded, this.#f, this), this.#t.addEventListener(E.ProjectRemoved, this.#p, this);
|
|
1626
|
+
}
|
|
1627
|
+
willHide() {
|
|
1628
|
+
super.willHide(), this.#t.removeEventListener(E.ProjectAdded, this.#f, this), this.#t.removeEventListener(E.ProjectRemoved, this.#p, this);
|
|
1629
|
+
}
|
|
1630
|
+
#s(e) {
|
|
1631
|
+
switch (e.key) {
|
|
1632
|
+
case "ArrowDown": {
|
|
1633
|
+
e.preventDefault(), this.#n = Math.min(this.#n + 1, this.#o.length - 1);
|
|
1634
|
+
let t = this.contentElement.querySelectorAll("li")[this.#n];
|
|
1635
|
+
t?.scrollIntoView({
|
|
1636
|
+
block: "nearest",
|
|
1637
|
+
inline: "nearest"
|
|
1638
|
+
}), t?.focus({ preventScroll: !0 }), this.requestUpdate();
|
|
1639
|
+
break;
|
|
1640
|
+
}
|
|
1641
|
+
case "ArrowUp": {
|
|
1642
|
+
e.preventDefault(), this.#n = Math.max(this.#n - 1, 0);
|
|
1643
|
+
let t = this.contentElement.querySelectorAll("li")[this.#n];
|
|
1644
|
+
t?.scrollIntoView({
|
|
1645
|
+
block: "nearest",
|
|
1646
|
+
inline: "nearest"
|
|
1647
|
+
}), t?.focus({ preventScroll: !0 }), this.requestUpdate();
|
|
1648
|
+
break;
|
|
1649
|
+
}
|
|
1650
|
+
case "Enter":
|
|
1651
|
+
e.preventDefault(), this.#c();
|
|
1652
|
+
break;
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
#c() {
|
|
1656
|
+
let e = this.#o[this.#n];
|
|
1657
|
+
e.project ? (this.#i.hide(), this.#r(e.project)) : this.#u();
|
|
1658
|
+
}
|
|
1659
|
+
performUpdate() {
|
|
1660
|
+
let e = d.aidaAvailability?.enterprisePolicyValue !== ae.ALLOW_WITHOUT_LOGGING, t = {
|
|
1661
|
+
folders: this.#o,
|
|
1662
|
+
selectedIndex: this.#n,
|
|
1663
|
+
selectProjectRootText: L(e ? I.selectProjectRoot : I.selectProjectRootNoLogging),
|
|
1664
|
+
showAutomaticWorkspaceNudge: this.#a.automaticFileSystem === null && this.#a.availability === "available",
|
|
1665
|
+
onProjectSelected: (e) => {
|
|
1666
|
+
this.#n = e, this.requestUpdate();
|
|
1667
|
+
},
|
|
1668
|
+
onSelectButtonClick: this.#c.bind(this),
|
|
1669
|
+
onCancelButtonClick: () => {
|
|
1670
|
+
this.#i.hide();
|
|
1671
|
+
},
|
|
1672
|
+
onAddFolderButtonClick: () => {
|
|
1673
|
+
this.#l();
|
|
1674
|
+
},
|
|
1675
|
+
onListItemKeyDown: this.#s.bind(this)
|
|
1676
|
+
};
|
|
1677
|
+
this.#e(t, void 0, this.contentElement);
|
|
1678
|
+
}
|
|
1679
|
+
async #l() {
|
|
1680
|
+
await gt.instance().addFileSystem(), this.contentElement?.querySelector("[aria-label=\"Select\"]")?.shadowRoot?.querySelector("button")?.focus();
|
|
1681
|
+
}
|
|
1682
|
+
async #u() {
|
|
1683
|
+
await this.#a.connectAutomaticFileSystem(!0) || this.#i.hide();
|
|
1684
|
+
}
|
|
1685
|
+
#d() {
|
|
1686
|
+
this.#o = [];
|
|
1687
|
+
let e = this.#a.automaticFileSystem;
|
|
1688
|
+
e && this.#o.push({
|
|
1689
|
+
name: s.extractName(e.root),
|
|
1690
|
+
path: e.root,
|
|
1691
|
+
automaticFileSystem: e
|
|
1692
|
+
});
|
|
1693
|
+
let t = this.#t.projectsForType(at.FileSystem).filter((e) => e instanceof jt && e.fileSystem().type() === yt.WORKSPACE_PROJECT);
|
|
1694
|
+
for (let n of t) {
|
|
1695
|
+
if (e && n === this.#t.projectForFileSystemRoot(e.root)) {
|
|
1696
|
+
this.#o[0].project = n;
|
|
1697
|
+
continue;
|
|
1698
|
+
}
|
|
1699
|
+
this.#o.push({
|
|
1700
|
+
name: s.encodedPathToRawPathString(n.displayName()),
|
|
1701
|
+
path: s.urlToRawPathString(n.id(), ce()),
|
|
1702
|
+
project: n
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
#f(e) {
|
|
1707
|
+
let t = e.data, n = this.#a.automaticFileSystem;
|
|
1708
|
+
if (n && t === this.#t.projectForFileSystemRoot(n.root)) {
|
|
1709
|
+
this.#i.hide(), this.#r(t);
|
|
1710
|
+
return;
|
|
1711
|
+
}
|
|
1712
|
+
this.#d();
|
|
1713
|
+
let r = this.#o.findIndex((e) => e.project === t);
|
|
1714
|
+
r !== -1 && (this.#n = r), this.requestUpdate(), this.updateComplete.then(() => {
|
|
1715
|
+
this.contentElement?.querySelector(".selected")?.scrollIntoView();
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
#p() {
|
|
1719
|
+
let e = this.#n >= 0 && this.#n < this.#o.length ? this.#o[this.#n].project : null;
|
|
1720
|
+
if (this.#d(), e) {
|
|
1721
|
+
let t = this.#o.findIndex((t) => t.project === e);
|
|
1722
|
+
this.#n = t === -1 ? Math.min(this.#o.length - 1, this.#n) : t;
|
|
1723
|
+
} else this.#n = 0;
|
|
1724
|
+
this.requestUpdate();
|
|
1725
|
+
}
|
|
1726
|
+
static show(t, n) {
|
|
1727
|
+
let r = new de("select-workspace");
|
|
1728
|
+
r.setAriaLabel(I.selectFolderAccessibleLabel), r.setMaxContentSize(new et(384, 340)), r.setSizeBehavior(me.SET_EXACT_WIDTH_MAX_HEIGHT), r.setDimmed(!0), new e({
|
|
1729
|
+
dialog: r,
|
|
1730
|
+
onProjectSelected: t,
|
|
1731
|
+
currentProject: n
|
|
1732
|
+
}).show(r.contentElement), r.show();
|
|
1733
|
+
}
|
|
1734
|
+
}, li = /* @__PURE__ */ e({
|
|
1735
|
+
PatchSuggestionState: () => fi,
|
|
1736
|
+
PatchWidget: () => mi,
|
|
1737
|
+
isAiAssistancePatchingEnabled: () => hi
|
|
1738
|
+
}), R = {
|
|
1739
|
+
unsavedChanges: "Unsaved changes",
|
|
1740
|
+
applyingToWorkspace: "Applying to workspace…",
|
|
1741
|
+
applyToWorkspace: "Apply to workspace",
|
|
1742
|
+
change: "Change",
|
|
1743
|
+
changeRootFolder: "Change project root folder",
|
|
1744
|
+
cancel: "Cancel",
|
|
1745
|
+
discard: "Discard",
|
|
1746
|
+
saveAll: "Save all",
|
|
1747
|
+
savedToDisk: "Saved to disk",
|
|
1748
|
+
codeDisclaimer: "Use code snippets with caution",
|
|
1749
|
+
applyToWorkspaceTooltip: "Source code from the selected folder is sent to Google to generate code suggestions.",
|
|
1750
|
+
applyToWorkspaceTooltipNoLogging: "Source code from the selected folder is sent to Google to generate code suggestions. This data will not be used to improve Google’s AI models.",
|
|
1751
|
+
learnMore: "Learn more",
|
|
1752
|
+
freDisclaimerHeader: "Apply changes directly to your project’s source code",
|
|
1753
|
+
freDisclaimerTextAiWontAlwaysGetItRight: "This feature uses AI and won’t always get it right",
|
|
1754
|
+
freDisclaimerTextPrivacy: "To generate code suggestions, source code from the selected folder is sent to Google. This data may be seen by human reviewers to improve this feature.",
|
|
1755
|
+
freDisclaimerTextPrivacyNoLogging: "To generate code suggestions, source code from the selected folder is sent to Google. This data will not be used to improve Google’s AI models. Your organization may change these settings at any time.",
|
|
1756
|
+
freDisclaimerTextUseWithCaution: "Use generated code snippets with caution",
|
|
1757
|
+
viewUploadedFiles: "View data sent to Google",
|
|
1758
|
+
opensInNewTab: "(opens in a new tab)",
|
|
1759
|
+
genericErrorMessage: "Changes couldn’t be applied to your workspace."
|
|
1760
|
+
}, z = l, ui = "https://support.google.com/legal/answer/13505487", { widget: di } = Le, fi = /* @__PURE__ */ function(e) {
|
|
1761
|
+
return e.INITIAL = "initial", e.LOADING = "loading", e.SUCCESS = "success", e.ERROR = "error", e;
|
|
1762
|
+
}({}), pi = (e, t, n) => {
|
|
1763
|
+
if (!e.changeSummary && e.patchSuggestionState === "initial") return;
|
|
1764
|
+
t.changeRef = t.changeRef ?? we(), t.summaryRef = t.summaryRef ?? we();
|
|
1765
|
+
function r() {
|
|
1766
|
+
return e.sources ? h`<devtools-link
|
|
1767
|
+
class="link"
|
|
1768
|
+
title="${R.viewUploadedFiles} ${R.opensInNewTab}"
|
|
1769
|
+
href="data:text/plain;charset=utf-8,${encodeURIComponent(e.sources)}"
|
|
1770
|
+
jslogcontext="files-used-in-patching">
|
|
1771
|
+
${R.viewUploadedFiles}
|
|
1772
|
+
</devtools-link>` : v;
|
|
1773
|
+
}
|
|
1774
|
+
function i() {
|
|
1775
|
+
return e.savedToDisk ? h`
|
|
1776
|
+
<devtools-icon class="green-bright-icon summary-badge" name="check-circle"></devtools-icon>
|
|
1777
|
+
<span class="header-text">
|
|
1778
|
+
${z(R.savedToDisk)}
|
|
1779
|
+
</span>
|
|
1780
|
+
` : e.patchSuggestionState === "success" ? h`
|
|
1781
|
+
<devtools-icon class="on-tonal-icon summary-badge" name="difference"></devtools-icon>
|
|
1782
|
+
<span class="header-text">
|
|
1783
|
+
${z(`File changes in ${e.projectName}`)}
|
|
1784
|
+
</span>
|
|
1785
|
+
<devtools-icon
|
|
1786
|
+
class="arrow"
|
|
1787
|
+
name="chevron-down"
|
|
1788
|
+
></devtools-icon>
|
|
1789
|
+
` : h`
|
|
1790
|
+
<devtools-icon class="on-tonal-icon summary-badge" name="pen-spark"></devtools-icon>
|
|
1791
|
+
<span class="header-text">
|
|
1792
|
+
${z(R.unsavedChanges)}
|
|
1793
|
+
</span>
|
|
1794
|
+
<devtools-icon
|
|
1795
|
+
class="arrow"
|
|
1796
|
+
name="chevron-down"
|
|
1797
|
+
></devtools-icon>
|
|
1798
|
+
`;
|
|
1799
|
+
}
|
|
1800
|
+
function a() {
|
|
1801
|
+
return !e.changeSummary && e.patchSuggestionState === "initial" || e.savedToDisk ? v : e.patchSuggestionState === "success" ? h`${di(Wn, {
|
|
1802
|
+
workspaceDiff: e.workspaceDiff,
|
|
1803
|
+
ignoredUrls: ["inspector://"]
|
|
1804
|
+
})}` : h`<devtools-code-block
|
|
1805
|
+
.code=${e.changeSummary ?? ""}
|
|
1806
|
+
.codeLang=${"css"}
|
|
1807
|
+
.displayNotice=${!0}
|
|
1808
|
+
></devtools-code-block>
|
|
1809
|
+
${e.patchSuggestionState === "error" ? h`<div class="error-container">
|
|
1810
|
+
<devtools-icon name="cross-circle-filled"></devtools-icon>${z(R.genericErrorMessage)} ${r()}
|
|
1811
|
+
</div>` : v}`;
|
|
1812
|
+
}
|
|
1813
|
+
function o() {
|
|
1814
|
+
if (e.savedToDisk) return v;
|
|
1815
|
+
if (e.patchSuggestionState === "success") return h`
|
|
1816
|
+
<div class="footer">
|
|
1817
|
+
<div class="left-side">
|
|
1818
|
+
<devtools-link class="link disclaimer-link" href="https://support.google.com/legal/answer/13505487" jslogcontext="code-disclaimer">
|
|
1819
|
+
${z(R.codeDisclaimer)}
|
|
1820
|
+
</devtools-link>
|
|
1821
|
+
${r()}
|
|
1822
|
+
</div>
|
|
1823
|
+
<div class="save-or-discard-buttons">
|
|
1824
|
+
<devtools-button
|
|
1825
|
+
@click=${e.onDiscard}
|
|
1826
|
+
.jslogContext=${"patch-widget.discard"}
|
|
1827
|
+
.variant=${f.OUTLINED}>
|
|
1828
|
+
${z(R.discard)}
|
|
1829
|
+
</devtools-button>
|
|
1830
|
+
<devtools-button
|
|
1831
|
+
@click=${e.onSaveAll}
|
|
1832
|
+
.jslogContext=${"patch-widget.save-all"}
|
|
1833
|
+
.variant=${f.PRIMARY}>
|
|
1834
|
+
${z(R.saveAll)}
|
|
1835
|
+
</devtools-button>
|
|
1836
|
+
</div>
|
|
1837
|
+
</div>
|
|
1838
|
+
`;
|
|
1839
|
+
let n = e.projectType === "automaticDisconnected" ? "folder-off" : e.projectType === "automaticConnected" ? "folder-asterisk" : "folder";
|
|
1840
|
+
return h`
|
|
1841
|
+
<div class="footer">
|
|
1842
|
+
${e.projectName ? h`
|
|
1843
|
+
<div class="change-workspace" jslog=${C("patch-widget.workspace")}>
|
|
1844
|
+
<devtools-icon .name=${n}></devtools-icon>
|
|
1845
|
+
<span class="folder-name" title=${e.projectPath}>${e.projectName}</span>
|
|
1846
|
+
${e.onChangeWorkspaceClick ? h`
|
|
1847
|
+
<devtools-button
|
|
1848
|
+
@click=${e.onChangeWorkspaceClick}
|
|
1849
|
+
.jslogContext=${"change-workspace"}
|
|
1850
|
+
.variant=${f.TEXT}
|
|
1851
|
+
.title=${z(R.changeRootFolder)}
|
|
1852
|
+
.disabled=${e.patchSuggestionState === "loading"}
|
|
1853
|
+
${je(t.changeRef)}
|
|
1854
|
+
>${z(R.change)}</devtools-button>
|
|
1855
|
+
` : v}
|
|
1856
|
+
</div>
|
|
1857
|
+
` : v}
|
|
1858
|
+
<div class="apply-to-workspace-container" aria-live="polite">
|
|
1859
|
+
${e.patchSuggestionState === "loading" ? h`
|
|
1860
|
+
<div class="loading-text-container" jslog=${C("patch-widget.apply-to-workspace-loading")}>
|
|
1861
|
+
<devtools-spinner></devtools-spinner>
|
|
1862
|
+
<span>
|
|
1863
|
+
${z(R.applyingToWorkspace)}
|
|
1864
|
+
</span>
|
|
1865
|
+
</div>
|
|
1866
|
+
` : h`
|
|
1867
|
+
<devtools-button
|
|
1868
|
+
@click=${e.onApplyToWorkspace}
|
|
1869
|
+
.jslogContext=${"patch-widget.apply-to-workspace"}
|
|
1870
|
+
.variant=${f.OUTLINED}>
|
|
1871
|
+
${z(R.applyToWorkspace)}
|
|
1872
|
+
</devtools-button>
|
|
1873
|
+
`}
|
|
1874
|
+
${e.patchSuggestionState === "loading" ? h`<devtools-button
|
|
1875
|
+
@click=${e.onCancel}
|
|
1876
|
+
.jslogContext=${"cancel"}
|
|
1877
|
+
.variant=${f.OUTLINED}>
|
|
1878
|
+
${z(R.cancel)}
|
|
1879
|
+
</devtools-button>` : v}
|
|
1880
|
+
<devtools-button
|
|
1881
|
+
aria-details="info-tooltip"
|
|
1882
|
+
.jslogContext=${"patch-widget.info-tooltip-trigger"}
|
|
1883
|
+
.iconName=${"info"}
|
|
1884
|
+
.variant=${f.ICON}
|
|
1885
|
+
></devtools-button>
|
|
1886
|
+
<devtools-tooltip
|
|
1887
|
+
id="info-tooltip"
|
|
1888
|
+
variant="rich"
|
|
1889
|
+
>
|
|
1890
|
+
<div class="info-tooltip-container">
|
|
1891
|
+
${e.applyToWorkspaceTooltipText}
|
|
1892
|
+
<button
|
|
1893
|
+
class="link tooltip-link"
|
|
1894
|
+
role="link"
|
|
1895
|
+
jslog=${nt("open-ai-settings").track({ click: !0 })}
|
|
1896
|
+
@click=${e.onLearnMoreTooltipClick}
|
|
1897
|
+
>${z(R.learnMore)}</button>
|
|
1898
|
+
</div>
|
|
1899
|
+
</devtools-tooltip>
|
|
1900
|
+
</div>
|
|
1901
|
+
</div>`;
|
|
1902
|
+
}
|
|
1903
|
+
p(e.savedToDisk ? h`
|
|
1904
|
+
<div class="change-summary saved-to-disk" role="status" aria-live="polite">
|
|
1905
|
+
<div class="header-container">
|
|
1906
|
+
${i()}
|
|
1907
|
+
</div>
|
|
1908
|
+
</div>` : h`
|
|
1909
|
+
<details class="change-summary" jslog=${C("patch-widget")}>
|
|
1910
|
+
<summary class="header-container" ${je(t.summaryRef)}>
|
|
1911
|
+
${i()}
|
|
1912
|
+
</summary>
|
|
1913
|
+
${a()}
|
|
1914
|
+
${o()}
|
|
1915
|
+
</details>
|
|
1916
|
+
`, n);
|
|
1917
|
+
}, mi = class extends Ue {
|
|
1918
|
+
changeSummary = "";
|
|
1919
|
+
changeManager;
|
|
1920
|
+
#e = te.instance().createSetting("ai-assistance-patching-fre-completed", !1);
|
|
1921
|
+
#t = te.instance().createSetting("ai-assistance-patching-selected-project-id", "");
|
|
1922
|
+
#n;
|
|
1923
|
+
#r = {};
|
|
1924
|
+
#i;
|
|
1925
|
+
#a;
|
|
1926
|
+
#o;
|
|
1927
|
+
#s;
|
|
1928
|
+
#c;
|
|
1929
|
+
#l;
|
|
1930
|
+
#u = "initial";
|
|
1931
|
+
#d = Un();
|
|
1932
|
+
#f = st.instance();
|
|
1933
|
+
#p = kt.instance().automaticFileSystem;
|
|
1934
|
+
#m = !1;
|
|
1935
|
+
#h = null;
|
|
1936
|
+
constructor(e, t = pi, n) {
|
|
1937
|
+
super(e), this.#i = n?.aidaClient ?? new pe(), this.#l = d.aidaAvailability?.enterprisePolicyValue !== ae.ALLOW_WITHOUT_LOGGING, this.#n = t, this.requestUpdate();
|
|
1938
|
+
}
|
|
1939
|
+
#g() {
|
|
1940
|
+
x.instance().showView("chrome-ai");
|
|
1941
|
+
}
|
|
1942
|
+
#_() {
|
|
1943
|
+
return this.#o ? {
|
|
1944
|
+
projectName: s.encodedPathToRawPathString(this.#o.displayName()),
|
|
1945
|
+
projectPath: s.urlToRawPathString(this.#o.id(), ce())
|
|
1946
|
+
} : this.#p ? {
|
|
1947
|
+
projectName: s.extractName(this.#p.root),
|
|
1948
|
+
projectPath: this.#p.root
|
|
1949
|
+
} : {
|
|
1950
|
+
projectName: "",
|
|
1951
|
+
projectPath: ""
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1954
|
+
#v() {
|
|
1955
|
+
let e = this.#p ? this.#f.projectForFileSystemRoot(this.#p.root) : null;
|
|
1956
|
+
return this.#f.projectsForType(at.FileSystem).filter((e) => e instanceof jt && e.fileSystem().type() === yt.WORKSPACE_PROJECT).filter((t) => t !== e).length > 0;
|
|
1957
|
+
}
|
|
1958
|
+
#y(e) {
|
|
1959
|
+
return this.#p && this.#p.root === e ? this.#o ? "automaticConnected" : "automaticDisconnected" : this.#o ? "none" : "regular";
|
|
1960
|
+
}
|
|
1961
|
+
performUpdate() {
|
|
1962
|
+
let { projectName: e, projectPath: t } = this.#_();
|
|
1963
|
+
this.#n({
|
|
1964
|
+
workspaceDiff: this.#d,
|
|
1965
|
+
changeSummary: this.changeSummary,
|
|
1966
|
+
patchSuggestionState: this.#u,
|
|
1967
|
+
sources: this.#s,
|
|
1968
|
+
projectName: e,
|
|
1969
|
+
projectPath: t,
|
|
1970
|
+
projectType: this.#y(t),
|
|
1971
|
+
savedToDisk: this.#c,
|
|
1972
|
+
applyToWorkspaceTooltipText: this.#l ? z(R.applyToWorkspaceTooltip) : z(R.applyToWorkspaceTooltipNoLogging),
|
|
1973
|
+
onLearnMoreTooltipClick: this.#g.bind(this),
|
|
1974
|
+
onApplyToWorkspace: this.#T.bind(this),
|
|
1975
|
+
onCancel: () => {
|
|
1976
|
+
this.#a?.abort();
|
|
1977
|
+
},
|
|
1978
|
+
onDiscard: this.#O.bind(this),
|
|
1979
|
+
onSaveAll: this.#k.bind(this),
|
|
1980
|
+
onChangeWorkspaceClick: this.#v() ? this.#w.bind(this, { applyPatch: !1 }) : void 0
|
|
1981
|
+
}, this.#r, this.contentElement);
|
|
1982
|
+
}
|
|
1983
|
+
wasShown() {
|
|
1984
|
+
super.wasShown(), this.#x(), hi() && (this.#f.addEventListener(E.ProjectAdded, this.#S, this), this.#f.addEventListener(E.ProjectRemoved, this.#C, this));
|
|
1985
|
+
}
|
|
1986
|
+
willHide() {
|
|
1987
|
+
super.willHide(), this.#m = !1, hi() && (this.#f.removeEventListener(E.ProjectAdded, this.#S, this), this.#f.removeEventListener(E.ProjectRemoved, this.#C, this));
|
|
1988
|
+
}
|
|
1989
|
+
async #b() {
|
|
1990
|
+
if (this.#e.get()) return !0;
|
|
1991
|
+
let e = ct(), t = await Dt.show({
|
|
1992
|
+
header: {
|
|
1993
|
+
iconName: e,
|
|
1994
|
+
text: z(R.freDisclaimerHeader)
|
|
1995
|
+
},
|
|
1996
|
+
reminderItems: [
|
|
1997
|
+
{
|
|
1998
|
+
iconName: "psychiatry",
|
|
1999
|
+
content: z(R.freDisclaimerTextAiWontAlwaysGetItRight)
|
|
2000
|
+
},
|
|
2001
|
+
{
|
|
2002
|
+
iconName: "google",
|
|
2003
|
+
content: this.#l ? z(R.freDisclaimerTextPrivacy) : z(R.freDisclaimerTextPrivacyNoLogging)
|
|
2004
|
+
},
|
|
2005
|
+
{
|
|
2006
|
+
iconName: "warning",
|
|
2007
|
+
content: h`<devtools-link
|
|
2008
|
+
href=${ui}
|
|
2009
|
+
class="link devtools-link"
|
|
2010
|
+
jslogcontext="code-snippets-explainer.patch-widget"
|
|
2011
|
+
>${z(R.freDisclaimerTextUseWithCaution)}</devtools-link>`
|
|
2012
|
+
}
|
|
2013
|
+
],
|
|
2014
|
+
onLearnMoreClick: () => {
|
|
2015
|
+
x.instance().showView("chrome-ai");
|
|
2016
|
+
},
|
|
2017
|
+
ariaLabel: z(R.freDisclaimerHeader),
|
|
2018
|
+
learnMoreButtonText: z(R.learnMore)
|
|
2019
|
+
});
|
|
2020
|
+
return t && this.#e.set(!0), t;
|
|
2021
|
+
}
|
|
2022
|
+
#x() {
|
|
2023
|
+
let e = this.#p ? this.#f.projectForFileSystemRoot(this.#p.root) : this.#f.project(this.#t.get());
|
|
2024
|
+
e ? this.#o = e : (this.#o = void 0, this.#t.set("")), this.requestUpdate();
|
|
2025
|
+
}
|
|
2026
|
+
#S(e) {
|
|
2027
|
+
let t = e.data;
|
|
2028
|
+
this.#m && this.#p && t === this.#f.projectForFileSystemRoot(this.#p.root) ? (this.#m = !1, this.#o = t, this.#D()) : this.#o === void 0 && this.#x();
|
|
2029
|
+
}
|
|
2030
|
+
#C() {
|
|
2031
|
+
this.#o && !this.#f.project(this.#o.id()) && (this.#t.set(""), this.#o = void 0, this.requestUpdate());
|
|
2032
|
+
}
|
|
2033
|
+
#w(e = { applyPatch: !1 }) {
|
|
2034
|
+
ci.show((t) => {
|
|
2035
|
+
this.#o = t, this.#t.set(t.id()), e.applyPatch ? this.#D() : (this.requestUpdate(), this.updateComplete.then(() => {
|
|
2036
|
+
this.contentElement?.querySelector(".apply-to-workspace-container devtools-button")?.shadowRoot?.querySelector("button")?.focus();
|
|
2037
|
+
}));
|
|
2038
|
+
}, this.#o);
|
|
2039
|
+
}
|
|
2040
|
+
async #T() {
|
|
2041
|
+
hi() && await this.#b() && (this.#o ? await this.#D() : this.#p ? (this.#m = !0, await kt.instance().connectAutomaticFileSystem(!0)) : this.#w({ applyPatch: !0 }));
|
|
2042
|
+
}
|
|
2043
|
+
get #E() {
|
|
2044
|
+
return this.#d.modifiedUISourceCodes().filter((e) => !e.url().startsWith("inspector://"));
|
|
2045
|
+
}
|
|
2046
|
+
async #D() {
|
|
2047
|
+
let e = this.changeSummary;
|
|
2048
|
+
if (!e) throw Error("Change summary does not exist");
|
|
2049
|
+
this.#u = "loading", this.#h = null, this.requestUpdate();
|
|
2050
|
+
let { response: t, processedFiles: n } = await this.#j(e);
|
|
2051
|
+
t && "rpcId" in t && t.rpcId && (this.#h = t.rpcId);
|
|
2052
|
+
let r = this.#E.length > 0;
|
|
2053
|
+
t?.type === D.ANSWER && r ? this.#u = "success" : t?.type === D.ERROR && t.error === It.ABORT ? this.#u = "initial" : this.#u = "error", this.#s = `Filenames in ${this.#o?.displayName()}.
|
|
2054
|
+
Files:
|
|
2055
|
+
${n.map((e) => `* ${e}`).join("\n")}`, this.requestUpdate(), this.#u === "success" && this.updateComplete.then(() => {
|
|
2056
|
+
this.#r.summaryRef?.value?.focus();
|
|
2057
|
+
});
|
|
2058
|
+
}
|
|
2059
|
+
#O() {
|
|
2060
|
+
for (let e of this.#E) e.resetWorkingCopy();
|
|
2061
|
+
this.#u = "initial", this.#s = void 0, this.changeManager?.popStashedChanges(), this.#A(Ge.NEGATIVE), this.requestUpdate(), this.updateComplete.then(() => {
|
|
2062
|
+
this.#r.changeRef?.value?.focus();
|
|
2063
|
+
});
|
|
2064
|
+
}
|
|
2065
|
+
#k() {
|
|
2066
|
+
for (let e of this.#E) e.commitWorkingCopy();
|
|
2067
|
+
this.changeManager?.stashChanges().then(() => {
|
|
2068
|
+
this.changeManager?.dropStashedChanges();
|
|
2069
|
+
}), this.#c = !0, this.#A(Ge.POSITIVE), this.requestUpdate();
|
|
2070
|
+
}
|
|
2071
|
+
#A(e) {
|
|
2072
|
+
this.#h && this.#i.registerClientEvent({
|
|
2073
|
+
corresponding_aida_rpc_global_id: this.#h,
|
|
2074
|
+
disable_user_content_logging: !0,
|
|
2075
|
+
do_conversation_client_event: { user_feedback: { sentiment: e } }
|
|
2076
|
+
});
|
|
2077
|
+
}
|
|
2078
|
+
async #j(e) {
|
|
2079
|
+
if (!this.#o) throw Error("Project does not exist");
|
|
2080
|
+
this.#a = new AbortController();
|
|
2081
|
+
let { responses: t, processedFiles: n } = await new Et({
|
|
2082
|
+
aidaClient: this.#i,
|
|
2083
|
+
serverSideLoggingEnabled: !1,
|
|
2084
|
+
project: this.#o
|
|
2085
|
+
}).applyChanges(e, { signal: this.#a.signal });
|
|
2086
|
+
return {
|
|
2087
|
+
response: t.at(-1),
|
|
2088
|
+
processedFiles: n
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
2091
|
+
};
|
|
2092
|
+
function hi() {
|
|
2093
|
+
return !!d.devToolsFreestyler?.patching;
|
|
2094
|
+
}
|
|
2095
|
+
window.aiAssistanceTestPatchPrompt = async (e, t, n) => {
|
|
2096
|
+
if (!hi()) return;
|
|
2097
|
+
let r = Un(), i = st.instance().projectsForType(at.FileSystem).filter((e) => e instanceof jt && e.fileSystem().type() === yt.WORKSPACE_PROJECT).find((t) => t.displayName() === e);
|
|
2098
|
+
if (!i) throw Error("project not found");
|
|
2099
|
+
let a = new Et({
|
|
2100
|
+
aidaClient: new pe(),
|
|
2101
|
+
serverSideLoggingEnabled: !1,
|
|
2102
|
+
project: i
|
|
2103
|
+
});
|
|
2104
|
+
try {
|
|
2105
|
+
let e = [], { processedFiles: r, responses: i } = await a.applyChanges(t);
|
|
2106
|
+
if (i.at(-1)?.type === D.ERROR) return {
|
|
2107
|
+
error: "failed to patch",
|
|
2108
|
+
debugInfo: {
|
|
2109
|
+
responses: i,
|
|
2110
|
+
processedFiles: r
|
|
2111
|
+
}
|
|
2112
|
+
};
|
|
2113
|
+
for (let t of r) {
|
|
2114
|
+
let r = n.find((e) => e.path === t);
|
|
2115
|
+
if (!r) {
|
|
2116
|
+
e.push(`Patched ${t} that was not expected`);
|
|
2117
|
+
break;
|
|
2118
|
+
}
|
|
2119
|
+
let i = await a.agentProject.readFile(t);
|
|
2120
|
+
if (!i) throw Error(`${t} has no content`);
|
|
2121
|
+
for (let n of r.matches) i.match(new RegExp(n, "gm")) || e.push({
|
|
2122
|
+
message: `Did not match ${n} in ${t}`,
|
|
2123
|
+
file: t,
|
|
2124
|
+
content: i
|
|
2125
|
+
});
|
|
2126
|
+
for (let n of r.doesNotMatch || []) i.match(new RegExp(n, "gm")) && e.push({
|
|
2127
|
+
message: `Unexpectedly matched ${n} in ${t}`,
|
|
2128
|
+
file: t,
|
|
2129
|
+
content: i
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
return {
|
|
2133
|
+
assertionFailures: e,
|
|
2134
|
+
debugInfo: {
|
|
2135
|
+
responses: i,
|
|
2136
|
+
processedFiles: r
|
|
2137
|
+
}
|
|
2138
|
+
};
|
|
2139
|
+
} finally {
|
|
2140
|
+
r.modifiedUISourceCodes().forEach((e) => {
|
|
2141
|
+
e.resetWorkingCopy();
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
};
|
|
2145
|
+
//#endregion
|
|
2146
|
+
//#region \0qilin-devtools:css:/home/runner/work/QiLin/QiLin/node_modules/.pnpm/chrome-devtools-frontend@1.0.1638082/node_modules/chrome-devtools-frontend/front_end/panels/ai_assistance/components/chatInput.css.mjs
|
|
2147
|
+
var gi = "/*\n * Copyright 2025 The Chromium Authors\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n* {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n:host {\n display: flex;\n flex-direction: column;\n}\n\n.input-form {\n display: flex;\n flex-direction: column;\n padding: 0 var(--sys-size-5) var(--sys-size-5) var(--sys-size-5);\n max-width: var(--sys-size-36);\n background-color: var(--sys-color-cdt-base-container);\n width: 100%;\n}\n\n.chat-readonly-container {\n display: flex;\n width: 100%;\n max-width: var(--sys-size-36);\n justify-content: center;\n align-items: center;\n background-color: var(--sys-color-surface3);\n font: var(--sys-typescale-body4-regular);\n padding: var(--sys-size-5) 0;\n border-radius: var(--sys-shape-corner-medium-small);\n margin-bottom: var(--sys-size-5);\n color: var(--sys-color-on-surface-subtle);\n}\n\n.chat-input-container {\n width: 100%;\n display: flex;\n position: relative;\n flex-direction: column;\n border: 1px solid var(--sys-color-neutral-outline);\n border-radius: var(--sys-shape-corner-small);\n\n &:focus-within {\n outline: 1px solid var(--sys-color-primary);\n border-color: var(--sys-color-primary);\n }\n\n &.disabled {\n background-color: var(--sys-color-state-disabled-container);\n border-color: transparent;\n\n & .chat-input-disclaimer {\n border-color: var(--sys-color-state-disabled);\n }\n }\n\n &.single-line-layout {\n flex-direction: row;\n justify-content: space-between;\n\n .chat-input {\n flex-shrink: 1;\n padding: var(--sys-size-4);\n }\n\n .chat-input-actions {\n flex-shrink: 0;\n padding-block: 0;\n align-items: flex-end;\n padding-bottom: var(--sys-size-1);\n }\n }\n\n & .image-input-container {\n margin: var(--sys-size-3) var(--sys-size-4) 0;\n max-width: 100%;\n width: fit-content;\n position: relative;\n\n devtools-button {\n position: absolute;\n top: calc(-1 * var(--sys-size-2));\n right: calc(-1 * var(--sys-size-3));\n border-radius: var(--sys-shape-corner-full);\n border: 1px solid var(--sys-color-neutral-outline);\n background-color: var(--sys-color-cdt-base-container);\n }\n\n img {\n max-height: var(--sys-size-18);\n max-width: 100%;\n border: 1px solid var(--sys-color-neutral-outline);\n border-radius: var(--sys-shape-corner-small);\n }\n\n .loading {\n margin: var(--sys-size-4) 0;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: var(--sys-size-18);\n width: var(--sys-size-19);\n background-color: var(--sys-color-surface3);\n border-radius: var(--sys-shape-corner-small);\n border: 1px solid var(--sys-color-neutral-outline);\n\n devtools-spinner {\n color: var(--sys-color-state-disabled);\n }\n }\n }\n\n & .chat-input-disclaimer-container {\n display: flex;\n align-items: center;\n padding-right: var(--sys-size-3);\n flex-shrink: 0;\n }\n\n & .chat-input-disclaimer {\n display: flex;\n justify-content: center;\n align-items: center;\n font: var(--sys-typescale-body5-regular);\n border-right: 1px solid var(--sys-color-divider);\n padding-right: 8px;\n\n &.hide-divider {\n border-right: none;\n }\n }\n\n /*\n Hide the inline disclaimer on narrow widths (< 400px) because space is limited\n and the disclaimer is shown in the footer instead for this case.\n */\n @container --chat-ui-container (width < 400px) {\n & .chat-input-disclaimer-container {\n display: none;\n }\n }\n}\n\n.chat-input {\n scrollbar-width: none;\n field-sizing: content;\n resize: none;\n width: 100%;\n max-height: 84px; /* 4 rows */\n border: 0;\n border-radius: var(--sys-shape-corner-small);\n font: var(--sys-typescale-body4-regular);\n line-height: 18px;\n min-height: var(--sys-size-11);\n color: var(--sys-color-on-surface);\n background-color: var(--sys-color-cdt-base-container);\n padding: var(--sys-size-4) var(--sys-size-4) var(--sys-size-3)\n var(--sys-size-4);\n\n &::placeholder {\n opacity: 60%;\n }\n\n &:focus-visible {\n outline: 0;\n }\n\n &:disabled {\n color: var(--sys-color-state-disabled);\n background-color: transparent;\n border-color: transparent;\n\n &::placeholder {\n color: var(--sys-color-on-surface-subtle);\n opacity: 100%;\n }\n }\n}\n\n.chat-input-actions {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding-left: var(--sys-size-4);\n padding-right: var(--sys-size-2);\n gap: var(--sys-size-6);\n padding-bottom: var(--sys-size-2);\n\n & .chat-input-actions-left {\n flex: 1 1 0;\n min-width: 0;\n }\n\n & .chat-input-actions-right {\n flex-shrink: 0;\n display: flex;\n\n & .start-new-chat-button {\n padding-bottom: var(--sys-size-2);\n padding-right: var(--sys-size-3);\n }\n }\n}\n\n.chat-inline-button {\n padding-left: 3px;\n}\n\n.select-element {\n display: flex;\n gap: var(--sys-size-3);\n align-items: center;\n\n .resource-link {\n display: flex;\n background-color: var(--sys-color-cdt-base-container);\n align-items: center;\n cursor: pointer;\n padding: var(--sys-size-2) var(--sys-size-3);\n font: var(--sys-typescale-body5-regular);\n border: var(--sys-size-1) solid var(--sys-color-divider);\n border-radius: var(--sys-shape-corner-extra-small);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n /*\n Allow the link/task item to shrink below its intrinsic minimum width in the flex container,\n enabling text-overflow ellipsis to work correctly.\n */\n min-width: 0;\n line-height: 1;\n\n & .title {\n vertical-align: middle;\n /* Fixed italic text getting cut off */\n padding-right: var(--sys-size-2);\n font: var(--sys-typescale-body5-regular);\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n & .remove-context,\n & .add-context {\n vertical-align: middle;\n }\n\n &:focus-visible {\n outline: 2px solid var(--sys-color-state-focus-ring);\n }\n\n devtools-icon,\n devtools-file-source-icon {\n display: inline-flex;\n vertical-align: middle;\n min-width: var(--sys-size-7);\n min-height: var(--sys-size-7);\n }\n\n &.disabled {\n border-style: dashed;\n border-color: var(--sys-color-neutral-outline);\n color: var(--sys-color-on-surface-light);\n\n devtools-icon,\n devtools-file-source-icon {\n /* Override devtools-file-source-icon */\n --override-file-source-icon-color: var(\n --sys-color-on-surface-light-graphics\n );\n /* Some icons set their style attribute and we need to override it */\n /* stylelint-disable-next-line declaration-no-important */\n color: var(--sys-color-on-surface-light-graphics) !important;\n }\n\n .title {\n color: var(--sys-color-on-surface-light);\n font-style: italic;\n }\n }\n\n /*\n CSS styling for `network-override-marker` is similar to\n https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/panels/network/networkLogView.css;l=379.\n There is a difference in `left` and `top` values to make sure\n it is placed correctly for the network icon in assistance panel.\n */\n .network-override-marker {\n position: relative;\n float: left;\n }\n\n .network-override-marker::before {\n content: var(--image-file-empty);\n width: var(--sys-size-4);\n height: var(--sys-size-4);\n border-radius: 50%;\n outline: var(--sys-size-1) solid var(--icon-gap-focus-selected);\n left: 11px;\n position: absolute;\n top: 13px;\n z-index: 1;\n background-color: var(--sys-color-purple-bright);\n }\n\n .image.icon {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n margin-right: var(--sys-size-3);\n\n img {\n max-width: var(--sys-size-7);\n max-height: var(--sys-size-7);\n }\n }\n }\n}\n\n.link {\n color: var(--text-link);\n text-decoration: underline;\n cursor: pointer;\n}\n\nbutton.link {\n border: none;\n background: none;\n font: inherit;\n\n &:focus-visible {\n outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);\n outline-offset: 0;\n border-radius: var(--sys-shape-corner-extra-small);\n }\n}\n\n.floaty {\n font: var(--sys-typescale-body4);\n color: var(--sys-color-on-surface);\n user-select: none;\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n flex-flow: row wrap;\n align-items: flex-end;\n gap: var(--sys-size-2);\n margin-bottom: var(--sys-size-2);\n\n li {\n background: var(--sys-color-surface3);\n border-radius: var(--sys-shape-corner-small);\n border: 1px solid var(--sys-color-neutral-outline);\n padding: var(--sys-size-2) var(--sys-size-3);\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--sys-size-2);\n min-height: var(--sys-size-8);\n }\n\n .context-item {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--sys-size-2);\n }\n\n .open-floaty {\n padding: 0;\n border: none;\n\n /* To align with other chips */\n margin-bottom: 1px;\n }\n}\n\n.chat-input-footer {\n display: flex;\n justify-content: center;\n padding-block: var(--sys-size-3);\n font: var(--sys-typescale-body5-regular);\n border-top: 1px solid var(--sys-color-divider);\n text-wrap: balance;\n text-align: center;\n width: 100%;\n\n /*\n The footer (for active conversations) is hidden by default on wider screens\n because the disclaimer is shown inline within the chat input actions. Show it only on narrow widths (< 400px).\n */\n &:not(.is-read-only) {\n display: none;\n border: none;\n\n @container --chat-ui-container (width < 400px) {\n display: flex;\n }\n }\n}\n", _i = /* @__PURE__ */ e({
|
|
2148
|
+
ChatInput: () => ji,
|
|
2149
|
+
DEFAULT_VIEW: () => Ai
|
|
2150
|
+
}), { html: B, Directives: { createRef: vi, ref: yi } } = ye, { widget: bi } = Le, xi = {
|
|
2151
|
+
inputTextAriaDescription: "You can also use one of the suggested prompts above to start your conversation",
|
|
2152
|
+
revealContextDescription: "Reveal the selected context item in DevTools",
|
|
2153
|
+
learnAbout: "Learn about AI in DevTools"
|
|
2154
|
+
}, V = {
|
|
2155
|
+
sendButtonTitle: "Send",
|
|
2156
|
+
startNewChat: "Start new chat",
|
|
2157
|
+
cancelButtonTitle: "Cancel",
|
|
2158
|
+
selectAnElement: "Select an element",
|
|
2159
|
+
takeScreenshotButtonTitle: "Take screenshot",
|
|
2160
|
+
removeImageInputButtonTitle: "Remove image input",
|
|
2161
|
+
addImageButtonTitle: "Add image",
|
|
2162
|
+
pastConversation: "You're viewing a past conversation.",
|
|
2163
|
+
screenshotFailureMessage: "Failed to take a screenshot. Please try again.",
|
|
2164
|
+
uploadImageFailureMessage: "Failed to upload image. Please try again.",
|
|
2165
|
+
addContext: "Add item for context",
|
|
2166
|
+
removeContextElement: "Remove element from context",
|
|
2167
|
+
removeContextRequest: "Remove request from context",
|
|
2168
|
+
removeContextFile: "Remove file from context",
|
|
2169
|
+
removeContextPerfInsight: "Remove performance insight from context",
|
|
2170
|
+
removeContextStorage: "Remove storage from context",
|
|
2171
|
+
removeContext: "Remove from context"
|
|
2172
|
+
}, Si = ie("panels/ai_assistance/components/ChatInput.ts", xi), Ci = ee.bind(void 0, Si), H = l, wi = 80, Ti = "image/jpeg", Ei = 100, Di = "relevant-data-link-chat", Oi = "relevant-data-link-footer";
|
|
2173
|
+
function ki(e) {
|
|
2174
|
+
return e instanceof pt ? H(V.removeContextFile) : e instanceof zt ? H(V.removeContextElement) : e instanceof Ot ? H(V.removeContextRequest) : e instanceof Vt ? H(V.removeContextPerfInsight) : e instanceof Pt ? H(V.removeContextStorage) : H(V.removeContext);
|
|
2175
|
+
}
|
|
2176
|
+
var Ai = (e, t, n) => {
|
|
2177
|
+
let r = g({
|
|
2178
|
+
"chat-input-container": !0,
|
|
2179
|
+
"single-line-layout": !e.context,
|
|
2180
|
+
disabled: e.isTextInputDisabled
|
|
2181
|
+
}), i = (t) => B`
|
|
2182
|
+
<div class=${g({
|
|
2183
|
+
"chat-input-disclaimer": !0,
|
|
2184
|
+
"hide-divider": !e.isLoading && e.blockedByCrossOrigin
|
|
2185
|
+
})}>
|
|
2186
|
+
<button
|
|
2187
|
+
class="link"
|
|
2188
|
+
role="link"
|
|
2189
|
+
aria-details=${t}
|
|
2190
|
+
jslog=${nt("open-ai-settings").track({ click: !0 })}
|
|
2191
|
+
@click=${(e) => {
|
|
2192
|
+
e.preventDefault(), x.instance().showView("chrome-ai");
|
|
2193
|
+
}}
|
|
2194
|
+
>${H("Relevant data")}</button> ${H("is sent to Google")}
|
|
2195
|
+
<devtools-tooltip
|
|
2196
|
+
id=${t}
|
|
2197
|
+
variant="rich"
|
|
2198
|
+
><div class="info-tooltip-container">
|
|
2199
|
+
${e.disclaimerText}
|
|
2200
|
+
<button
|
|
2201
|
+
class="link tooltip-link"
|
|
2202
|
+
role="link"
|
|
2203
|
+
jslog=${nt("open-ai-settings").track({ click: !0 })}
|
|
2204
|
+
@click=${() => {
|
|
2205
|
+
x.instance().showView("chrome-ai");
|
|
2206
|
+
}}>${Ci(xi.learnAbout)}
|
|
2207
|
+
</button>
|
|
2208
|
+
</div></devtools-tooltip>
|
|
2209
|
+
</div>
|
|
2210
|
+
`;
|
|
2211
|
+
p(B`
|
|
2212
|
+
<style>${Xt}</style>
|
|
2213
|
+
<style>${gi}</style>
|
|
2214
|
+
${e.isReadOnly ? B`
|
|
2215
|
+
<div
|
|
2216
|
+
class="chat-readonly-container"
|
|
2217
|
+
jslog=${C("read-only")}
|
|
2218
|
+
>
|
|
2219
|
+
<span>${H(V.pastConversation)}</span>
|
|
2220
|
+
<devtools-button
|
|
2221
|
+
aria-label=${H(V.startNewChat)}
|
|
2222
|
+
class="chat-inline-button"
|
|
2223
|
+
@click=${e.onNewConversation}
|
|
2224
|
+
.data=${{
|
|
2225
|
+
variant: f.TEXT,
|
|
2226
|
+
title: H(V.startNewChat),
|
|
2227
|
+
jslogContext: "start-new-chat"
|
|
2228
|
+
}}
|
|
2229
|
+
>${H(V.startNewChat)}</devtools-button>
|
|
2230
|
+
</div>` : B`
|
|
2231
|
+
<form class="input-form" @submit=${e.onSubmit}>
|
|
2232
|
+
<div class=${r}>
|
|
2233
|
+
${e.multimodalInputEnabled && e.imageInput && !e.isTextInputDisabled ? B`
|
|
2234
|
+
<div class="image-input-container">
|
|
2235
|
+
<devtools-button
|
|
2236
|
+
aria-label=${H(V.removeImageInputButtonTitle)}
|
|
2237
|
+
@click=${e.onRemoveImageInput}
|
|
2238
|
+
.data=${{
|
|
2239
|
+
variant: f.ICON,
|
|
2240
|
+
size: _.MICRO,
|
|
2241
|
+
iconName: "cross",
|
|
2242
|
+
title: H(V.removeImageInputButtonTitle)
|
|
2243
|
+
}}
|
|
2244
|
+
></devtools-button>
|
|
2245
|
+
${e.imageInput.isLoading ? B`
|
|
2246
|
+
<div class="loading">
|
|
2247
|
+
<devtools-spinner></devtools-spinner>
|
|
2248
|
+
</div>` : B`
|
|
2249
|
+
<img src="data:${e.imageInput.mimeType};base64, ${e.imageInput.data}" alt="Image input" />`}
|
|
2250
|
+
</div>` : v}
|
|
2251
|
+
<textarea
|
|
2252
|
+
class="chat-input"
|
|
2253
|
+
.disabled=${e.isTextInputDisabled}
|
|
2254
|
+
wrap="hard"
|
|
2255
|
+
maxlength="10000"
|
|
2256
|
+
@keydown=${e.onTextAreaKeyDown}
|
|
2257
|
+
@paste=${e.onImagePaste}
|
|
2258
|
+
@dragover=${e.onImageDragOver}
|
|
2259
|
+
@drop=${e.onImageDrop}
|
|
2260
|
+
@input=${(t) => {
|
|
2261
|
+
e.onTextInputChange(t.target.value);
|
|
2262
|
+
}}
|
|
2263
|
+
placeholder=${e.inputPlaceholder}
|
|
2264
|
+
jslog=${$e("query").track({
|
|
2265
|
+
change: !0,
|
|
2266
|
+
keydown: "Enter"
|
|
2267
|
+
})}
|
|
2268
|
+
aria-description=${Ci(xi.inputTextAriaDescription)}
|
|
2269
|
+
${yi(e.textAreaRef)}
|
|
2270
|
+
></textarea>
|
|
2271
|
+
<div class="chat-input-actions">
|
|
2272
|
+
<div class="chat-input-actions-left">
|
|
2273
|
+
${e.context ? B`
|
|
2274
|
+
<div class="select-element">
|
|
2275
|
+
${e.conversationType === O.STYLING ? B`
|
|
2276
|
+
<devtools-button
|
|
2277
|
+
.data=${{
|
|
2278
|
+
variant: f.ICON_TOGGLE,
|
|
2279
|
+
size: _.SMALL,
|
|
2280
|
+
iconName: "select-element",
|
|
2281
|
+
toggledIconName: "select-element",
|
|
2282
|
+
toggleType: xe.PRIMARY,
|
|
2283
|
+
toggled: e.inspectElementToggled,
|
|
2284
|
+
title: H(V.selectAnElement),
|
|
2285
|
+
jslogContext: "select-element",
|
|
2286
|
+
disabled: e.isTextInputDisabled
|
|
2287
|
+
}}
|
|
2288
|
+
@click=${e.onInspectElementClick}
|
|
2289
|
+
></devtools-button>` : v}
|
|
2290
|
+
<div
|
|
2291
|
+
class=${g({
|
|
2292
|
+
"resource-link": !0,
|
|
2293
|
+
disabled: !e.isContextSelected
|
|
2294
|
+
})}
|
|
2295
|
+
>
|
|
2296
|
+
${e.context instanceof zt ? B`
|
|
2297
|
+
<devtools-widget
|
|
2298
|
+
class="title"
|
|
2299
|
+
${bi(Nt, {
|
|
2300
|
+
node: e.context.getItem(),
|
|
2301
|
+
options: {
|
|
2302
|
+
disabled: !e.isContextSelected,
|
|
2303
|
+
hiddenClassList: e.context.getItem().classNames().filter((e) => e.startsWith(mt)),
|
|
2304
|
+
ariaDescription: Ci(xi.revealContextDescription)
|
|
2305
|
+
}
|
|
2306
|
+
})}
|
|
2307
|
+
></devtools-widget>` : B`
|
|
2308
|
+
${e.context instanceof Ot ? nn.getIconForNetworkRequest(e.context.getItem()) : e.context instanceof pt ? nn.getIconForSourceFile(e.context.getItem()) : e.context instanceof ft ? B`<devtools-icon class="icon" name="performance" title="Lighthouse"></devtools-icon>` : e.context instanceof Vt ? B`<devtools-icon class="icon" name="performance" title="Performance"></devtools-icon>` : e.context instanceof Pt ? B`<devtools-icon class="icon" name="table" title="Storage"></devtools-icon>` : v}
|
|
2309
|
+
<span
|
|
2310
|
+
role="button"
|
|
2311
|
+
class="title"
|
|
2312
|
+
tabindex="0"
|
|
2313
|
+
@click=${e.onContextClick}
|
|
2314
|
+
@keydown=${(t) => {
|
|
2315
|
+
(t.key === "Enter" || t.key === " ") && e.onContextClick();
|
|
2316
|
+
}}
|
|
2317
|
+
aria-description=${Ci(xi.revealContextDescription)}
|
|
2318
|
+
>${e.context.getTitle()}</span>`}
|
|
2319
|
+
${e.isContextSelected && e.onContextRemoved ? B`
|
|
2320
|
+
<devtools-button
|
|
2321
|
+
title=${ki(e.context)}
|
|
2322
|
+
aria-label=${ki(e.context)}
|
|
2323
|
+
class="remove-context"
|
|
2324
|
+
.iconName=${"cross"}
|
|
2325
|
+
.size=${_.MICRO}
|
|
2326
|
+
.jslogContext=${"context-removed"}
|
|
2327
|
+
.variant=${f.ICON}
|
|
2328
|
+
@click=${e.onContextRemoved}></devtools-button>` : v}
|
|
2329
|
+
${!e.isContextSelected && e.onContextAdd ? B`
|
|
2330
|
+
<devtools-button
|
|
2331
|
+
title=${H(V.addContext)}
|
|
2332
|
+
aria-label=${H(V.addContext)}
|
|
2333
|
+
class="add-context"
|
|
2334
|
+
.iconName=${"plus"}
|
|
2335
|
+
.size=${_.MICRO}
|
|
2336
|
+
.jslogContext=${"context-added"}
|
|
2337
|
+
.variant=${f.ICON}
|
|
2338
|
+
@click=${e.onContextAdd}></devtools-button>` : v}
|
|
2339
|
+
</div>
|
|
2340
|
+
</div>` : v}
|
|
2341
|
+
</div>
|
|
2342
|
+
<div class="chat-input-actions-right">
|
|
2343
|
+
<div class="chat-input-disclaimer-container">
|
|
2344
|
+
${i(Di)}
|
|
2345
|
+
</div>
|
|
2346
|
+
${e.multimodalInputEnabled && !e.blockedByCrossOrigin ? B`
|
|
2347
|
+
${e.uploadImageInputEnabled ? B`
|
|
2348
|
+
<devtools-button
|
|
2349
|
+
class="chat-input-button"
|
|
2350
|
+
aria-label=${H(V.addImageButtonTitle)}
|
|
2351
|
+
@click=${e.onImageUpload}
|
|
2352
|
+
.data=${{
|
|
2353
|
+
variant: f.ICON,
|
|
2354
|
+
size: _.REGULAR,
|
|
2355
|
+
disabled: e.isTextInputDisabled || e.imageInput?.isLoading,
|
|
2356
|
+
iconName: "add-photo",
|
|
2357
|
+
title: H(V.addImageButtonTitle),
|
|
2358
|
+
jslogContext: "upload-image"
|
|
2359
|
+
}}
|
|
2360
|
+
></devtools-button>` : v}
|
|
2361
|
+
<devtools-button
|
|
2362
|
+
class="chat-input-button"
|
|
2363
|
+
aria-label=${H(V.takeScreenshotButtonTitle)}
|
|
2364
|
+
@click=${e.onTakeScreenshot}
|
|
2365
|
+
.data=${{
|
|
2366
|
+
variant: f.ICON,
|
|
2367
|
+
size: _.REGULAR,
|
|
2368
|
+
disabled: e.isTextInputDisabled || e.imageInput?.isLoading,
|
|
2369
|
+
iconName: "photo-camera",
|
|
2370
|
+
title: H(V.takeScreenshotButtonTitle),
|
|
2371
|
+
jslogContext: "take-screenshot"
|
|
2372
|
+
}}
|
|
2373
|
+
></devtools-button>` : v}
|
|
2374
|
+
${e.isLoading ? B`
|
|
2375
|
+
<devtools-button
|
|
2376
|
+
class="chat-input-button"
|
|
2377
|
+
aria-label=${H(V.cancelButtonTitle)}
|
|
2378
|
+
@click=${e.onCancel}
|
|
2379
|
+
.data=${{
|
|
2380
|
+
variant: f.ICON,
|
|
2381
|
+
size: _.REGULAR,
|
|
2382
|
+
iconName: "record-stop",
|
|
2383
|
+
title: H(V.cancelButtonTitle),
|
|
2384
|
+
jslogContext: "stop"
|
|
2385
|
+
}}
|
|
2386
|
+
></devtools-button>` : e.blockedByCrossOrigin ? B`
|
|
2387
|
+
<devtools-button
|
|
2388
|
+
class="start-new-chat-button"
|
|
2389
|
+
aria-label=${H(V.startNewChat)}
|
|
2390
|
+
@click=${e.onNewConversation}
|
|
2391
|
+
.data=${{
|
|
2392
|
+
variant: f.OUTLINED,
|
|
2393
|
+
size: _.SMALL,
|
|
2394
|
+
title: H(V.startNewChat),
|
|
2395
|
+
jslogContext: "start-new-chat"
|
|
2396
|
+
}}
|
|
2397
|
+
>${H(V.startNewChat)}</devtools-button>` : B`
|
|
2398
|
+
<devtools-button
|
|
2399
|
+
class="chat-input-button"
|
|
2400
|
+
aria-label=${H(V.sendButtonTitle)}
|
|
2401
|
+
.data=${{
|
|
2402
|
+
type: "submit",
|
|
2403
|
+
variant: f.ICON,
|
|
2404
|
+
size: _.REGULAR,
|
|
2405
|
+
disabled: e.isTextInputDisabled || e.isTextInputEmpty || e.imageInput?.isLoading,
|
|
2406
|
+
iconName: "send",
|
|
2407
|
+
title: H(V.sendButtonTitle),
|
|
2408
|
+
jslogContext: "send"
|
|
2409
|
+
}}
|
|
2410
|
+
></devtools-button>`}
|
|
2411
|
+
</div>
|
|
2412
|
+
</div>
|
|
2413
|
+
</div>
|
|
2414
|
+
</form>`}
|
|
2415
|
+
<footer
|
|
2416
|
+
class=${g({
|
|
2417
|
+
"chat-input-footer": !0,
|
|
2418
|
+
"is-read-only": e.isReadOnly
|
|
2419
|
+
})}
|
|
2420
|
+
jslog=${C("footer")}
|
|
2421
|
+
>
|
|
2422
|
+
${i(Oi)}
|
|
2423
|
+
</footer>
|
|
2424
|
+
`, n);
|
|
2425
|
+
}, ji = class extends Ue {
|
|
2426
|
+
isLoading = !1;
|
|
2427
|
+
blockedByCrossOrigin = !1;
|
|
2428
|
+
isTextInputDisabled = !1;
|
|
2429
|
+
inputPlaceholder = "";
|
|
2430
|
+
context = null;
|
|
2431
|
+
isContextSelected = !1;
|
|
2432
|
+
inspectElementToggled = !1;
|
|
2433
|
+
disclaimerText = "";
|
|
2434
|
+
conversationType = O.STYLING;
|
|
2435
|
+
multimodalInputEnabled = !1;
|
|
2436
|
+
uploadImageInputEnabled = !1;
|
|
2437
|
+
isReadOnly = !1;
|
|
2438
|
+
#e = vi();
|
|
2439
|
+
#t;
|
|
2440
|
+
#n = -1;
|
|
2441
|
+
#r = "";
|
|
2442
|
+
setInputValue(e) {
|
|
2443
|
+
if (this.#e.value) {
|
|
2444
|
+
let t = this.#e.value.maxLength, n = t >= 0 ? e.substring(0, t) : e;
|
|
2445
|
+
this.#e.value.value = n, this.#e.value.setSelectionRange(n.length, n.length);
|
|
2446
|
+
}
|
|
2447
|
+
this.performUpdate();
|
|
2448
|
+
}
|
|
2449
|
+
#i() {
|
|
2450
|
+
return !this.#e.value?.value?.trim();
|
|
2451
|
+
}
|
|
2452
|
+
onTextSubmit = () => {};
|
|
2453
|
+
onContextClick = () => {};
|
|
2454
|
+
onInspectElementClick = () => {};
|
|
2455
|
+
onCancelClick = () => {};
|
|
2456
|
+
onNewConversation = () => {};
|
|
2457
|
+
onContextRemoved = null;
|
|
2458
|
+
onContextAdd = null;
|
|
2459
|
+
#a(e) {
|
|
2460
|
+
let t = Rt.instance().getRecentPrompts();
|
|
2461
|
+
t.length && (e === -1 ? (this.#n === -1 && (this.#r = this.#e.value?.value || ""), this.#n < t.length - 1 && (this.#n++, this.setInputValue(t[this.#n]))) : this.#n > 0 ? (this.#n--, this.setInputValue(t[this.#n])) : this.#n === 0 && (this.#n = -1, this.setInputValue(this.#r)));
|
|
2462
|
+
}
|
|
2463
|
+
async #o() {
|
|
2464
|
+
let e = m.instance().primaryPageTarget();
|
|
2465
|
+
if (!e) throw Error("Could not find main target");
|
|
2466
|
+
let t = e.model(Pe);
|
|
2467
|
+
if (!t) throw Error("Could not find model");
|
|
2468
|
+
let n = setTimeout(() => {
|
|
2469
|
+
this.#t = { isLoading: !0 }, this.performUpdate();
|
|
2470
|
+
}, Ei), r = await t.captureScreenshot(Je.CaptureScreenshotRequestFormat.Jpeg, wi, Be.FROM_VIEWPORT);
|
|
2471
|
+
clearTimeout(n), r ? (this.#t = {
|
|
2472
|
+
isLoading: !1,
|
|
2473
|
+
data: r,
|
|
2474
|
+
mimeType: Ti,
|
|
2475
|
+
inputType: ut.SCREENSHOT
|
|
2476
|
+
}, this.performUpdate(), this.updateComplete.then(() => {
|
|
2477
|
+
this.focusTextInput();
|
|
2478
|
+
})) : (this.#t = void 0, this.performUpdate(), Kt.show({ message: H(V.screenshotFailureMessage) }));
|
|
2479
|
+
}
|
|
2480
|
+
targetAdded(e) {}
|
|
2481
|
+
targetRemoved(e) {}
|
|
2482
|
+
#s() {
|
|
2483
|
+
this.#t = void 0, this.performUpdate(), this.updateComplete.then(() => {
|
|
2484
|
+
this.focusTextInput();
|
|
2485
|
+
});
|
|
2486
|
+
}
|
|
2487
|
+
#c(e, t) {
|
|
2488
|
+
if (this.conversationType !== O.STYLING) return;
|
|
2489
|
+
let n = e?.files;
|
|
2490
|
+
if (!n || n.length === 0) return;
|
|
2491
|
+
let r = Array.from(n).find((e) => e.type.startsWith("image/"));
|
|
2492
|
+
r && (t.preventDefault(), this.#f(r));
|
|
2493
|
+
}
|
|
2494
|
+
#l = (e) => {
|
|
2495
|
+
this.#c(e.clipboardData, e);
|
|
2496
|
+
};
|
|
2497
|
+
#u = (e) => {
|
|
2498
|
+
this.conversationType === O.STYLING && e.preventDefault();
|
|
2499
|
+
};
|
|
2500
|
+
#d = (e) => {
|
|
2501
|
+
this.#c(e.dataTransfer, e);
|
|
2502
|
+
};
|
|
2503
|
+
async #f(e) {
|
|
2504
|
+
let t = setTimeout(() => {
|
|
2505
|
+
this.#t = { isLoading: !0 }, this.performUpdate();
|
|
2506
|
+
}, Ei);
|
|
2507
|
+
try {
|
|
2508
|
+
let t = new FileReader(), n = await new Promise((n, r) => {
|
|
2509
|
+
t.onload = () => {
|
|
2510
|
+
typeof t.result == "string" ? n(t.result) : r(/* @__PURE__ */ Error("FileReader result was not a string."));
|
|
2511
|
+
}, t.readAsDataURL(e);
|
|
2512
|
+
}), r = n.indexOf(","), i = n.substring(r + 1);
|
|
2513
|
+
this.#t = {
|
|
2514
|
+
isLoading: !1,
|
|
2515
|
+
data: i,
|
|
2516
|
+
mimeType: e.type,
|
|
2517
|
+
inputType: ut.UPLOADED_IMAGE
|
|
2518
|
+
};
|
|
2519
|
+
} catch {
|
|
2520
|
+
this.#t = void 0, Kt.show({ message: H(V.uploadImageFailureMessage) });
|
|
2521
|
+
}
|
|
2522
|
+
clearTimeout(t), this.performUpdate(), this.updateComplete.then(() => {
|
|
2523
|
+
this.focusTextInput();
|
|
2524
|
+
});
|
|
2525
|
+
}
|
|
2526
|
+
#p;
|
|
2527
|
+
constructor(e, t) {
|
|
2528
|
+
super(e), this.#p = t ?? Ai;
|
|
2529
|
+
}
|
|
2530
|
+
wasShown() {
|
|
2531
|
+
super.wasShown(), m.instance().addModelListener(Ee, Te.PrimaryPageChanged, this.#m, this);
|
|
2532
|
+
}
|
|
2533
|
+
willHide() {
|
|
2534
|
+
super.willHide(), m.instance().removeModelListener(Ee, Te.PrimaryPageChanged, this.#m, this);
|
|
2535
|
+
}
|
|
2536
|
+
#m() {
|
|
2537
|
+
this.#t = void 0, this.performUpdate();
|
|
2538
|
+
}
|
|
2539
|
+
performUpdate() {
|
|
2540
|
+
this.#p({
|
|
2541
|
+
inputPlaceholder: this.inputPlaceholder,
|
|
2542
|
+
isLoading: this.isLoading,
|
|
2543
|
+
blockedByCrossOrigin: this.blockedByCrossOrigin,
|
|
2544
|
+
isTextInputDisabled: this.isTextInputDisabled,
|
|
2545
|
+
context: this.context,
|
|
2546
|
+
isContextSelected: this.isContextSelected,
|
|
2547
|
+
inspectElementToggled: this.inspectElementToggled,
|
|
2548
|
+
isTextInputEmpty: this.#i(),
|
|
2549
|
+
disclaimerText: this.disclaimerText,
|
|
2550
|
+
conversationType: this.conversationType,
|
|
2551
|
+
multimodalInputEnabled: this.multimodalInputEnabled,
|
|
2552
|
+
imageInput: this.#t,
|
|
2553
|
+
uploadImageInputEnabled: this.uploadImageInputEnabled,
|
|
2554
|
+
isReadOnly: this.isReadOnly,
|
|
2555
|
+
textAreaRef: this.#e,
|
|
2556
|
+
onContextClick: this.onContextClick,
|
|
2557
|
+
onInspectElementClick: this.onInspectElementClick,
|
|
2558
|
+
onImagePaste: this.#l,
|
|
2559
|
+
onNewConversation: this.onNewConversation,
|
|
2560
|
+
onTextInputChange: () => {
|
|
2561
|
+
this.requestUpdate();
|
|
2562
|
+
},
|
|
2563
|
+
onTakeScreenshot: this.#o.bind(this),
|
|
2564
|
+
onRemoveImageInput: this.#s.bind(this),
|
|
2565
|
+
onSubmit: this.onSubmit,
|
|
2566
|
+
onTextAreaKeyDown: this.onTextAreaKeyDown,
|
|
2567
|
+
onCancel: this.onCancel,
|
|
2568
|
+
onImageUpload: this.onImageUpload,
|
|
2569
|
+
onImageDragOver: this.#u,
|
|
2570
|
+
onImageDrop: this.#d,
|
|
2571
|
+
onContextRemoved: this.onContextRemoved,
|
|
2572
|
+
onContextAdd: this.onContextAdd
|
|
2573
|
+
}, void 0, this.contentElement);
|
|
2574
|
+
}
|
|
2575
|
+
focusTextInput() {
|
|
2576
|
+
this.#e.value?.focus();
|
|
2577
|
+
}
|
|
2578
|
+
onSubmit = (e) => {
|
|
2579
|
+
if (e.preventDefault(), this.#t?.isLoading) return;
|
|
2580
|
+
let t = !this.#t?.isLoading && this.#t?.data ? { inlineData: {
|
|
2581
|
+
data: this.#t.data,
|
|
2582
|
+
mimeType: this.#t.mimeType
|
|
2583
|
+
} } : void 0;
|
|
2584
|
+
this.onTextSubmit(this.#e.value?.value ?? "", t, this.#t?.inputType), this.#t = void 0, this.#n = -1, this.#r = "", this.setInputValue("");
|
|
2585
|
+
};
|
|
2586
|
+
onTextAreaKeyDown = (e) => {
|
|
2587
|
+
if (!(!e.target || !(e.target instanceof HTMLTextAreaElement))) {
|
|
2588
|
+
if (e.key === "ArrowUp") {
|
|
2589
|
+
let { value: t, selectionStart: n, selectionEnd: r } = e.target;
|
|
2590
|
+
n === r && t.lastIndexOf("\n", n - 1) === -1 && (e.preventDefault(), this.#a(-1));
|
|
2591
|
+
return;
|
|
2592
|
+
}
|
|
2593
|
+
if (e.key === "ArrowDown") {
|
|
2594
|
+
let { selectionEnd: t, selectionStart: n, value: r } = e.target;
|
|
2595
|
+
n === t && r.indexOf("\n", t) === -1 && (e.preventDefault(), this.#a(1));
|
|
2596
|
+
return;
|
|
2597
|
+
}
|
|
2598
|
+
if (e.key === "Enter" && !e.shiftKey && !e.isComposing) {
|
|
2599
|
+
if (e.preventDefault(), !e.target?.value || this.#t?.isLoading) return;
|
|
2600
|
+
let t = !this.#t?.isLoading && this.#t?.data ? { inlineData: {
|
|
2601
|
+
data: this.#t.data,
|
|
2602
|
+
mimeType: this.#t.mimeType
|
|
2603
|
+
} } : void 0;
|
|
2604
|
+
this.onTextSubmit(e.target.value, t, this.#t?.inputType), this.#t = void 0, this.#n = -1, this.#r = "", this.setInputValue("");
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
};
|
|
2608
|
+
onCancel = (e) => {
|
|
2609
|
+
e.preventDefault(), this.isLoading && this.onCancelClick();
|
|
2610
|
+
};
|
|
2611
|
+
onImageUpload = (e) => {
|
|
2612
|
+
e.stopPropagation(), Qe(this.#f.bind(this), ".jpeg,.jpg,.png").click();
|
|
2613
|
+
};
|
|
2614
|
+
}, Mi = "/*\n * Copyright 2024 The Chromium Authors\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n* {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n:host {\n width: 100%;\n height: 100%;\n user-select: text;\n display: flex;\n flex-direction: column;\n background-color: var(--sys-color-cdt-base-container);\n}\n\n.chat-ui {\n width: 100%;\n height: 100%;\n max-height: 100%;\n display: flex;\n flex-direction: column;\n container-type: size;\n container-name: --chat-ui-container;\n}\n\n.info-tooltip-container {\n max-width: var(--sys-size-28);\n padding: var(--sys-size-4) var(--sys-size-5);\n}\n\n.tooltip-link {\n display: block;\n margin-top: var(--sys-size-4);\n color: var(--sys-color-primary);\n padding-left: 0;\n}\n\n.chat-cancel-context-button {\n padding-bottom: 3px;\n padding-right: var(--sys-size-3);\n}\n\n\n.messages-container {\n flex-grow: 1;\n width: 100%;\n max-width: var(--sys-size-36);\n\n /* Prevents the container from jumping when the scrollbar is shown */\n /* 688px is the max width of the input form + left and right paddings: var(--sys-size-36) + 2 * var(--sys-size-5) */\n @container (width > 688px) {\n --half-scrollbar-width: calc((100cqw - 100%) / 2);\n\n margin-left: var(--half-scrollbar-width);\n margin-right: calc(-1 * var(--half-scrollbar-width));\n }\n}\n\n.link {\n color: var(--text-link);\n text-decoration: underline;\n cursor: pointer;\n}\n\nbutton.link {\n border: none;\n background: none;\n font: inherit;\n\n &:focus-visible {\n outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);\n outline-offset: 0;\n border-radius: var(--sys-shape-corner-extra-small);\n }\n}\n\n.select-an-element-text {\n margin-left: 2px;\n}\n\nmain {\n overflow: hidden auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 100%;\n container-type: size;\n scrollbar-width: thin;\n /*\n Even though `transform: translateZ(1px)` doesn't have a visual effect,\n it puts `main` element into another rendering layer which somehow\n fixes the `.input-form` jumping on scroll issue.\n */\n transform: translateZ(1px);\n scroll-timeline: --scroll-timeline y;\n}\n\n.empty-state-container {\n flex-grow: 1;\n display: grid;\n align-items: center;\n justify-content: center;\n font: var(--sys-typescale-headline4);\n gap: var(--sys-size-8);\n padding: var(--sys-size-4);\n max-width: var(--sys-size-33);\n\n /* Prevents the container from jumping when the scrollbar is shown */\n /* 688px is the max width of the input form + left and right paddings: var(--sys-size-36) + 2 * var(--sys-size-5) */\n @container (width > 688px) {\n --half-scrollbar-width: calc((100cqw - 100%) / 2);\n\n margin-left: var(--half-scrollbar-width);\n margin-right: calc(-1 * var(--half-scrollbar-width));\n }\n\n .header {\n display: flex;\n flex-direction: column;\n width: 100%;\n align-items: center;\n justify-content: center;\n align-self: end;\n gap: var(--sys-size-5);\n\n .icon {\n display: flex;\n justify-content: center;\n align-items: center;\n height: var(--sys-size-14);\n width: var(--sys-size-14);\n border-radius: var(--sys-shape-corner-small);\n background: linear-gradient(\n 135deg,\n var(--sys-color-gradient-primary),\n var(--sys-color-gradient-tertiary)\n );\n }\n\n h1 {\n font: var(--sys-typescale-headline4);\n }\n\n p {\n text-align: center;\n font: var(--sys-typescale-body4-regular);\n }\n }\n\n .empty-state-content {\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-5);\n align-items: center;\n justify-content: center;\n align-self: start;\n }\n}\n\n.gemini {\n .empty-state-container {\n padding: var(--sys-size-8);\n }\n\n .empty-state-container .icon {\n display: none;\n }\n\n .empty-state-container .header {\n align-items: flex-start;\n line-height: var(--sys-size-4);\n }\n\n .empty-state-content {\n align-items: flex-start\n }\n\n .empty-state-container .greeting {\n font-size: var(--sys-size-10);\n color: var(--sys-color-primary);\n }\n\n .empty-state-container .cta {\n font-size: var(--sys-size-10);\n }\n\n main {\n align-items: flex-start;\n }\n}\n\n.change-summary {\n background-color: var(--sys-color-surface3);\n border-radius: var(--sys-shape-corner-medium-small);\n position: relative;\n margin: 0 var(--sys-size-5) var(--sys-size-7) var(--sys-size-5);\n padding: 0 var(--sys-size-5);\n\n &.saved-to-disk {\n pointer-events: none;\n }\n\n & .header-container {\n display: flex;\n align-items: center;\n gap: var(--sys-size-3);\n height: var(--sys-size-14);\n padding-left: var(--sys-size-3);\n\n devtools-spinner {\n width: var(--sys-size-6);\n height: var(--sys-size-6);\n margin-left: var(--sys-size-3);\n margin-right: var(--sys-size-3);\n }\n\n & devtools-icon.summary-badge {\n width: var(--sys-size-8);\n height: var(--sys-size-8);\n }\n\n & .green-bright-icon {\n color: var(--sys-color-green-bright);\n }\n\n & .on-tonal-icon {\n color: var(--sys-color-on-tonal-container);\n }\n\n & .header-text {\n font: var(--sys-typescale-body4);\n color: var(--sys-color-on-surface);\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n }\n\n & .arrow {\n margin-left: auto;\n }\n\n &::marker {\n content: '';\n }\n }\n\n &:not(.saved-to-disk, &[open]):hover::after {\n content: '';\n height: 100%;\n width: 100%;\n border-radius: inherit;\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n background-color: var(--sys-color-state-hover-on-subtle);\n }\n\n &[open]:not(.saved-to-disk) {\n &::details-content {\n height: fit-content;\n padding: var(--sys-size-2) 0;\n border-radius: inherit;\n }\n\n summary .arrow {\n transform: rotate(180deg);\n }\n }\n\n devtools-code-block {\n margin-bottom: var(--sys-size-5);\n\n --code-block-background-color: var(--sys-color-surface1);\n }\n\n .error-container {\n display: flex;\n align-items: center;\n gap: var(--sys-size-3);\n color: var(--sys-color-error);\n }\n\n .footer {\n display: flex;\n flex-flow: row wrap;\n justify-content: space-between;\n margin: var(--sys-size-5) 0 var(--sys-size-5) var(--sys-size-2);\n gap: var(--sys-size-6) var(--sys-size-5);\n\n .disclaimer-link {\n align-self: center;\n }\n\n .left-side {\n flex-grow: 1;\n display: flex;\n align-self: center;\n gap: var(--sys-size-3);\n }\n\n .save-or-discard-buttons {\n flex-grow: 1;\n display: flex;\n justify-content: flex-end;\n gap: var(--sys-size-3);\n }\n\n .change-workspace {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--sys-size-3);\n min-width: var(--sys-size-22);\n flex: 1 1 40%;\n\n .folder-name {\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n }\n }\n\n .loading-text-container {\n margin-right: var(--sys-size-3);\n display: flex;\n justify-content: center;\n align-items: center;\n gap: var(--sys-size-3);\n }\n\n .apply-to-workspace-container {\n display: flex;\n align-items: center;\n gap: var(--sys-size-3);\n min-width: fit-content;\n justify-content: flex-end;\n flex-grow: 1;\n flex-shrink: 1;\n\n devtools-icon {\n /* var(--sys-size-8) is too small and var(--sys-size-9) is too big. */\n width: 18px;\n height: 18px;\n margin-left: var(--sys-size-2);\n }\n }\n }\n}\n\n@keyframes reveal {\n 0%,\n 99% {\n opacity: 100%;\n }\n\n 100% {\n opacity: 0%;\n }\n}\n\n.sticky {\n position: sticky;\n bottom: 0;\n z-index: 9999;\n}\n\n.chat-input-widget {\n width: 100%;\n max-width: var(--sys-size-36);\n background-color: var(--sys-color-cdt-base-container);\n /*\n The `box-shadow` is a workaround to hide the content appearing between the `.input-form`\n and the footer in some resolutions even though the `.input-form` has `bottom: 0`.\n */\n box-shadow: 0 1px var(--sys-color-cdt-base-container);\n\n /* Prevents the input form from jumping when the scrollbar is shown */\n /* 688px is the max width of the input form + left and right paddings: var(--sys-size-36) + 2 * var(--sys-size-5) */\n @container (width > 688px) {\n --half-scrollbar-width: calc((100cqw - 100%) / 2);\n\n margin-left: var(--half-scrollbar-width);\n margin-right: calc(-1 * var(--half-scrollbar-width));\n }\n\n /* when there isn't enough space to view the messages,\n do not overlay the input form on top of the messages */\n /* height < var(--sys-size-27) */\n @container (height < 224px) {\n margin-top: var(--sys-size-4);\n margin-bottom: var(--sys-size-4);\n position: static;\n }\n\n @container --chat-ui-container (width < 400px) {\n /*\n The footer already adds necessary paddings for this state.\n However, without the `padding-bottom` here, the outline in the bottom\n is rendered behind the footer. So, we add 1px space here to make sure\n that the outline is rendered fully.\n */\n padding-bottom: var(--sys-size-1);\n }\n}\n", Ni = "/*\n * Copyright 2026 The Chromium Authors\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n@scope to (devtools-widget > *) {\n :scope {\n width: 100%;\n box-shadow: none;\n padding: var(--sys-size-8);\n background-color: var(--sys-color-surface);\n border-radius: var(--sys-shape-corner-medium);\n }\n\n .export-for-agents-dialog {\n width: var(--sys-size-33); /* 512px */\n max-width: 100%; /* deal with the dialog being squashed on smaller devices */\n }\n\n .export-for-agents-dialog header {\n margin-bottom: var(--sys-size-6);\n\n h1 {\n font: var(--sys-typescale-headline5);\n margin: 0;\n color: var(--sys-color-on-surface);\n }\n }\n\n .export-for-agents-dialog .state-selection {\n display: flex;\n gap: var(--sys-size-5);\n margin: var(--sys-size-7) 0;\n }\n\n .export-for-agents-dialog .state-selection label {\n display: flex;\n align-items: center;\n gap: var(--sys-size-2);\n cursor: pointer;\n font: var(--sys-typescale-body3-regular);\n\n input {\n /* Remove the margin on radio buttons so that the text and the\n * radio button are properly aligned vertically. */\n margin-bottom: 0;\n }\n }\n\n .export-for-agents-dialog textarea {\n width: 100%;\n min-height: var(--sys-size-30); /* 288px */\n max-height: var(--sys-size-34); /* 512px */\n resize: none;\n padding: var(--sys-size-5);\n box-sizing: border-box;\n font-family: var(--monospace-font-family);\n font-size: var(--monospace-font-size);\n background-color: var(--sys-color-surface5);\n color: var(--sys-color-on-surface);\n border-radius: var(--sys-shape-corner-small);\n border: none;\n }\n\n main {\n position: relative;\n }\n\n .prompt-loading {\n position: absolute;\n padding: var(--sys-size-5);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: var(--sys-size-5);\n }\n\n .export-for-agents-dialog .disclaimer {\n margin-top: var(--sys-size-5);\n font: var(--sys-typescale-body4-regular);\n color: var(--sys-color-on-surface-subtle);\n }\n\n .export-for-agents-dialog footer {\n display: flex;\n justify-content: flex-end;\n margin-top: var(--sys-size-6);\n }\n\n .export-for-agents-dialog .right-buttons {\n display: flex;\n gap: var(--sys-size-5);\n }\n}\n", Pi = /* @__PURE__ */ e({
|
|
2615
|
+
DEFAULT_VIEW: () => Bi,
|
|
2616
|
+
ExportForAgentsDialog: () => Vi,
|
|
2617
|
+
StateType: () => Ri
|
|
2618
|
+
}), { html: Fi, render: Ii } = ye, U = {
|
|
2619
|
+
exportForAgents: "Copy to coding agent",
|
|
2620
|
+
copyToClipboard: "Copy to clipboard",
|
|
2621
|
+
copiedToClipboard: "Copied to clipboard",
|
|
2622
|
+
asPrompt: "Summary prompt",
|
|
2623
|
+
asMarkdown: "Full conversation",
|
|
2624
|
+
saveAsMarkdown: "Save as…",
|
|
2625
|
+
generatingSummary: "Generating summary…",
|
|
2626
|
+
disclaimer: "This is an experimental AI feature and won’t always get it right. Double check this text before pasting into another tool."
|
|
2627
|
+
}, Li = ie("panels/ai_assistance/components/ExportForAgentsDialog.ts", U), W = ee.bind(void 0, Li), Ri = /* @__PURE__ */ function(e) {
|
|
2628
|
+
return e.PROMPT = "prompt", e.CONVERSATION = "conversation", e;
|
|
2629
|
+
}({}), zi = "prompt", Bi = (e, t, n) => {
|
|
2630
|
+
let r = e.state.activeType === "prompt", i = W(r ? U.copyToClipboard : U.saveAsMarkdown), a = r ? e.state.promptText : e.state.conversationText;
|
|
2631
|
+
Ii(Fi`
|
|
2632
|
+
<style>${Ni}</style>
|
|
2633
|
+
<div class="export-for-agents-dialog" jslog=${Re("ai-export-for-agents")}>
|
|
2634
|
+
<header>
|
|
2635
|
+
<h1 id="export-for-agents-dialog-title" tabindex="-1">
|
|
2636
|
+
${W(U.exportForAgents)}
|
|
2637
|
+
</h1>
|
|
2638
|
+
</header>
|
|
2639
|
+
<div class="state-selection" role="radiogroup" aria-labelledby="export-for-agents-dialog-title">
|
|
2640
|
+
<label>
|
|
2641
|
+
<input
|
|
2642
|
+
type="radio"
|
|
2643
|
+
value="prompt"
|
|
2644
|
+
name="export-state"
|
|
2645
|
+
.checked=${r}
|
|
2646
|
+
autofocus
|
|
2647
|
+
aria-label=${W(U.asPrompt)}
|
|
2648
|
+
@change=${() => e.onStateChange("prompt")}
|
|
2649
|
+
>
|
|
2650
|
+
${W(U.asPrompt)}
|
|
2651
|
+
</label>
|
|
2652
|
+
<label>
|
|
2653
|
+
<input
|
|
2654
|
+
type="radio"
|
|
2655
|
+
value="conversation"
|
|
2656
|
+
name="export-state"
|
|
2657
|
+
.checked=${!r}
|
|
2658
|
+
aria-label=${W(U.asMarkdown)}
|
|
2659
|
+
@change=${() => e.onStateChange("conversation")}
|
|
2660
|
+
>
|
|
2661
|
+
${W(U.asMarkdown)}
|
|
2662
|
+
</label>
|
|
2663
|
+
</div>
|
|
2664
|
+
<main>
|
|
2665
|
+
${r && e.state.isPromptLoading ? Fi`
|
|
2666
|
+
<span class="prompt-loading">
|
|
2667
|
+
<devtools-spinner></devtools-spinner>
|
|
2668
|
+
${W(U.generatingSummary)}
|
|
2669
|
+
</span>
|
|
2670
|
+
` : v}
|
|
2671
|
+
${r ? Fi`<textarea class="prompt" readonly .value=${e.state.isPromptLoading ? "" : a}></textarea>` : Fi`<textarea class="conversation" readonly .value=${a}></textarea>`}
|
|
2672
|
+
</main>
|
|
2673
|
+
<div class="disclaimer">${W(U.disclaimer)}</div>
|
|
2674
|
+
<footer>
|
|
2675
|
+
<div class="right-buttons">
|
|
2676
|
+
<devtools-button
|
|
2677
|
+
@click=${e.onButtonClick}
|
|
2678
|
+
.jslogContext=${e.jslogContext}
|
|
2679
|
+
.variant=${f.PRIMARY}
|
|
2680
|
+
.disabled=${r && e.state.isPromptLoading}
|
|
2681
|
+
.accessibleLabel=${i}
|
|
2682
|
+
>
|
|
2683
|
+
${i}
|
|
2684
|
+
</devtools-button>
|
|
2685
|
+
</div>
|
|
2686
|
+
</footer>
|
|
2687
|
+
</div>
|
|
2688
|
+
`, n);
|
|
2689
|
+
}, Vi = class e extends Fe {
|
|
2690
|
+
static #e = zi;
|
|
2691
|
+
#t;
|
|
2692
|
+
#n;
|
|
2693
|
+
#r;
|
|
2694
|
+
#i;
|
|
2695
|
+
constructor(t, n = Bi) {
|
|
2696
|
+
super(), this.#n = t.dialog, this.#r = {
|
|
2697
|
+
activeType: e.#e,
|
|
2698
|
+
promptText: typeof t.promptText == "string" ? t.promptText : "",
|
|
2699
|
+
conversationText: t.markdownText,
|
|
2700
|
+
isPromptLoading: typeof t.promptText != "string"
|
|
2701
|
+
}, this.#i = t.onConversationSaveAs, this.#t = n, typeof t.promptText != "string" && t.promptText.then((e) => {
|
|
2702
|
+
this.#r.promptText = e, this.#r.isPromptLoading = !1, this.requestUpdate();
|
|
2703
|
+
}), this.requestUpdate();
|
|
2704
|
+
}
|
|
2705
|
+
static clearPersistedViewState() {
|
|
2706
|
+
e.#e = zi;
|
|
2707
|
+
}
|
|
2708
|
+
#a = (t) => {
|
|
2709
|
+
this.#r.activeType = t, e.#e = t, this.requestUpdate();
|
|
2710
|
+
};
|
|
2711
|
+
performUpdate() {
|
|
2712
|
+
let e, t = "";
|
|
2713
|
+
switch (this.#r.activeType) {
|
|
2714
|
+
case "prompt":
|
|
2715
|
+
t = "ai-export-for-agents.copy-to-clipboard", e = (e) => {
|
|
2716
|
+
e.preventDefault(), Ae.copyText(this.#r.promptText), Kt.show({ message: W(U.copiedToClipboard) }).setAttribute("aria-label", W(U.copiedToClipboard)), this.#n.hide();
|
|
2717
|
+
};
|
|
2718
|
+
break;
|
|
2719
|
+
case "conversation":
|
|
2720
|
+
t = "ai-export-for-agents.save-as-markdown", e = () => {
|
|
2721
|
+
this.#n.hide(), this.#i();
|
|
2722
|
+
};
|
|
2723
|
+
break;
|
|
2724
|
+
}
|
|
2725
|
+
let n = {
|
|
2726
|
+
onButtonClick: e,
|
|
2727
|
+
state: this.#r,
|
|
2728
|
+
onStateChange: this.#a,
|
|
2729
|
+
jslogContext: t
|
|
2730
|
+
};
|
|
2731
|
+
this.#t(n, void 0, this.contentElement);
|
|
2732
|
+
}
|
|
2733
|
+
static show({ promptText: t, markdownText: n, onConversationSaveAs: r }) {
|
|
2734
|
+
let i = new de();
|
|
2735
|
+
i.setAriaLabel(W(U.exportForAgents)), i.setOutsideClickCallback((e) => {
|
|
2736
|
+
e.consume(!0), i.hide();
|
|
2737
|
+
}), i.addCloseButton(), i.setSizeBehavior(me.MEASURE_CONTENT), i.setDimmed(!0);
|
|
2738
|
+
let a = new e({
|
|
2739
|
+
dialog: i,
|
|
2740
|
+
promptText: t,
|
|
2741
|
+
markdownText: n,
|
|
2742
|
+
onConversationSaveAs: r
|
|
2743
|
+
});
|
|
2744
|
+
a.show(i.contentElement), a.updateComplete.then(() => {
|
|
2745
|
+
i.show();
|
|
2746
|
+
});
|
|
2747
|
+
}
|
|
2748
|
+
}, { ref: Hi, repeat: Ui, classMap: Wi } = Oe, { widget: Gi } = Le, Ki = {
|
|
2749
|
+
emptyStateText: "How can I help you?",
|
|
2750
|
+
emptyStateTextGemini: "Where should we start?"
|
|
2751
|
+
}, qi = l, Ji = 1;
|
|
2752
|
+
function Yi(e, t) {
|
|
2753
|
+
let n = e.filter((e) => e.entity === Sr.MODEL), r = n.at(-1);
|
|
2754
|
+
if (r) return t && e.at(-1) === r ? n.at(-2) : r;
|
|
2755
|
+
}
|
|
2756
|
+
var Xi = (e, t, n) => {
|
|
2757
|
+
let r = !!d.devToolsAiAssistanceV2?.enabled, i = Wi({
|
|
2758
|
+
"chat-ui": !0,
|
|
2759
|
+
gemini: Ct(),
|
|
2760
|
+
"ai-v2": r
|
|
2761
|
+
}), a = Wi({
|
|
2762
|
+
"chat-input-widget": !0,
|
|
2763
|
+
sticky: !e.isReadOnly
|
|
2764
|
+
}), o = !r && !e.isLoading, s = Yi(e.messages, e.isLoading);
|
|
2765
|
+
p(h`
|
|
2766
|
+
<style>${Mi}</style>
|
|
2767
|
+
<div class=${i}>
|
|
2768
|
+
<main @scroll=${e.handleScroll} ${Hi((e) => {
|
|
2769
|
+
t.mainElement = e;
|
|
2770
|
+
})}>
|
|
2771
|
+
${e.messages.length > 0 ? h`
|
|
2772
|
+
<div class="messages-container" ${Hi(e.handleMessageContainerRef)}>
|
|
2773
|
+
${Ui(e.messages, (e) => e.id, (t, n) => {
|
|
2774
|
+
let r = n > 0 ? e.messages[n - 1] : null, i = t.entity === Sr.MODEL && r?.entity === Sr.USER ? r.text : "";
|
|
2775
|
+
return Gi(ti, {
|
|
2776
|
+
message: t,
|
|
2777
|
+
isLoading: e.isLoading && n === e.messages.length - 1,
|
|
2778
|
+
isReadOnly: e.isReadOnly,
|
|
2779
|
+
canShowFeedbackForm: e.canShowFeedbackForm,
|
|
2780
|
+
markdownRenderer: e.markdownRenderer,
|
|
2781
|
+
isLastMessage: n === e.messages.length - 1,
|
|
2782
|
+
isFirstMessage: n === 0,
|
|
2783
|
+
prompt: i,
|
|
2784
|
+
shouldShowCSSChangeSummary: t.id === s?.id,
|
|
2785
|
+
onSuggestionClick: e.handleSuggestionClick,
|
|
2786
|
+
onFeedbackSubmit: e.onFeedbackSubmit,
|
|
2787
|
+
onCopyResponseClick: e.onCopyResponseClick,
|
|
2788
|
+
onExportClick: e.exportForAgentsClick,
|
|
2789
|
+
changeSummary: e.changeSummary,
|
|
2790
|
+
walkthrough: { ...e.walkthrough }
|
|
2791
|
+
});
|
|
2792
|
+
})}
|
|
2793
|
+
${o ? Gi(mi, {
|
|
2794
|
+
changeSummary: e.changeSummary ?? "",
|
|
2795
|
+
changeManager: e.changeManager
|
|
2796
|
+
}) : v}
|
|
2797
|
+
</div>
|
|
2798
|
+
` : h`
|
|
2799
|
+
<div class="empty-state-container">
|
|
2800
|
+
<div class="header">
|
|
2801
|
+
<div class="icon">
|
|
2802
|
+
<devtools-icon
|
|
2803
|
+
name="smart-assistant"
|
|
2804
|
+
></devtools-icon>
|
|
2805
|
+
</div>
|
|
2806
|
+
${Ct() ? h`
|
|
2807
|
+
<h1 class='greeting'>Hello</h1>
|
|
2808
|
+
<p class='cta'>${qi(Ki.emptyStateTextGemini)}</p>
|
|
2809
|
+
` : h`<h1>${qi(Ki.emptyStateText)}</h1>`}
|
|
2810
|
+
</div>
|
|
2811
|
+
<div class="empty-state-content">
|
|
2812
|
+
${e.emptyStateSuggestions.map(({ title: t, jslogContext: n }) => h`<devtools-button
|
|
2813
|
+
class="suggestion"
|
|
2814
|
+
@click=${() => e.handleSuggestionClick(t)}
|
|
2815
|
+
.data=${{
|
|
2816
|
+
variant: f.OUTLINED,
|
|
2817
|
+
size: _.REGULAR,
|
|
2818
|
+
title: t,
|
|
2819
|
+
jslogContext: n ?? "suggestion",
|
|
2820
|
+
disabled: e.isTextInputDisabled
|
|
2821
|
+
}}
|
|
2822
|
+
>${t}</devtools-button>`)}
|
|
2823
|
+
</div>
|
|
2824
|
+
</div>
|
|
2825
|
+
`}
|
|
2826
|
+
<devtools-widget class=${a} ${Gi(ji, {
|
|
2827
|
+
isLoading: e.isLoading,
|
|
2828
|
+
blockedByCrossOrigin: e.blockedByCrossOrigin,
|
|
2829
|
+
isTextInputDisabled: e.isTextInputDisabled,
|
|
2830
|
+
inputPlaceholder: e.inputPlaceholder,
|
|
2831
|
+
disclaimerText: e.disclaimerText,
|
|
2832
|
+
context: e.context,
|
|
2833
|
+
isContextSelected: e.isContextSelected,
|
|
2834
|
+
inspectElementToggled: e.inspectElementToggled,
|
|
2835
|
+
multimodalInputEnabled: e.multimodalInputEnabled ?? !1,
|
|
2836
|
+
conversationType: e.conversationType,
|
|
2837
|
+
uploadImageInputEnabled: e.uploadImageInputEnabled ?? !1,
|
|
2838
|
+
isReadOnly: e.isReadOnly,
|
|
2839
|
+
onContextClick: e.onContextClick,
|
|
2840
|
+
onInspectElementClick: e.onInspectElementClick,
|
|
2841
|
+
onTextSubmit: e.onTextSubmit,
|
|
2842
|
+
onCancelClick: e.onCancelClick,
|
|
2843
|
+
onNewConversation: e.onNewConversation,
|
|
2844
|
+
onContextRemoved: e.onContextRemoved,
|
|
2845
|
+
onContextAdd: e.onContextAdd
|
|
2846
|
+
})} ${Hi((e) => {
|
|
2847
|
+
t.input = e;
|
|
2848
|
+
})}></devtools-widget>
|
|
2849
|
+
</main>
|
|
2850
|
+
</div>
|
|
2851
|
+
`, n);
|
|
2852
|
+
}, Zi = class extends HTMLElement {
|
|
2853
|
+
#e = this.attachShadow({ mode: "open" });
|
|
2854
|
+
#t;
|
|
2855
|
+
#n;
|
|
2856
|
+
#r;
|
|
2857
|
+
#i = {};
|
|
2858
|
+
#a = new ResizeObserver(() => this.#u());
|
|
2859
|
+
#o = !0;
|
|
2860
|
+
#s = !1;
|
|
2861
|
+
#c;
|
|
2862
|
+
#l = null;
|
|
2863
|
+
constructor(e, t = Xi) {
|
|
2864
|
+
super(), this.#n = e, this.#c = t;
|
|
2865
|
+
}
|
|
2866
|
+
set props(e) {
|
|
2867
|
+
this.#n = e, this.#_();
|
|
2868
|
+
}
|
|
2869
|
+
connectedCallback() {
|
|
2870
|
+
this.#_(), this.#r && this.#a.observe(this.#r);
|
|
2871
|
+
}
|
|
2872
|
+
disconnectedCallback() {
|
|
2873
|
+
this.#a.disconnect();
|
|
2874
|
+
}
|
|
2875
|
+
focusTextInput() {
|
|
2876
|
+
let e = this.#e.querySelector(".chat-input");
|
|
2877
|
+
e && e.focus();
|
|
2878
|
+
}
|
|
2879
|
+
setInputValue(e) {
|
|
2880
|
+
this.#i.input?.getWidget()?.setInputValue(e);
|
|
2881
|
+
}
|
|
2882
|
+
restoreScrollPosition() {
|
|
2883
|
+
this.#t !== void 0 && this.#i.mainElement && this.#d(this.#t);
|
|
2884
|
+
}
|
|
2885
|
+
scrollToBottom() {
|
|
2886
|
+
this.#i.mainElement && this.#d(this.#i.mainElement.scrollHeight);
|
|
2887
|
+
}
|
|
2888
|
+
#u() {
|
|
2889
|
+
this.#o && this.#i.mainElement && this.#o && this.#d(this.#i.mainElement.scrollHeight);
|
|
2890
|
+
}
|
|
2891
|
+
#d(e) {
|
|
2892
|
+
this.#i.mainElement && (this.#t = e, this.#s = !0, this.#i.mainElement.scrollTop = e);
|
|
2893
|
+
}
|
|
2894
|
+
#f = (e) => {
|
|
2895
|
+
this.#r = e, e ? this.#a.observe(e) : (this.#o = !0, this.#a.disconnect());
|
|
2896
|
+
};
|
|
2897
|
+
#p = (e) => {
|
|
2898
|
+
if (!(!e.target || !(e.target instanceof HTMLElement))) {
|
|
2899
|
+
if (this.#s) {
|
|
2900
|
+
this.#s = !1;
|
|
2901
|
+
return;
|
|
2902
|
+
}
|
|
2903
|
+
this.#t = e.target.scrollTop, this.#o = e.target.scrollTop + e.target.clientHeight + Ji > e.target.scrollHeight;
|
|
2904
|
+
}
|
|
2905
|
+
};
|
|
2906
|
+
#m = (e) => {
|
|
2907
|
+
this.#i.input?.getWidget()?.setInputValue(e), this.#_(), this.focusTextInput(), w.actionTaken(S.AiAssistanceDynamicSuggestionClicked);
|
|
2908
|
+
};
|
|
2909
|
+
async #h() {
|
|
2910
|
+
let e = this.#n.conversationMarkdown.replace(/\*\*Export Timestamp \(UTC\):\*\* .*\n\n/, "");
|
|
2911
|
+
if (this.#l?.markdown === e) return this.#l.summary;
|
|
2912
|
+
try {
|
|
2913
|
+
let t = await this.#n.generateConversationSummary(this.#n.conversationMarkdown);
|
|
2914
|
+
return this.#l = {
|
|
2915
|
+
markdown: e,
|
|
2916
|
+
summary: t
|
|
2917
|
+
}, t;
|
|
2918
|
+
} catch (e) {
|
|
2919
|
+
return console.error(e), "Failed to generate summary.";
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
async #g() {
|
|
2923
|
+
let e = this.#h();
|
|
2924
|
+
Vi.show({
|
|
2925
|
+
promptText: e,
|
|
2926
|
+
markdownText: this.#n.conversationMarkdown,
|
|
2927
|
+
onConversationSaveAs: this.#n.onExportConversation ?? (async () => {})
|
|
2928
|
+
});
|
|
2929
|
+
}
|
|
2930
|
+
#_() {
|
|
2931
|
+
this.#c({
|
|
2932
|
+
...this.#n,
|
|
2933
|
+
handleScroll: this.#p,
|
|
2934
|
+
handleSuggestionClick: this.#m,
|
|
2935
|
+
handleMessageContainerRef: this.#f,
|
|
2936
|
+
exportForAgentsClick: this.#g.bind(this)
|
|
2937
|
+
}, this.#i, this.#e);
|
|
2938
|
+
}
|
|
2939
|
+
};
|
|
2940
|
+
customElements.define("devtools-ai-chat-view", Zi);
|
|
2941
|
+
//#endregion
|
|
2942
|
+
//#region \0qilin-devtools:css:/home/runner/work/QiLin/QiLin/node_modules/.pnpm/chrome-devtools-frontend@1.0.1638082/node_modules/chrome-devtools-frontend/front_end/panels/ai_assistance/components/disabledWidget.css.mjs
|
|
2943
|
+
var Qi = "/*\n * Copyright 2025 The Chromium Authors\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n@scope to (devtools-widget > *) {\n .disabled-view {\n display: flex;\n max-width: var(--sys-size-34);\n border-radius: var(--sys-shape-corner-small);\n box-shadow: var(--sys-elevation-level3);\n background-color: var(--app-color-card-background);\n font: var(--sys-typescale-body4-regular);\n text-wrap: pretty;\n padding: var(--sys-size-6) var(--sys-size-8);\n margin: var(--sys-size-4);\n line-height: var(--sys-size-9);\n\n .disabled-view-icon-container {\n flex-shrink: 0;\n border-radius: var(--sys-shape-corner-extra-small);\n width: var(--sys-size-9);\n height: var(--sys-size-9);\n background: linear-gradient(\n 135deg,\n var(--sys-color-gradient-primary),\n var(--sys-color-gradient-tertiary)\n );\n margin-right: var(--sys-size-5);\n\n devtools-icon {\n margin: var(--sys-size-2);\n width: var(--sys-size-8);\n height: var(--sys-size-8);\n }\n }\n }\n\n .link {\n color: var(--text-link);\n text-decoration: underline;\n cursor: pointer;\n }\n}\n", $i = /* @__PURE__ */ e({
|
|
2944
|
+
DEFAULT_VIEW: () => ia,
|
|
2945
|
+
DisabledWidget: () => aa
|
|
2946
|
+
}), G = {
|
|
2947
|
+
notLoggedIn: "This feature is only available when you are signed into Chrome with your Google account",
|
|
2948
|
+
offline: "Check your internet connection and try again",
|
|
2949
|
+
settingsLink: "AI assistance in Settings",
|
|
2950
|
+
turnOnForStyles: "Turn on {PH1} to get help with understanding CSS styles",
|
|
2951
|
+
turnOnForStylesAndRequests: "Turn on {PH1} to get help with styles and network requests",
|
|
2952
|
+
turnOnForStylesRequestsAndFiles: "Turn on {PH1} to get help with styles, network requests, and files",
|
|
2953
|
+
turnOnForStylesRequestsPerformanceAndFiles: "Turn on {PH1} to get help with styles, network requests, performance, and files",
|
|
2954
|
+
notAvailableInIncognitoMode: "AI assistance is not available in Incognito mode or Guest mode"
|
|
2955
|
+
}, ea = ie("panels/ai_assistance/components/DisabledWidget.ts", G), ta = ee.bind(void 0, ea);
|
|
2956
|
+
function na(e) {
|
|
2957
|
+
switch (e) {
|
|
2958
|
+
case y.NO_ACCOUNT_EMAIL:
|
|
2959
|
+
case y.SYNC_IS_PAUSED: return h`${ta(G.notLoggedIn)}`;
|
|
2960
|
+
case y.NO_INTERNET: return h`${ta(G.offline)}`;
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
function ra(e) {
|
|
2964
|
+
if (e.isOffTheRecord) return h`${ta(G.notAvailableInIncognitoMode)}`;
|
|
2965
|
+
let t = document.createElement("span");
|
|
2966
|
+
t.textContent = ta(G.settingsLink), t.classList.add("link"), se(t), t.addEventListener("click", () => {
|
|
2967
|
+
x.instance().showView("chrome-ai");
|
|
2968
|
+
}), t.setAttribute("jslog", `${Ie("open-ai-settings").track({ click: !0 })}`);
|
|
2969
|
+
let n;
|
|
2970
|
+
return n = e.devToolsAiAssistancePerformanceAgent?.enabled ? Ht(ea, G.turnOnForStylesRequestsPerformanceAndFiles, { PH1: t }) : e.devToolsAiAssistanceFileAgent?.enabled ? Ht(ea, G.turnOnForStylesRequestsAndFiles, { PH1: t }) : e.devToolsAiAssistanceNetworkAgent?.enabled ? Ht(ea, G.turnOnForStylesAndRequests, { PH1: t }) : Ht(ea, G.turnOnForStyles, { PH1: t }), h`${n}`;
|
|
2971
|
+
}
|
|
2972
|
+
var ia = (e, t, n) => {
|
|
2973
|
+
p(h`
|
|
2974
|
+
<style>
|
|
2975
|
+
${Qi}
|
|
2976
|
+
</style>
|
|
2977
|
+
<div class="disabled-view">
|
|
2978
|
+
<div class="disabled-view-icon-container">
|
|
2979
|
+
<devtools-icon name="smart-assistant"></devtools-icon>
|
|
2980
|
+
</div>
|
|
2981
|
+
<div>
|
|
2982
|
+
${e.aidaAvailability === y.AVAILABLE ? ra(e.hostConfig) : na(e.aidaAvailability)}
|
|
2983
|
+
</div>
|
|
2984
|
+
</div>
|
|
2985
|
+
`, n);
|
|
2986
|
+
}, aa = class extends Ue {
|
|
2987
|
+
aidaAvailability = y.NO_ACCOUNT_EMAIL;
|
|
2988
|
+
#e;
|
|
2989
|
+
constructor(e, t = ia) {
|
|
2990
|
+
super(e), this.#e = t;
|
|
2991
|
+
}
|
|
2992
|
+
wasShown() {
|
|
2993
|
+
super.wasShown(), this.requestUpdate();
|
|
2994
|
+
}
|
|
2995
|
+
performUpdate() {
|
|
2996
|
+
let e = d;
|
|
2997
|
+
this.#e({
|
|
2998
|
+
aidaAvailability: this.aidaAvailability,
|
|
2999
|
+
hostConfig: e
|
|
3000
|
+
}, {}, this.contentElement);
|
|
3001
|
+
}
|
|
3002
|
+
}, oa = "/*\n * Copyright 2025 The Chromium Authors\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n@scope to (devtools-widget > *) {\n .ai-assistance-explore-container {\n &,\n * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n }\n\n width: 100%;\n height: fit-content;\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: auto 0;\n font: var(--sys-typescale-headline4);\n gap: var(--sys-size-8);\n padding: var(--sys-size-3);\n overflow: auto;\n scrollbar-gutter: stable both-edges;\n\n .link {\n padding: 0;\n margin: 0 3px;\n }\n\n .header {\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n width: 100%;\n align-items: center;\n justify-content: center;\n justify-self: center;\n gap: var(--sys-size-4);\n\n .icon {\n display: flex;\n justify-content: center;\n align-items: center;\n height: var(--sys-size-14);\n width: var(--sys-size-14);\n border-radius: var(--sys-shape-corner-small);\n background: linear-gradient(\n 135deg,\n var(--sys-color-gradient-primary),\n var(--sys-color-gradient-tertiary)\n );\n }\n\n h1 {\n font: var(--sys-typescale-headline4);\n }\n\n p {\n text-align: center;\n font: var(--sys-typescale-body4-regular);\n }\n\n .link {\n font: var(--sys-typescale-body4-regular);\n }\n }\n\n .content {\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-5);\n align-items: center;\n justify-content: center;\n justify-self: center;\n }\n\n .feature-card {\n display: flex;\n padding: var(--sys-size-4) var(--sys-size-6);\n gap: 10px;\n background-color: var(--sys-color-surface2);\n border-radius: var(--sys-shape-corner-medium-small);\n width: 100%;\n align-items: center;\n\n .feature-card-icon {\n min-width: var(--sys-size-12);\n min-height: var(--sys-size-12);\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: var(--sys-color-tonal-container);\n border-radius: var(--sys-shape-corner-full);\n\n devtools-icon {\n width: 18px;\n height: 18px;\n }\n }\n\n .feature-card-content {\n h3 {\n font: var(--sys-typescale-body3-medium);\n }\n\n p {\n font: var(--sys-typescale-body4-regular);\n line-height: 18px;\n }\n }\n }\n }\n\n .ai-assistance-explore-footer {\n flex-shrink: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding-block: var(--sys-size-3);\n font: var(--sys-typescale-body5-regular);\n border-top: 1px solid var(--sys-color-divider);\n text-wrap: balance;\n text-align: center;\n\n p {\n margin: 0;\n padding: 0;\n }\n }\n}\n", sa = /* @__PURE__ */ e({
|
|
3003
|
+
DEFAULT_VIEW: () => ua,
|
|
3004
|
+
ExploreWidget: () => da
|
|
3005
|
+
}), ca = {
|
|
3006
|
+
Explore: "Explore AI assistance",
|
|
3007
|
+
learnAbout: "Learn about AI in DevTools"
|
|
3008
|
+
}, la = l, ua = (e, t, n) => {
|
|
3009
|
+
function r(e) {
|
|
3010
|
+
return h`Open
|
|
3011
|
+
<button
|
|
3012
|
+
class="link"
|
|
3013
|
+
role="link"
|
|
3014
|
+
jslog=${nt(e.jslogContext).track({ click: !0 })}
|
|
3015
|
+
@click=${e.onClick}
|
|
3016
|
+
>${e.panelName}</button>
|
|
3017
|
+
${e.text}`;
|
|
3018
|
+
}
|
|
3019
|
+
p(h`
|
|
3020
|
+
<style>
|
|
3021
|
+
${oa}
|
|
3022
|
+
</style>
|
|
3023
|
+
<div class="ai-assistance-explore-container">
|
|
3024
|
+
<div class="header">
|
|
3025
|
+
<div class="icon">
|
|
3026
|
+
<devtools-icon name="smart-assistant"></devtools-icon>
|
|
3027
|
+
</div>
|
|
3028
|
+
<h1>${la(ca.Explore)}</h1>
|
|
3029
|
+
<p>
|
|
3030
|
+
To chat about an item, right-click and select${" "}
|
|
3031
|
+
<strong>Ask AI</strong>.
|
|
3032
|
+
<button
|
|
3033
|
+
class="link"
|
|
3034
|
+
role="link"
|
|
3035
|
+
jslog=${nt("open-ai-settings").track({ click: !0 })}
|
|
3036
|
+
@click=${() => {
|
|
3037
|
+
x.instance().showView("chrome-ai");
|
|
3038
|
+
}}
|
|
3039
|
+
>${la(ca.learnAbout)}
|
|
3040
|
+
</button>
|
|
3041
|
+
</p>
|
|
3042
|
+
</div>
|
|
3043
|
+
<div class="content">
|
|
3044
|
+
${e.featureCards.map((e) => h`
|
|
3045
|
+
<div class="feature-card">
|
|
3046
|
+
<div class="feature-card-icon">
|
|
3047
|
+
<devtools-icon name=${e.icon}></devtools-icon>
|
|
3048
|
+
</div>
|
|
3049
|
+
<div class="feature-card-content">
|
|
3050
|
+
<h3>${e.heading}</h3>
|
|
3051
|
+
<p>${r(e)}</p>
|
|
3052
|
+
</div>
|
|
3053
|
+
</div>
|
|
3054
|
+
`)}
|
|
3055
|
+
</div>
|
|
3056
|
+
</div>
|
|
3057
|
+
`, n);
|
|
3058
|
+
}, da = class extends Ue {
|
|
3059
|
+
#e;
|
|
3060
|
+
constructor(e, t = ua) {
|
|
3061
|
+
super(e), this.#e = t;
|
|
3062
|
+
}
|
|
3063
|
+
wasShown() {
|
|
3064
|
+
super.wasShown(), this.requestUpdate();
|
|
3065
|
+
}
|
|
3066
|
+
performUpdate() {
|
|
3067
|
+
let e = d, t = [];
|
|
3068
|
+
e.devToolsFreestyler?.enabled && x.instance().hasView("elements") && t.push({
|
|
3069
|
+
icon: "brush-2",
|
|
3070
|
+
heading: "CSS styles",
|
|
3071
|
+
jslogContext: "open-elements-panel",
|
|
3072
|
+
onClick: () => {
|
|
3073
|
+
x.instance().showView("elements");
|
|
3074
|
+
},
|
|
3075
|
+
panelName: "Elements",
|
|
3076
|
+
text: "to ask about CSS styles"
|
|
3077
|
+
}), e.devToolsAiAssistanceNetworkAgent?.enabled && x.instance().hasView("network") && t.push({
|
|
3078
|
+
icon: "arrow-up-down",
|
|
3079
|
+
heading: "Network",
|
|
3080
|
+
jslogContext: "open-network-panel",
|
|
3081
|
+
onClick: () => {
|
|
3082
|
+
x.instance().showView("network");
|
|
3083
|
+
},
|
|
3084
|
+
panelName: "Network",
|
|
3085
|
+
text: "to ask about a request's details"
|
|
3086
|
+
}), e.devToolsAiAssistanceFileAgent?.enabled && x.instance().hasView("sources") && t.push({
|
|
3087
|
+
icon: "document",
|
|
3088
|
+
heading: "Files",
|
|
3089
|
+
jslogContext: "open-sources-panel",
|
|
3090
|
+
onClick: () => {
|
|
3091
|
+
x.instance().showView("sources");
|
|
3092
|
+
},
|
|
3093
|
+
panelName: "Sources",
|
|
3094
|
+
text: "to ask about a file's content"
|
|
3095
|
+
}), e.devToolsAiAssistancePerformanceAgent?.enabled && x.instance().hasView("timeline") && t.push({
|
|
3096
|
+
icon: "performance",
|
|
3097
|
+
heading: "Performance",
|
|
3098
|
+
jslogContext: "open-performance-panel",
|
|
3099
|
+
onClick: () => {
|
|
3100
|
+
x.instance().showView("timeline");
|
|
3101
|
+
},
|
|
3102
|
+
panelName: "Performance",
|
|
3103
|
+
text: "to ask about a trace item"
|
|
3104
|
+
}), this.#e({ featureCards: t }, {}, this.contentElement);
|
|
3105
|
+
}
|
|
3106
|
+
}, fa = "/*\n * Copyright 2026 The Chromium Authors\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n@scope to (devtools-widget > *) {\n :scope {\n width: 100%;\n box-shadow: none;\n padding: var(--sys-size-8);\n background-color: var(--sys-color-surface);\n border-radius: var(--sys-shape-corner-medium);\n }\n\n .opt-in-change-dialog {\n width: var(--sys-size-33);\n max-width: 100%;\n }\n\n header {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--sys-size-8);\n margin-bottom: var(--sys-size-8);\n\n h1 {\n margin: 0;\n color: var(--sys-color-on-surface);\n font: var(--sys-typescale-headline5);\n }\n\n .header-icon-container {\n background: linear-gradient(\n 135deg,\n var(--sys-color-gradient-primary),\n var(--sys-color-gradient-tertiary)\n );\n border-radius: var(--sys-size-4);\n height: var(--sys-size-14);\n width: var(--sys-size-14);\n display: flex;\n align-items: center;\n justify-content: center;\n\n devtools-icon {\n width: var(--sys-size-9);\n height: var(--sys-size-9);\n }\n }\n }\n\n main {\n background-color: var(--sys-color-surface4);\n border-radius: var(--sys-shape-corner-medium-small);\n padding: var(--sys-size-8);\n display: flex;\n flex-direction: column;\n gap: var(--sys-size-6);\n margin-bottom: var(--sys-size-8);\n\n .item {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--sys-size-8);\n\n devtools-icon {\n width: var(--sys-size-8);\n height: var(--sys-size-8);\n flex-shrink: 0;\n color: var(--sys-color-on-surface-subtle);\n }\n\n .text {\n font: var(--sys-typescale-body4);\n color: var(--sys-color-on-surface);\n }\n }\n }\n\n footer {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n\n .right-buttons {\n display: flex;\n gap: var(--sys-size-5);\n }\n }\n}\n", pa = /* @__PURE__ */ e({
|
|
3107
|
+
DEFAULT_VIEW: () => _a,
|
|
3108
|
+
OptInChangeDialog: () => va
|
|
3109
|
+
}), { html: ma, render: ha } = ye, K = {
|
|
3110
|
+
title: "AI assistance just got better",
|
|
3111
|
+
integrationPoint: "AI assistance is now integrated with Application and Lighthouse panels, and pulls context from data sources simultaneously",
|
|
3112
|
+
widgetPoint: "Use widgets to verify results or jump to source data for select debugging cases",
|
|
3113
|
+
privacyDisclaimer: "Chat messages, data accessible for this site via DevTools panels and Web APIs, and items you select such as network requests, files, and performance traces are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won’t always get it right.",
|
|
3114
|
+
privacyDisclaimerEnterpriseNoLogging: "Chat messages, data accessible for this site via DevTools panels and Web APIs, and items you select such as network requests, files, and performance traces are sent to Google. The content submitted to and generated by this feature will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right.",
|
|
3115
|
+
manageSettings: "Manage in settings",
|
|
3116
|
+
gotIt: "Got it"
|
|
3117
|
+
}, ga = ie("panels/ai_assistance/components/OptInChangeDialog.ts", K), q = ee.bind(void 0, ga), _a = (e, t, n) => {
|
|
3118
|
+
let r = e.loggingEnabled ? q(K.privacyDisclaimer) : q(K.privacyDisclaimerEnterpriseNoLogging);
|
|
3119
|
+
ha(ma`
|
|
3120
|
+
<style>${fa}</style>
|
|
3121
|
+
<div class="opt-in-change-dialog" jslog=${Re("ai-v2-opt-in-change-dialog")}>
|
|
3122
|
+
<header>
|
|
3123
|
+
<div class="header-icon-container">
|
|
3124
|
+
<devtools-icon name="smart-assistant" role="presentation"></devtools-icon>
|
|
3125
|
+
</div>
|
|
3126
|
+
<h1 tabindex="-1">
|
|
3127
|
+
${q(K.title)}
|
|
3128
|
+
</h1>
|
|
3129
|
+
</header>
|
|
3130
|
+
<main>
|
|
3131
|
+
<div class="item">
|
|
3132
|
+
<devtools-icon name="lightbulb-spark" role="presentation"></devtools-icon>
|
|
3133
|
+
<div class="text">${q(K.integrationPoint)}</div>
|
|
3134
|
+
</div>
|
|
3135
|
+
<div class="item">
|
|
3136
|
+
<devtools-icon name="flowsheet" role="presentation"></devtools-icon>
|
|
3137
|
+
<div class="text">${q(K.widgetPoint)}</div>
|
|
3138
|
+
</div>
|
|
3139
|
+
<div class="item">
|
|
3140
|
+
<devtools-icon name="google" role="presentation"></devtools-icon>
|
|
3141
|
+
<div class="text">${r}</div>
|
|
3142
|
+
</div>
|
|
3143
|
+
</main>
|
|
3144
|
+
<footer>
|
|
3145
|
+
<div class="right-buttons">
|
|
3146
|
+
<devtools-button
|
|
3147
|
+
@click=${e.onManageSettings}
|
|
3148
|
+
.jslogContext=${"ai-assistance-v2-opt-in.manage-settings"}
|
|
3149
|
+
.variant=${f.OUTLINED}
|
|
3150
|
+
.accessibleLabel=${q(K.manageSettings)}
|
|
3151
|
+
>
|
|
3152
|
+
${q(K.manageSettings)}
|
|
3153
|
+
</devtools-button>
|
|
3154
|
+
<devtools-button
|
|
3155
|
+
@click=${e.onGotIt}
|
|
3156
|
+
.jslogContext=${"ai-assistance-v2-opt-in.got-it"}
|
|
3157
|
+
.variant=${f.PRIMARY}
|
|
3158
|
+
.accessibleLabel=${q(K.gotIt)}
|
|
3159
|
+
>
|
|
3160
|
+
${q(K.gotIt)}
|
|
3161
|
+
</devtools-button>
|
|
3162
|
+
</div>
|
|
3163
|
+
</footer>
|
|
3164
|
+
</div>
|
|
3165
|
+
`, n);
|
|
3166
|
+
}, va = class e extends Fe {
|
|
3167
|
+
#e;
|
|
3168
|
+
#t;
|
|
3169
|
+
#n;
|
|
3170
|
+
constructor(e, t = _a) {
|
|
3171
|
+
super(), this.#t = e.onGotIt, this.#n = e.onManageSettings, this.#e = t, this.requestUpdate();
|
|
3172
|
+
}
|
|
3173
|
+
performUpdate() {
|
|
3174
|
+
let e = d.aidaAvailability?.enterprisePolicyValue !== ae.ALLOW_WITHOUT_LOGGING, t = {
|
|
3175
|
+
onGotIt: this.#t,
|
|
3176
|
+
onManageSettings: this.#n,
|
|
3177
|
+
loggingEnabled: e
|
|
3178
|
+
};
|
|
3179
|
+
this.#e(t, void 0, this.contentElement);
|
|
3180
|
+
}
|
|
3181
|
+
focusTitle() {
|
|
3182
|
+
this.contentElement.querySelector("h1")?.focus();
|
|
3183
|
+
}
|
|
3184
|
+
static show(t) {
|
|
3185
|
+
let n = new de();
|
|
3186
|
+
n.setAriaLabel(q(K.title)), n.setOutsideClickCallback((e) => e.consume(!0)), n.setCloseOnEscape(!1), n.setSizeBehavior(me.MEASURE_CONTENT), n.setDimmed(!0);
|
|
3187
|
+
let r = new e({
|
|
3188
|
+
onGotIt: () => {
|
|
3189
|
+
n.hide(), t.onGotIt();
|
|
3190
|
+
},
|
|
3191
|
+
onManageSettings: () => {
|
|
3192
|
+
n.hide(), t.onManageSettings();
|
|
3193
|
+
}
|
|
3194
|
+
});
|
|
3195
|
+
r.show(n.contentElement), r.updateComplete.then(() => {
|
|
3196
|
+
n.show(), r.focusTitle();
|
|
3197
|
+
});
|
|
3198
|
+
}
|
|
3199
|
+
}, { html: ya } = _e, { until: ba } = Oe, xa = class extends qn {
|
|
3200
|
+
mainFrameId;
|
|
3201
|
+
lookupEvent;
|
|
3202
|
+
constructor(e = "", t = () => null) {
|
|
3203
|
+
super(), this.mainFrameId = e, this.lookupEvent = t;
|
|
3204
|
+
}
|
|
3205
|
+
templateForToken(e) {
|
|
3206
|
+
if (e.type === "link" && e.href.startsWith("#")) {
|
|
3207
|
+
if (e.href.startsWith("#node-")) {
|
|
3208
|
+
let t = Number(e.href.replace("#node-", ""));
|
|
3209
|
+
return ya`<span>${ba(this.#e(t, e.text).then((t) => t || e.text), e.text)}</span>`;
|
|
3210
|
+
}
|
|
3211
|
+
let t = this.lookupEvent(e.href.slice(1));
|
|
3212
|
+
if (!t) return ya`${e.text}`;
|
|
3213
|
+
let n = e.text, r = "";
|
|
3214
|
+
return Gt(t) ? r = t.args.data.url : n += ` (${t.name})`, ya`<a href="#" draggable=false .title=${r} @click=${(e) => {
|
|
3215
|
+
e.stopPropagation(), u(new Xe(t));
|
|
3216
|
+
}}>${n}</a>`;
|
|
3217
|
+
}
|
|
3218
|
+
return super.templateForToken(e);
|
|
3219
|
+
}
|
|
3220
|
+
async #e(e, t) {
|
|
3221
|
+
if (e === void 0) return;
|
|
3222
|
+
let n = m.instance().primaryPageTarget()?.model(T);
|
|
3223
|
+
if (!n) return;
|
|
3224
|
+
let r = (await n.pushNodesByBackendIdsToFrontend(new Set([e])))?.get(e);
|
|
3225
|
+
if (r && r.frameId() === this.mainFrameId) return xt.instance().linkify(r, { textContent: t });
|
|
3226
|
+
}
|
|
3227
|
+
}, { html: J } = _e, { until: Sa } = Oe, Ca = class e extends qn {
|
|
3228
|
+
mainFrameId;
|
|
3229
|
+
constructor(e = "") {
|
|
3230
|
+
super(), this.mainFrameId = e;
|
|
3231
|
+
}
|
|
3232
|
+
#e(t) {
|
|
3233
|
+
if (!Array.isArray(t) || t.length === 0 || typeof t[0] != "object" || t[0] === null) return null;
|
|
3234
|
+
let n = Object.keys(t[0]);
|
|
3235
|
+
if (![
|
|
3236
|
+
"Problem",
|
|
3237
|
+
"Element",
|
|
3238
|
+
"NodeId",
|
|
3239
|
+
"Details"
|
|
3240
|
+
].every((e) => n.includes(e))) return null;
|
|
3241
|
+
let r = n.indexOf("Problem");
|
|
3242
|
+
if (r > -1) {
|
|
3243
|
+
let e = n.splice(r, 1);
|
|
3244
|
+
n.unshift(...e);
|
|
3245
|
+
}
|
|
3246
|
+
return J`
|
|
3247
|
+
<table style="width: 100%;">
|
|
3248
|
+
<thead>
|
|
3249
|
+
<tr>
|
|
3250
|
+
${n.map((e) => J`<th style="text-align: left;">${e === "NodeId" ? "" : e}</th>`)}
|
|
3251
|
+
</tr>
|
|
3252
|
+
</thead>
|
|
3253
|
+
<tbody>
|
|
3254
|
+
${t.flatMap((t) => J`
|
|
3255
|
+
<tr>
|
|
3256
|
+
${n.map((e) => e === "NodeId" ? J`<td>${this.#n(t[e])}</td>` : e === "Details" ? J`<td><a href="#" @click=${this.#t}>Details</a></td>` : J`<td>${t[e]}</td>`)}
|
|
3257
|
+
</tr>
|
|
3258
|
+
<tr class="details-row" style="display: none;">
|
|
3259
|
+
<td colspan=${n.length} style="background-color: #f0f0f0; padding: 1em;">
|
|
3260
|
+
<devtools-markdown-view .data=${{
|
|
3261
|
+
tokens: qt(t.Details),
|
|
3262
|
+
renderer: new e(this.mainFrameId)
|
|
3263
|
+
}}></devtools-markdown-view>
|
|
3264
|
+
</td>
|
|
3265
|
+
</tr>
|
|
3266
|
+
`)}
|
|
3267
|
+
</tbody>
|
|
3268
|
+
</table>
|
|
3269
|
+
<br><div>To investigate these problems, please click one of the provided links (above), to set as context, and ask me further questions about the problem.</div>
|
|
3270
|
+
`;
|
|
3271
|
+
}
|
|
3272
|
+
templateForToken(e) {
|
|
3273
|
+
if (e.type === "code") try {
|
|
3274
|
+
let t = JSON.parse(e.text), n = this.#e(t);
|
|
3275
|
+
if (n) return n;
|
|
3276
|
+
} catch {}
|
|
3277
|
+
if (e.type === "link" && e.href.startsWith("#")) {
|
|
3278
|
+
let t;
|
|
3279
|
+
if (e.href.startsWith("#node-") ? t = Number(e.href.replace("#node-", "")) : e.href.startsWith("#") && (t = Number(e.href.replace("#", ""))), t) return J`<span>${Sa(this.#i(t, e.text).then((t) => t || e.text), e.text)}</span>`;
|
|
3280
|
+
}
|
|
3281
|
+
return super.templateForToken(e);
|
|
3282
|
+
}
|
|
3283
|
+
#t(e) {
|
|
3284
|
+
e.preventDefault();
|
|
3285
|
+
let t = e.target, n = t.closest("tr");
|
|
3286
|
+
if (!n) return;
|
|
3287
|
+
let r = n.nextElementSibling;
|
|
3288
|
+
r?.classList.contains("details-row") && (r.style.display === "none" ? (r.style.display = "table-row", t.textContent = "Hide") : (r.style.display = "none", t.textContent = "Details"));
|
|
3289
|
+
}
|
|
3290
|
+
#n(e) {
|
|
3291
|
+
if (e.indexOf(",") === -1) {
|
|
3292
|
+
let t = Number(e);
|
|
3293
|
+
return isNaN(t) ? J`${e}` : this.#r(t);
|
|
3294
|
+
}
|
|
3295
|
+
return J`${e.split(",").map((e) => e.trim()).filter(Boolean).map((e) => {
|
|
3296
|
+
let t = Number(e);
|
|
3297
|
+
return isNaN(t) ? J`<div>${e}</div>` : J`<div>${this.#r(t)}</div>`;
|
|
3298
|
+
})}`;
|
|
3299
|
+
}
|
|
3300
|
+
#r(e) {
|
|
3301
|
+
let t = "link";
|
|
3302
|
+
return J`<span>${Sa(this.#i(e, t).then((e) => e || t), t)}</span>`;
|
|
3303
|
+
}
|
|
3304
|
+
async #i(e, t) {
|
|
3305
|
+
if (e === void 0) return;
|
|
3306
|
+
let n = m.instance().primaryPageTarget()?.model(T);
|
|
3307
|
+
if (!n) return;
|
|
3308
|
+
let r = (await n.pushNodesByBackendIdsToFrontend(new Set([e])))?.get(e);
|
|
3309
|
+
if (r && r.frameId() === this.mainFrameId) return xt.instance().linkify(r, { textContent: t });
|
|
3310
|
+
}
|
|
3311
|
+
}, wa = /* @__PURE__ */ e({ saveToDisk: () => Ta });
|
|
3312
|
+
async function Ta(e) {
|
|
3313
|
+
let n = new rt(e.getConversationMarkdown(), !1, "text/markdown"), r = t(e.title || "") || "conversation";
|
|
3314
|
+
r.length > 52 && (r = r.substring(0, 52));
|
|
3315
|
+
let i = `devtools_${r}.md`;
|
|
3316
|
+
await it.instance().save(i, n, !0), it.instance().close(i);
|
|
3317
|
+
}
|
|
3318
|
+
//#endregion
|
|
3319
|
+
//#region node_modules/.pnpm/chrome-devtools-frontend@1.0.1638082/node_modules/chrome-devtools-frontend/front_end/panels/ai_assistance/AiAssistancePanel.ts
|
|
3320
|
+
var { html: Y } = ye, { widget: Ea } = Le, Da = "https://crbug.com/364805393", Oa = "https://developer.chrome.com/docs/devtools/ai-assistance", ka = 700, Aa = 400, X = {
|
|
3321
|
+
newChat: "New chat",
|
|
3322
|
+
help: "Help",
|
|
3323
|
+
settings: "Settings",
|
|
3324
|
+
sendFeedback: "Send feedback",
|
|
3325
|
+
newChatCreated: "New chat created",
|
|
3326
|
+
chatDeleted: "Chat deleted",
|
|
3327
|
+
history: "History",
|
|
3328
|
+
deleteChat: "Delete local chat",
|
|
3329
|
+
clearChatHistory: "Clear local chats",
|
|
3330
|
+
exportConversation: "Export conversation",
|
|
3331
|
+
noPastConversations: "No past conversations",
|
|
3332
|
+
followTheSteps: "Follow the steps above to ask a question",
|
|
3333
|
+
inputDisclaimerForEmptyState: "This is an experimental AI feature and won't always get it right.",
|
|
3334
|
+
responseCopiedToClipboard: "Response copied to clipboard"
|
|
3335
|
+
}, Z = {
|
|
3336
|
+
answerLoading: "Answer loading",
|
|
3337
|
+
answerReady: "Answer ready",
|
|
3338
|
+
analyzingData: "Analyzing data",
|
|
3339
|
+
crossOriginError: "To talk about data from another origin, start a new chat",
|
|
3340
|
+
inputPlaceholderForStyling: "Ask a question about the selected element",
|
|
3341
|
+
inputPlaceholderForNetwork: "Ask a question about the selected network request",
|
|
3342
|
+
inputPlaceholderForFile: "Ask a question about the selected file",
|
|
3343
|
+
inputPlaceholderForPerformanceWithNoRecording: "Record a performance trace and select an item to ask a question",
|
|
3344
|
+
inputPlaceholderForStylingNoContext: "Select an element to ask a question",
|
|
3345
|
+
inputPlaceholderForNetworkNoContext: "Select a network request to ask a question",
|
|
3346
|
+
inputPlaceholderForFileNoContext: "Select a file to ask a question",
|
|
3347
|
+
inputPlaceholderForPerformanceTrace: "Ask a question about the selected performance trace",
|
|
3348
|
+
inputPlaceholderForPerformanceTraceNoContext: "Record or select a performance trace to ask a question",
|
|
3349
|
+
inputPlaceholderForNoContext: "Ask AI Assistance",
|
|
3350
|
+
inputPlaceholderForNoContextBranded: "Ask Gemini",
|
|
3351
|
+
inputDisclaimerForStyling: "Chat messages and any data the inspected page can access via Web APIs are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won’t always get it right.",
|
|
3352
|
+
inputDisclaimerForStylingEnterpriseNoLogging: "Chat messages and any data the inspected page can access via Web APIs are sent to Google. The content you submit and that is generated by this feature will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right.",
|
|
3353
|
+
inputDisclaimerForNetwork: "Chat messages and the selected network request are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won’t always get it right.",
|
|
3354
|
+
inputDisclaimerForNetworkEnterpriseNoLogging: "Chat messages and the selected network request are sent to Google. The content you submit and that is generated by this feature will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right.",
|
|
3355
|
+
inputDisclaimerForFile: "Chat messages and the selected file are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won't always get it right.",
|
|
3356
|
+
inputDisclaimerForFileEnterpriseNoLogging: "Chat messages and the selected file are sent to Google. The content you submit and that is generated by this feature will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right.",
|
|
3357
|
+
inputDisclaimerForPerformance: "Chat messages and trace data from your performance trace are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won't always get it right.",
|
|
3358
|
+
inputDisclaimerForPerformanceEnterpriseNoLogging: "Chat messages and data from your performance trace are sent to Google. The content you submit and that is generated by this feature will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right.",
|
|
3359
|
+
inputDisclaimerForNoContext: "Chat messages, any data the inspected page can see using Web APIs, and the items you select such as files, network requests, and performance traces are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won’t always get it right.",
|
|
3360
|
+
inputDisclaimerForNoContextEnterpriseNoLogging: "Chat messages, any data the inspected page can see using Web APIs, and the items you select such as files, network requests, and performance traces are sent to Google. This data will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right.",
|
|
3361
|
+
inputPlaceholderForAccessibility: "Ask a question about the selected Lighthouse report",
|
|
3362
|
+
inputPlaceholderForAccessibilityNoContext: "Generate a Lighthouse report to ask a question",
|
|
3363
|
+
inputDisclaimerForAccessibility: "Chat messages and the selected Lighthouse report are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won’t always get it right.",
|
|
3364
|
+
inputDisclaimerForAccessibilityEnterpriseNoLogging: "Chat messages and the selected Lighthouse report are sent to Google. The content you submit and that is generated by this feature will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right.",
|
|
3365
|
+
inputDisclaimerV2: "Chat messages, data accessible for this site via DevTools panels and Web APIs, and items you select such as network requests, files, and performance traces are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won’t always get it right.",
|
|
3366
|
+
inputDisclaimerEnterpriseNoLoggingV2: "Chat messages, data accessible for this site via DevTools panels and Web APIs, and items you select such as network requests, files, and performance traces are sent to Google. The content submitted to and generated by this feature will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right."
|
|
3367
|
+
}, ja = ie("panels/ai_assistance/AiAssistancePanel.ts", X), Q = ee.bind(void 0, ja), $ = l;
|
|
3368
|
+
function Ma(e) {
|
|
3369
|
+
return e && (qe.instance().isEnabled("emulationCapabilities") || e.nodeType() === Node.ELEMENT_NODE) ? e : null;
|
|
3370
|
+
}
|
|
3371
|
+
async function Na(e) {
|
|
3372
|
+
let t = e?.selectedContext;
|
|
3373
|
+
if (t) {
|
|
3374
|
+
let e = await t.getSuggestions();
|
|
3375
|
+
if (e) return e;
|
|
3376
|
+
}
|
|
3377
|
+
if (!e?.type || e.isReadOnly) return [];
|
|
3378
|
+
switch (e.type) {
|
|
3379
|
+
case O.STYLING: return [
|
|
3380
|
+
{
|
|
3381
|
+
title: "What can you help me with?",
|
|
3382
|
+
jslogContext: "styling-default"
|
|
3383
|
+
},
|
|
3384
|
+
{
|
|
3385
|
+
title: "Why isn’t this element visible?",
|
|
3386
|
+
jslogContext: "styling-default"
|
|
3387
|
+
},
|
|
3388
|
+
{
|
|
3389
|
+
title: qe.instance().isEnabled("emulationCapabilities") ? "Are there display issues on this page for people using an Android phone?" : "How do I center this element?",
|
|
3390
|
+
jslogContext: "styling-default"
|
|
3391
|
+
}
|
|
3392
|
+
];
|
|
3393
|
+
case O.FILE: return [
|
|
3394
|
+
{
|
|
3395
|
+
title: "What does this script do?",
|
|
3396
|
+
jslogContext: "file-default"
|
|
3397
|
+
},
|
|
3398
|
+
{
|
|
3399
|
+
title: "Is the script optimized for performance?",
|
|
3400
|
+
jslogContext: "file-default"
|
|
3401
|
+
},
|
|
3402
|
+
{
|
|
3403
|
+
title: "Does the script handle user input safely?",
|
|
3404
|
+
jslogContext: "file-default"
|
|
3405
|
+
}
|
|
3406
|
+
];
|
|
3407
|
+
case O.ACCESSIBILITY: return [{
|
|
3408
|
+
title: "How can I fix accessibility issues on my page?",
|
|
3409
|
+
jslogContext: "accessibility-default"
|
|
3410
|
+
}, {
|
|
3411
|
+
title: "What accessibility issues exist on my page?",
|
|
3412
|
+
jslogContext: "accessibility-default"
|
|
3413
|
+
}];
|
|
3414
|
+
case O.NETWORK: return [
|
|
3415
|
+
{
|
|
3416
|
+
title: "Why is this network request taking so long?",
|
|
3417
|
+
jslogContext: "network-default"
|
|
3418
|
+
},
|
|
3419
|
+
{
|
|
3420
|
+
title: "Are there any security headers present?",
|
|
3421
|
+
jslogContext: "network-default"
|
|
3422
|
+
},
|
|
3423
|
+
{
|
|
3424
|
+
title: "Why is the request failing?",
|
|
3425
|
+
jslogContext: "network-default"
|
|
3426
|
+
}
|
|
3427
|
+
];
|
|
3428
|
+
case O.PERFORMANCE: return [{
|
|
3429
|
+
title: "What performance issues exist with my page?",
|
|
3430
|
+
jslogContext: "performance-default"
|
|
3431
|
+
}];
|
|
3432
|
+
case O.NONE: return [
|
|
3433
|
+
{
|
|
3434
|
+
title: "What can you help me with?",
|
|
3435
|
+
jslogContext: "empty"
|
|
3436
|
+
},
|
|
3437
|
+
{
|
|
3438
|
+
title: "What performance issues exist on the page?",
|
|
3439
|
+
jslogContext: "empty"
|
|
3440
|
+
},
|
|
3441
|
+
{
|
|
3442
|
+
title: "What are the slowest network requests on this page?",
|
|
3443
|
+
jslogContext: "empty"
|
|
3444
|
+
}
|
|
3445
|
+
];
|
|
3446
|
+
case O.STORAGE: return [{
|
|
3447
|
+
title: "How is localStorage used on this page?",
|
|
3448
|
+
jslogContext: "storage-default"
|
|
3449
|
+
}, {
|
|
3450
|
+
title: "How is sessionStorage used on this page?",
|
|
3451
|
+
jslogContext: "storage-default"
|
|
3452
|
+
}];
|
|
3453
|
+
default: r(e.type, "Unknown conversation type");
|
|
3454
|
+
}
|
|
3455
|
+
}
|
|
3456
|
+
function Pa(e) {
|
|
3457
|
+
let t = e?.selectedContext;
|
|
3458
|
+
if (t instanceof Vt) {
|
|
3459
|
+
if (!t.external) {
|
|
3460
|
+
let e = t.getItem();
|
|
3461
|
+
return new xa(e.parsedTrace.data.Meta.mainFrameId, e.lookupEvent.bind(e));
|
|
3462
|
+
}
|
|
3463
|
+
} else if (e?.type === O.PERFORMANCE) return new xa();
|
|
3464
|
+
else if (qe.instance().isEnabled("emulationCapabilities") && e?.type === O.STYLING && m.instance().primaryPageTarget()?.model(T)) {
|
|
3465
|
+
let e = ((m.instance().primaryPageTarget()?.model(T))?.target().model(Ee))?.mainFrame?.id;
|
|
3466
|
+
return new Ca(e);
|
|
3467
|
+
} else if (e?.type === O.ACCESSIBILITY) {
|
|
3468
|
+
let e = (m.instance().primaryPageTarget()?.model(T))?.existingDocument()?.documentURL;
|
|
3469
|
+
return new Xn(e);
|
|
3470
|
+
}
|
|
3471
|
+
return new qn();
|
|
3472
|
+
}
|
|
3473
|
+
var Fa = /* @__PURE__ */ function(e) {
|
|
3474
|
+
return e.DISABLED_VIEW = "disabled-view", e.CHAT_VIEW = "chat-view", e.EXPLORE_VIEW = "explore-view", e;
|
|
3475
|
+
}({});
|
|
3476
|
+
function Ia(e) {
|
|
3477
|
+
let t = !!d.devToolsAiAssistanceV2?.enabled;
|
|
3478
|
+
return Y`
|
|
3479
|
+
<div class="toolbar-container" role="toolbar" jslog=${Ve()}>
|
|
3480
|
+
<devtools-toolbar class="freestyler-left-toolbar" role="presentation">
|
|
3481
|
+
${e.showChatActions ? Y`<devtools-button
|
|
3482
|
+
title=${Q(X.newChat)}
|
|
3483
|
+
aria-label=${Q(X.newChat)}
|
|
3484
|
+
.iconName=${"plus"}
|
|
3485
|
+
.jslogContext=${"freestyler.new-chat"}
|
|
3486
|
+
.variant=${f.TOOLBAR}
|
|
3487
|
+
@click=${e.onNewChatClick}></devtools-button>
|
|
3488
|
+
<div class="toolbar-divider"></div>
|
|
3489
|
+
<devtools-menu-button
|
|
3490
|
+
title=${Q(X.history)}
|
|
3491
|
+
aria-label=${Q(X.history)}
|
|
3492
|
+
.iconName=${"history"}
|
|
3493
|
+
.jslogContext=${"freestyler.history"}
|
|
3494
|
+
.populateMenuCall=${e.populateHistoryMenu}
|
|
3495
|
+
></devtools-menu-button>` : v}
|
|
3496
|
+
${e.showActiveConversationActions ? Y`
|
|
3497
|
+
<devtools-button
|
|
3498
|
+
title=${Q(X.deleteChat)}
|
|
3499
|
+
aria-label=${Q(X.deleteChat)}
|
|
3500
|
+
.iconName=${"bin"}
|
|
3501
|
+
.jslogContext=${"freestyler.delete"}
|
|
3502
|
+
.variant=${f.TOOLBAR}
|
|
3503
|
+
@click=${e.onDeleteClick}>
|
|
3504
|
+
</devtools-button>
|
|
3505
|
+
${t ? v : Y`
|
|
3506
|
+
<devtools-button
|
|
3507
|
+
title=${Q(X.exportConversation)}
|
|
3508
|
+
aria-label=${Q(X.exportConversation)}
|
|
3509
|
+
.iconName=${"download"}
|
|
3510
|
+
.disabled=${e.isLoading}
|
|
3511
|
+
.jslogContext=${"export-ai-conversation"}
|
|
3512
|
+
.variant=${f.TOOLBAR}
|
|
3513
|
+
@click=${e.onExportConversationClick}>
|
|
3514
|
+
</devtools-button>
|
|
3515
|
+
`}` : v}
|
|
3516
|
+
</devtools-toolbar>
|
|
3517
|
+
<devtools-toolbar class="freestyler-right-toolbar" role="presentation">
|
|
3518
|
+
<devtools-link
|
|
3519
|
+
class="toolbar-feedback-link"
|
|
3520
|
+
title=${Q(X.sendFeedback)}
|
|
3521
|
+
href=${Da}
|
|
3522
|
+
jslogcontext=${"freestyler.send-feedback"}
|
|
3523
|
+
>${Q(X.sendFeedback)}</devtools-link>
|
|
3524
|
+
<div class="toolbar-divider"></div>
|
|
3525
|
+
<devtools-button
|
|
3526
|
+
title=${Q(X.help)}
|
|
3527
|
+
aria-label=${Q(X.help)}
|
|
3528
|
+
.iconName=${"help"}
|
|
3529
|
+
.jslogContext=${"freestyler.help"}
|
|
3530
|
+
.variant=${f.TOOLBAR}
|
|
3531
|
+
@click=${e.onHelpClick}></devtools-button>
|
|
3532
|
+
<devtools-button
|
|
3533
|
+
title=${Q(X.settings)}
|
|
3534
|
+
aria-label=${Q(X.settings)}
|
|
3535
|
+
.iconName=${"gear"}
|
|
3536
|
+
.jslogContext=${"freestyler.settings"}
|
|
3537
|
+
.variant=${f.TOOLBAR}
|
|
3538
|
+
@click=${e.onSettingsClick}></devtools-button>
|
|
3539
|
+
</devtools-toolbar>
|
|
3540
|
+
</div>
|
|
3541
|
+
`;
|
|
3542
|
+
}
|
|
3543
|
+
function La(e, t, n) {
|
|
3544
|
+
function r() {
|
|
3545
|
+
switch (e.state) {
|
|
3546
|
+
case "chat-view": return Y`<devtools-ai-chat-view
|
|
3547
|
+
.props=${e.props}
|
|
3548
|
+
${je((e) => {
|
|
3549
|
+
!e || !(e instanceof Zi) || (t.chatView = e);
|
|
3550
|
+
})}
|
|
3551
|
+
></devtools-ai-chat-view>`;
|
|
3552
|
+
case "explore-view": return Y`<devtools-widget class="fill-panel" ${Ea(da)}>
|
|
3553
|
+
</devtools-widget>`;
|
|
3554
|
+
case "disabled-view": return Y`<devtools-widget class="fill-panel" ${Ea(aa, e.props)}>
|
|
3555
|
+
</devtools-widget>`;
|
|
3556
|
+
}
|
|
3557
|
+
}
|
|
3558
|
+
if (d.devToolsAiAssistanceV2?.enabled) {
|
|
3559
|
+
let t = e.state === "chat-view" && e.props.walkthrough.isExpanded, i = !1;
|
|
3560
|
+
if (e.state === "chat-view") {
|
|
3561
|
+
let t = e.props.messages.at(-1);
|
|
3562
|
+
t && e.props.walkthrough.activeSidebarMessage?.id === t.id && (i = !0);
|
|
3563
|
+
}
|
|
3564
|
+
p(Y`
|
|
3565
|
+
${Ia(e)}
|
|
3566
|
+
<div class="ai-assistance-view-container">
|
|
3567
|
+
<devtools-split-view
|
|
3568
|
+
name="ai-assistance-split-view-state"
|
|
3569
|
+
direction="column"
|
|
3570
|
+
sidebar-position="second"
|
|
3571
|
+
sidebar-visibility=${t && !e.props.walkthrough.isInlined ? "visible" : "hidden"}
|
|
3572
|
+
sidebar-initial-size=${Aa}
|
|
3573
|
+
>
|
|
3574
|
+
<div slot="main" class="main-view">
|
|
3575
|
+
${r()}
|
|
3576
|
+
</div>
|
|
3577
|
+
${t ? Y`
|
|
3578
|
+
<devtools-widget slot="sidebar" ${Ea(hr, {
|
|
3579
|
+
message: e.props.walkthrough.activeSidebarMessage,
|
|
3580
|
+
isLoading: e.props.isLoading && i,
|
|
3581
|
+
markdownRenderer: e.props.markdownRenderer,
|
|
3582
|
+
onToggle: e.props.walkthrough.onToggle
|
|
3583
|
+
})}></devtools-widget>` : v}
|
|
3584
|
+
</devtools-split-view>
|
|
3585
|
+
</div>
|
|
3586
|
+
`, n);
|
|
3587
|
+
} else p(Y`
|
|
3588
|
+
${Ia(e)}
|
|
3589
|
+
<div class="ai-assistance-view-container">${r()}</div>
|
|
3590
|
+
`, n);
|
|
3591
|
+
}
|
|
3592
|
+
function Ra(e) {
|
|
3593
|
+
return e ? new zt(e) : null;
|
|
3594
|
+
}
|
|
3595
|
+
function za(e) {
|
|
3596
|
+
return e ? new pt(e) : null;
|
|
3597
|
+
}
|
|
3598
|
+
function Ba(e) {
|
|
3599
|
+
return e ? new ft(e.report) : null;
|
|
3600
|
+
}
|
|
3601
|
+
function Va(e) {
|
|
3602
|
+
return e ? new Ot(e, cn.instance().networkLogView.timeCalculator()) : null;
|
|
3603
|
+
}
|
|
3604
|
+
function Ha(e) {
|
|
3605
|
+
return e ? new Vt(e) : null;
|
|
3606
|
+
}
|
|
3607
|
+
function Ua(e) {
|
|
3608
|
+
return e ? new Pt(e) : null;
|
|
3609
|
+
}
|
|
3610
|
+
var Wa, Ga = class e extends Se {
|
|
3611
|
+
view;
|
|
3612
|
+
static panelName = "freestyler";
|
|
3613
|
+
#e;
|
|
3614
|
+
#t;
|
|
3615
|
+
#n;
|
|
3616
|
+
#r = {};
|
|
3617
|
+
#i = Za();
|
|
3618
|
+
#a;
|
|
3619
|
+
#o = new ht();
|
|
3620
|
+
#s = new c();
|
|
3621
|
+
#c;
|
|
3622
|
+
#l = null;
|
|
3623
|
+
#u = null;
|
|
3624
|
+
#d = null;
|
|
3625
|
+
#f = null;
|
|
3626
|
+
#p = null;
|
|
3627
|
+
#m = null;
|
|
3628
|
+
#h = [];
|
|
3629
|
+
#g = !1;
|
|
3630
|
+
#_;
|
|
3631
|
+
#v = null;
|
|
3632
|
+
#y = new AbortController();
|
|
3633
|
+
#b = {
|
|
3634
|
+
isInlined: !1,
|
|
3635
|
+
isExpanded: !1,
|
|
3636
|
+
activeSidebarMessage: null,
|
|
3637
|
+
inlineExpandedMessages: []
|
|
3638
|
+
};
|
|
3639
|
+
constructor(t = La, { aidaClient: n, aidaAvailability: r }) {
|
|
3640
|
+
super(e.panelName), this.view = t, this.registerRequiredCSS(Gn), this.#a = this.#E(), this.#t = n, this.#_ = r, He.instance().hasAction("elements.toggle-element-search") && (this.#e = He.instance().getAction("elements.toggle-element-search")), Rt.instance().addEventListener(wt.HISTORY_DELETED, this.#ee, this);
|
|
3641
|
+
}
|
|
3642
|
+
#x() {
|
|
3643
|
+
return {
|
|
3644
|
+
isLoading: this.#g,
|
|
3645
|
+
showChatActions: this.#G(),
|
|
3646
|
+
showActiveConversationActions: !!(this.#c && !this.#c.isEmpty),
|
|
3647
|
+
onNewChatClick: this.#ae.bind(this),
|
|
3648
|
+
populateHistoryMenu: this.#$.bind(this),
|
|
3649
|
+
onDeleteClick: this.#ne.bind(this),
|
|
3650
|
+
onExportConversationClick: this.#re.bind(this),
|
|
3651
|
+
onHelpClick: () => {
|
|
3652
|
+
le(Oa);
|
|
3653
|
+
},
|
|
3654
|
+
onSettingsClick: () => {
|
|
3655
|
+
x.instance().showView("chrome-ai");
|
|
3656
|
+
}
|
|
3657
|
+
};
|
|
3658
|
+
}
|
|
3659
|
+
async #S() {
|
|
3660
|
+
let e = d.aidaAvailability?.blockedByAge === !0;
|
|
3661
|
+
if (this.#_ !== y.AVAILABLE || !this.#a?.getIfNotDisabled() || e) return {
|
|
3662
|
+
state: "disabled-view",
|
|
3663
|
+
props: { aidaAvailability: this.#_ }
|
|
3664
|
+
};
|
|
3665
|
+
if (this.#c) {
|
|
3666
|
+
let e = await Na(this.#c), t = Pa(this.#c), n = null;
|
|
3667
|
+
return Xa() && this.#se(this.#A()) && (n = this.#Z.bind(this)), {
|
|
3668
|
+
state: "chat-view",
|
|
3669
|
+
props: {
|
|
3670
|
+
blockedByCrossOrigin: this.#c.isBlockedByOrigin,
|
|
3671
|
+
isLoading: this.#g,
|
|
3672
|
+
messages: this.#h,
|
|
3673
|
+
context: this.#c.selectedContext ?? this.#se(this.#A()),
|
|
3674
|
+
isContextSelected: !!this.#c.selectedContext,
|
|
3675
|
+
conversationType: this.#c.type,
|
|
3676
|
+
isReadOnly: this.#c.isReadOnly ?? !1,
|
|
3677
|
+
changeSummary: this.#V(),
|
|
3678
|
+
inspectElementToggled: this.#e?.toggled() ?? !1,
|
|
3679
|
+
canShowFeedbackForm: this.#i,
|
|
3680
|
+
multimodalInputEnabled: Ya() && this.#c.type === O.STYLING,
|
|
3681
|
+
isTextInputDisabled: this.#W(),
|
|
3682
|
+
emptyStateSuggestions: e,
|
|
3683
|
+
inputPlaceholder: this.#K(),
|
|
3684
|
+
disclaimerText: this.#q(),
|
|
3685
|
+
onExportConversation: this.#re.bind(this),
|
|
3686
|
+
changeManager: this.#o,
|
|
3687
|
+
uploadImageInputEnabled: Ja() && this.#c.type === O.STYLING,
|
|
3688
|
+
markdownRenderer: t,
|
|
3689
|
+
conversationMarkdown: this.#c.getConversationMarkdown(),
|
|
3690
|
+
generateConversationSummary: async (e) => (this.#n ||= new Tt({
|
|
3691
|
+
aidaClient: this.#t,
|
|
3692
|
+
serverSideLoggingEnabled: this.#i
|
|
3693
|
+
}), await this.#n.summarizeConversation(e)),
|
|
3694
|
+
onTextSubmit: async (e, t, n) => {
|
|
3695
|
+
let r = () => {
|
|
3696
|
+
w.actionTaken(S.AiAssistanceQuerySubmitted), this.#ue(e, t, n);
|
|
3697
|
+
}, i = d.devToolsAiAssistanceV2?.enabled, a = te.instance().moduleSetting("ai-assistance-v2-opt-in-change-dialog-seen");
|
|
3698
|
+
if (i && !a.get()) {
|
|
3699
|
+
va.show({
|
|
3700
|
+
onGotIt: () => {
|
|
3701
|
+
a.set(!0), r();
|
|
3702
|
+
},
|
|
3703
|
+
onManageSettings: () => {
|
|
3704
|
+
a.set(!0), this.#r.chatView?.setInputValue(e), x.instance().showView("chrome-ai");
|
|
3705
|
+
}
|
|
3706
|
+
});
|
|
3707
|
+
return;
|
|
3708
|
+
}
|
|
3709
|
+
r();
|
|
3710
|
+
},
|
|
3711
|
+
onInspectElementClick: this.#U.bind(this),
|
|
3712
|
+
onFeedbackSubmit: this.#J.bind(this),
|
|
3713
|
+
onCancelClick: this.#oe.bind(this),
|
|
3714
|
+
onContextClick: this.#Y.bind(this),
|
|
3715
|
+
onNewConversation: this.#ae.bind(this),
|
|
3716
|
+
onCopyResponseClick: this.#H.bind(this),
|
|
3717
|
+
onContextRemoved: Xa() ? this.#X.bind(this) : null,
|
|
3718
|
+
onContextAdd: n,
|
|
3719
|
+
walkthrough: {
|
|
3720
|
+
onToggle: this.#T.bind(this),
|
|
3721
|
+
onOpen: this.#w.bind(this),
|
|
3722
|
+
isExpanded: this.#b.isExpanded,
|
|
3723
|
+
isInlined: this.#b.isInlined,
|
|
3724
|
+
activeSidebarMessage: this.#b.activeSidebarMessage,
|
|
3725
|
+
inlineExpandedMessages: this.#b.inlineExpandedMessages
|
|
3726
|
+
}
|
|
3727
|
+
}
|
|
3728
|
+
};
|
|
3729
|
+
}
|
|
3730
|
+
return { state: "explore-view" };
|
|
3731
|
+
}
|
|
3732
|
+
onResize() {
|
|
3733
|
+
super.onResize(), d.devToolsAiAssistanceV2?.enabled && this.#C();
|
|
3734
|
+
}
|
|
3735
|
+
#C() {
|
|
3736
|
+
let e = this.contentElement.offsetWidth < ka;
|
|
3737
|
+
if (e !== this.#b.isInlined) {
|
|
3738
|
+
if (this.#b.isInlined = e, !this.#b.isExpanded) {
|
|
3739
|
+
this.#b.activeSidebarMessage = null, this.#b.inlineExpandedMessages = [], this.requestUpdate();
|
|
3740
|
+
return;
|
|
3741
|
+
}
|
|
3742
|
+
e ? this.#b.inlineExpandedMessages = this.#b.activeSidebarMessage ? [this.#b.activeSidebarMessage] : [] : this.#b.activeSidebarMessage = this.#b.inlineExpandedMessages.at(-1) ?? null, this.requestUpdate();
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
#w(e) {
|
|
3746
|
+
this.#b.inlineExpandedMessages.some((t) => t.id === e.id) || this.#b.inlineExpandedMessages.push(e), this.#b.activeSidebarMessage = e, this.#b.isExpanded = !0, this.requestUpdate();
|
|
3747
|
+
}
|
|
3748
|
+
#T(e, t) {
|
|
3749
|
+
if (e) {
|
|
3750
|
+
this.#w(t);
|
|
3751
|
+
return;
|
|
3752
|
+
}
|
|
3753
|
+
this.#b.inlineExpandedMessages = this.#b.inlineExpandedMessages.filter((e) => e.id !== t.id), this.#b.isInlined ? (this.#b.isExpanded = this.#b.inlineExpandedMessages.length > 0, this.#b.activeSidebarMessage?.id === t.id && (this.#b.activeSidebarMessage = this.#b.inlineExpandedMessages.at(-1) ?? null)) : (this.#b.isExpanded = !1, this.#b.activeSidebarMessage = null), this.requestUpdate();
|
|
3754
|
+
}
|
|
3755
|
+
#E() {
|
|
3756
|
+
try {
|
|
3757
|
+
return re("ai-assistance-enabled");
|
|
3758
|
+
} catch {
|
|
3759
|
+
return;
|
|
3760
|
+
}
|
|
3761
|
+
}
|
|
3762
|
+
static async instance(t = { forceNew: null }) {
|
|
3763
|
+
let { forceNew: n } = t;
|
|
3764
|
+
return (!Wa || n) && (Wa = new e(La, {
|
|
3765
|
+
aidaClient: new pe(),
|
|
3766
|
+
aidaAvailability: await pe.checkAccessPreconditions()
|
|
3767
|
+
})), Wa;
|
|
3768
|
+
}
|
|
3769
|
+
#D() {
|
|
3770
|
+
let e = b.instance().flavor(mn);
|
|
3771
|
+
e !== this.#v && (this.#v?.removeEventListener(bn.IS_VIEWING_TRACE, this.requestUpdate, this), this.#v = e, this.#v && this.#v.addEventListener(bn.IS_VIEWING_TRACE, this.requestUpdate, this));
|
|
3772
|
+
}
|
|
3773
|
+
async #O() {
|
|
3774
|
+
return await mn.executeRecordAndReload();
|
|
3775
|
+
}
|
|
3776
|
+
async #k(e) {
|
|
3777
|
+
return await on.executeLighthouseRecording({
|
|
3778
|
+
isAIControlled: !0,
|
|
3779
|
+
...e
|
|
3780
|
+
});
|
|
3781
|
+
}
|
|
3782
|
+
#A() {
|
|
3783
|
+
let { hostConfig: e } = oe, t = x.instance(), n = t.isViewVisible("elements"), r = t.isViewVisible("network"), i = t.isViewVisible("sources"), a = t.isViewVisible("timeline"), o = t.isViewVisible("lighthouse"), s = t.isViewVisible("resources"), c;
|
|
3784
|
+
return n && e.devToolsFreestyler?.enabled ? c = O.STYLING : r && e.devToolsAiAssistanceNetworkAgent?.enabled ? c = O.NETWORK : i && e.devToolsAiAssistanceFileAgent?.enabled ? c = O.FILE : a && e.devToolsAiAssistancePerformanceAgent?.enabled ? c = O.PERFORMANCE : o && e.devToolsAiAssistanceAccessibilityAgent?.enabled ? c = O.ACCESSIBILITY : s && e.devToolsAiAssistanceStorageAgent?.enabled && (c = O.STORAGE), Xa() && !c ? O.NONE : c;
|
|
3785
|
+
}
|
|
3786
|
+
#j() {
|
|
3787
|
+
if (this.#g) {
|
|
3788
|
+
this.requestUpdate();
|
|
3789
|
+
return;
|
|
3790
|
+
}
|
|
3791
|
+
if (this.#c && !this.#c.isEmpty) {
|
|
3792
|
+
this.requestUpdate();
|
|
3793
|
+
return;
|
|
3794
|
+
}
|
|
3795
|
+
let e = this.#A();
|
|
3796
|
+
if (this.#c?.type === e) {
|
|
3797
|
+
this.requestUpdate();
|
|
3798
|
+
return;
|
|
3799
|
+
}
|
|
3800
|
+
let t = e ? new St({
|
|
3801
|
+
type: e,
|
|
3802
|
+
data: [],
|
|
3803
|
+
isReadOnly: !1,
|
|
3804
|
+
aidaClient: this.#t,
|
|
3805
|
+
changeManager: this.#o,
|
|
3806
|
+
isExternal: !1,
|
|
3807
|
+
performanceRecordAndReload: this.#O.bind(this),
|
|
3808
|
+
onInspectElement: this.#le.bind(this),
|
|
3809
|
+
networkTimeCalculator: cn.instance().networkLogView.timeCalculator(),
|
|
3810
|
+
lighthouseRecording: this.#k.bind(this)
|
|
3811
|
+
}) : void 0;
|
|
3812
|
+
this.#M(t);
|
|
3813
|
+
}
|
|
3814
|
+
#M(e) {
|
|
3815
|
+
if (this.#c !== e) {
|
|
3816
|
+
if (this.#oe(), this.#h = [], this.#g = !1, this.#c?.archiveConversation(), !e) {
|
|
3817
|
+
let t = this.#A();
|
|
3818
|
+
t && (e = new St({
|
|
3819
|
+
type: t,
|
|
3820
|
+
data: [],
|
|
3821
|
+
isReadOnly: !1,
|
|
3822
|
+
aidaClient: this.#t,
|
|
3823
|
+
changeManager: this.#o,
|
|
3824
|
+
isExternal: !1,
|
|
3825
|
+
performanceRecordAndReload: this.#O.bind(this),
|
|
3826
|
+
onInspectElement: this.#le.bind(this),
|
|
3827
|
+
networkTimeCalculator: cn.instance().networkLogView.timeCalculator(),
|
|
3828
|
+
lighthouseRecording: this.#k.bind(this)
|
|
3829
|
+
}));
|
|
3830
|
+
}
|
|
3831
|
+
this.#c = e;
|
|
3832
|
+
}
|
|
3833
|
+
if (this.#c) if (this.#c.isEmpty && Xa()) {
|
|
3834
|
+
let e = this.#se(this.#A());
|
|
3835
|
+
this.#c.setContext(e);
|
|
3836
|
+
} else {
|
|
3837
|
+
let e = this.#se(this.#c.type);
|
|
3838
|
+
(e || !Xa()) && this.#c.setContext(e);
|
|
3839
|
+
}
|
|
3840
|
+
this.requestUpdate();
|
|
3841
|
+
}
|
|
3842
|
+
wasShown() {
|
|
3843
|
+
super.wasShown(), this.#r.chatView?.restoreScrollPosition(), this.#r.chatView?.focusTextInput(), this.#N(), this.#u = Ra(Ma(b.instance().flavor(Ye))), this.#f = Va(b.instance().flavor(ze)), this.#d = Ha(b.instance().flavor(bt)), this.#l = za(b.instance().flavor(ot)), this.#p = Ba(b.instance().flavor(sn)), this.#m = Ua(b.instance().flavor(vt)), this.#M(this.#c), this.#a?.addChangeListener(this.requestUpdate, this), fe.instance().addEventListener(De.AIDA_AVAILABILITY_CHANGED, this.#N), this.#e?.addEventListener(Me.TOGGLED, this.requestUpdate, this), b.instance().addFlavorChangeListener(Ye, this.#P), b.instance().addFlavorChangeListener(ze, this.#L), b.instance().addFlavorChangeListener(bt, this.#R), b.instance().addFlavorChangeListener(vt, this.#F), b.instance().addFlavorChangeListener(ot, this.#z), b.instance().addFlavorChangeListener(sn, this.#B), x.instance().addEventListener(ue.VIEW_VISIBILITY_CHANGED, this.#j, this), m.instance().addModelListener(T, Ze.AttrModified, this.#I, this), m.instance().addModelListener(T, Ze.AttrRemoved, this.#I, this), b.instance().addFlavorChangeListener(mn, this.#D, this), this.#D(), this.#j(), w.actionTaken(S.AiAssistancePanelOpened);
|
|
3844
|
+
}
|
|
3845
|
+
willHide() {
|
|
3846
|
+
super.willHide(), this.#a?.removeChangeListener(this.requestUpdate, this), fe.instance().removeEventListener(De.AIDA_AVAILABILITY_CHANGED, this.#N), this.#e?.removeEventListener(Me.TOGGLED, this.requestUpdate, this), b.instance().removeFlavorChangeListener(Ye, this.#P), b.instance().removeFlavorChangeListener(ze, this.#L), b.instance().removeFlavorChangeListener(bt, this.#R), b.instance().removeFlavorChangeListener(vt, this.#F), b.instance().removeFlavorChangeListener(ot, this.#z), b.instance().removeFlavorChangeListener(sn, this.#B), x.instance().removeEventListener(ue.VIEW_VISIBILITY_CHANGED, this.#j, this), b.instance().removeFlavorChangeListener(mn, this.#D, this), m.instance().removeModelListener(T, Ze.AttrModified, this.#I, this), m.instance().removeModelListener(T, Ze.AttrRemoved, this.#I, this), this.#v &&= (this.#v.removeEventListener(bn.IS_VIEWING_TRACE, this.requestUpdate, this), null);
|
|
3847
|
+
}
|
|
3848
|
+
#N = async () => {
|
|
3849
|
+
let e = await pe.checkAccessPreconditions();
|
|
3850
|
+
e !== this.#_ && (this.#_ = e, this.requestUpdate());
|
|
3851
|
+
};
|
|
3852
|
+
#P = (e) => {
|
|
3853
|
+
this.#u?.getItem() !== e.data && (this.#u = Ra(Ma(e.data)), this.#M(this.#c));
|
|
3854
|
+
};
|
|
3855
|
+
#F = (e) => {
|
|
3856
|
+
this.#m?.getItem() !== e.data && (this.#m = Ua(e.data), this.#M(this.#c));
|
|
3857
|
+
};
|
|
3858
|
+
#I = (e) => {
|
|
3859
|
+
this.#u?.getItem() === e.data.node && (e.data.name === "class" || e.data.name === "id") && this.requestUpdate();
|
|
3860
|
+
};
|
|
3861
|
+
#L = (e) => {
|
|
3862
|
+
if (this.#f?.getItem() !== e.data) {
|
|
3863
|
+
if (e.data) {
|
|
3864
|
+
let t = cn.instance().networkLogView.timeCalculator();
|
|
3865
|
+
this.#f = new Ot(e.data, t);
|
|
3866
|
+
} else this.#f = null;
|
|
3867
|
+
this.#M(this.#c);
|
|
3868
|
+
}
|
|
3869
|
+
};
|
|
3870
|
+
#R = (e) => {
|
|
3871
|
+
this.#d?.getItem() !== e.data && (this.#d = e.data ? new Vt(e.data) : null, this.#M(this.#c));
|
|
3872
|
+
};
|
|
3873
|
+
#z = (e) => {
|
|
3874
|
+
let t = e.data;
|
|
3875
|
+
!t || this.#l?.getItem() === t || (this.#l = new pt(e.data), this.#M(this.#c));
|
|
3876
|
+
};
|
|
3877
|
+
#B = (e) => {
|
|
3878
|
+
let t = e.data;
|
|
3879
|
+
this.#p?.getItem() !== t?.report && (this.#p = Ba(t), this.#M(this.#c));
|
|
3880
|
+
};
|
|
3881
|
+
#V() {
|
|
3882
|
+
if (!hi() || !this.#c || this.#c?.isReadOnly) return;
|
|
3883
|
+
let e = !!d.devToolsAiAssistanceV2?.enabled;
|
|
3884
|
+
return this.#o.formatChangesForPatching(this.#c.id, !e);
|
|
3885
|
+
}
|
|
3886
|
+
async performUpdate() {
|
|
3887
|
+
let e = {
|
|
3888
|
+
...this.#x(),
|
|
3889
|
+
...await this.#S()
|
|
3890
|
+
};
|
|
3891
|
+
this.view(e, this.#r, this.contentElement);
|
|
3892
|
+
}
|
|
3893
|
+
#H(e) {
|
|
3894
|
+
let t = Ka(e);
|
|
3895
|
+
t && (Ae.copyText(t), Kt.show({ message: Q(X.responseCopiedToClipboard) }));
|
|
3896
|
+
}
|
|
3897
|
+
#U() {
|
|
3898
|
+
b.instance().setFlavor(a, new a(this.panelName)), this.#e?.execute();
|
|
3899
|
+
}
|
|
3900
|
+
#W() {
|
|
3901
|
+
return !!(this.#c && this.#c.isBlockedByOrigin || !this.#c || !this.#c.selectedContext && !Xa());
|
|
3902
|
+
}
|
|
3903
|
+
#G() {
|
|
3904
|
+
let e = this.#a?.getIfNotDisabled(), t = d.aidaAvailability?.blockedByAge === !0;
|
|
3905
|
+
return !(!e || t || this.#_ === y.NO_ACCOUNT_EMAIL || this.#_ === y.SYNC_IS_PAUSED);
|
|
3906
|
+
}
|
|
3907
|
+
#K() {
|
|
3908
|
+
if (!this.#c) return Q(X.followTheSteps);
|
|
3909
|
+
if (this.#c && this.#c.isBlockedByOrigin) return $(Z.crossOriginError);
|
|
3910
|
+
switch (this.#c.type) {
|
|
3911
|
+
case O.STYLING: return this.#c.selectedContext ? $(Z.inputPlaceholderForStyling) : $(Z.inputPlaceholderForStylingNoContext);
|
|
3912
|
+
case O.FILE: return this.#c.selectedContext ? $(Z.inputPlaceholderForFile) : $(Z.inputPlaceholderForFileNoContext);
|
|
3913
|
+
case O.NETWORK: return this.#c.selectedContext ? $(Z.inputPlaceholderForNetwork) : $(Z.inputPlaceholderForNetworkNoContext);
|
|
3914
|
+
case O.PERFORMANCE: return b.instance().flavor(mn)?.hasActiveTrace() ? this.#c.selectedContext ? $(Z.inputPlaceholderForPerformanceTrace) : $(Z.inputPlaceholderForPerformanceTraceNoContext) : $(Z.inputPlaceholderForPerformanceWithNoRecording);
|
|
3915
|
+
case O.ACCESSIBILITY: return this.#c.selectedContext ? $(Z.inputPlaceholderForAccessibility) : $(Z.inputPlaceholderForAccessibilityNoContext);
|
|
3916
|
+
case O.STORAGE: return $(Z.inputPlaceholderForNoContext);
|
|
3917
|
+
case O.NONE: return Ct() ? $(Z.inputPlaceholderForNoContextBranded) : $(Z.inputPlaceholderForNoContext);
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
#q() {
|
|
3921
|
+
if (!this.#c || this.#c.isReadOnly) return Q(X.inputDisclaimerForEmptyState);
|
|
3922
|
+
let e = d.aidaAvailability?.enterprisePolicyValue !== ae.ALLOW_WITHOUT_LOGGING;
|
|
3923
|
+
if (d.devToolsAiAssistanceV2?.enabled) return $(e ? Z.inputDisclaimerV2 : Z.inputDisclaimerEnterpriseNoLoggingV2);
|
|
3924
|
+
switch (this.#c.type) {
|
|
3925
|
+
case O.STYLING: return $(e ? Z.inputDisclaimerForStyling : Z.inputDisclaimerForStylingEnterpriseNoLogging);
|
|
3926
|
+
case O.FILE: return $(e ? Z.inputDisclaimerForFile : Z.inputDisclaimerForFileEnterpriseNoLogging);
|
|
3927
|
+
case O.NETWORK: return $(e ? Z.inputDisclaimerForNetwork : Z.inputDisclaimerForNetworkEnterpriseNoLogging);
|
|
3928
|
+
case O.PERFORMANCE: return $(e ? Z.inputDisclaimerForPerformance : Z.inputDisclaimerForPerformanceEnterpriseNoLogging);
|
|
3929
|
+
case O.ACCESSIBILITY: return $(e ? Z.inputDisclaimerForAccessibility : Z.inputDisclaimerForAccessibilityEnterpriseNoLogging);
|
|
3930
|
+
case O.STORAGE:
|
|
3931
|
+
case O.NONE: return $(e ? Z.inputDisclaimerForNoContext : Z.inputDisclaimerForNoContextEnterpriseNoLogging);
|
|
3932
|
+
}
|
|
3933
|
+
}
|
|
3934
|
+
#J(e, t, n) {
|
|
3935
|
+
this.#t.registerClientEvent({
|
|
3936
|
+
corresponding_aida_rpc_global_id: e,
|
|
3937
|
+
disable_user_content_logging: !this.#i,
|
|
3938
|
+
do_conversation_client_event: { user_feedback: {
|
|
3939
|
+
sentiment: t,
|
|
3940
|
+
user_input: { comment: n }
|
|
3941
|
+
} }
|
|
3942
|
+
});
|
|
3943
|
+
}
|
|
3944
|
+
#Y() {
|
|
3945
|
+
if (!this.#c) return;
|
|
3946
|
+
let e = this.#c.selectedContext;
|
|
3947
|
+
if (e instanceof Ot) return u(Jt.tab(e.getItem(), Yt.HEADERS_COMPONENT));
|
|
3948
|
+
if (e instanceof pt) return u(e.getItem().uiLocation(0, 0));
|
|
3949
|
+
if (e instanceof Vt) {
|
|
3950
|
+
let t = e.getItem();
|
|
3951
|
+
if (t.callTree) return u(new Xe(t.callTree.selectedNode?.event ?? t.callTree.rootNode.event));
|
|
3952
|
+
if (t.insight) return u(t.insight);
|
|
3953
|
+
}
|
|
3954
|
+
}
|
|
3955
|
+
#X() {
|
|
3956
|
+
this.#c?.setContext(null), this.requestUpdate();
|
|
3957
|
+
}
|
|
3958
|
+
#Z() {
|
|
3959
|
+
this.#c?.setContext(this.#se(this.#A())), this.requestUpdate();
|
|
3960
|
+
}
|
|
3961
|
+
#Q() {
|
|
3962
|
+
let e = !!d.aidaAvailability?.enabled, t = !!d.aidaAvailability?.blockedByAge, n = this.#_ === y.AVAILABLE, r = !!this.#a?.getIfNotDisabled();
|
|
3963
|
+
return e && n && r && !t;
|
|
3964
|
+
}
|
|
3965
|
+
async handleAction(e, t) {
|
|
3966
|
+
if (this.#g && !t?.prompt) {
|
|
3967
|
+
this.#r.chatView?.focusTextInput();
|
|
3968
|
+
return;
|
|
3969
|
+
}
|
|
3970
|
+
let n;
|
|
3971
|
+
switch (e) {
|
|
3972
|
+
case "freestyler.elements-floating-button":
|
|
3973
|
+
w.actionTaken(S.AiAssistanceOpenedFromElementsPanelFloatingButton), n = O.STYLING;
|
|
3974
|
+
break;
|
|
3975
|
+
case "freestyler.element-panel-context":
|
|
3976
|
+
w.actionTaken(S.AiAssistanceOpenedFromElementsPanel), n = O.STYLING;
|
|
3977
|
+
break;
|
|
3978
|
+
case "drjones.network-floating-button":
|
|
3979
|
+
w.actionTaken(S.AiAssistanceOpenedFromNetworkPanelFloatingButton), n = O.NETWORK;
|
|
3980
|
+
break;
|
|
3981
|
+
case "drjones.network-panel-context":
|
|
3982
|
+
w.actionTaken(S.AiAssistanceOpenedFromNetworkPanel), n = O.NETWORK;
|
|
3983
|
+
break;
|
|
3984
|
+
case "drjones.performance-panel-context":
|
|
3985
|
+
w.actionTaken(S.AiAssistanceOpenedFromPerformancePanelCallTree), n = O.PERFORMANCE;
|
|
3986
|
+
break;
|
|
3987
|
+
case "drjones.sources-floating-button":
|
|
3988
|
+
w.actionTaken(S.AiAssistanceOpenedFromSourcesPanelFloatingButton), n = O.FILE;
|
|
3989
|
+
break;
|
|
3990
|
+
case "drjones.sources-panel-context":
|
|
3991
|
+
w.actionTaken(S.AiAssistanceOpenedFromSourcesPanel), n = O.FILE;
|
|
3992
|
+
break;
|
|
3993
|
+
}
|
|
3994
|
+
if (!n) return;
|
|
3995
|
+
let r = this.#c;
|
|
3996
|
+
(!this.#c || this.#c.type !== n || this.#c.isEmpty) && (r = new St({
|
|
3997
|
+
type: n,
|
|
3998
|
+
data: [],
|
|
3999
|
+
isReadOnly: !1,
|
|
4000
|
+
aidaClient: this.#t,
|
|
4001
|
+
changeManager: this.#o,
|
|
4002
|
+
isExternal: !1,
|
|
4003
|
+
performanceRecordAndReload: this.#O.bind(this),
|
|
4004
|
+
onInspectElement: this.#le.bind(this),
|
|
4005
|
+
networkTimeCalculator: cn.instance().networkLogView.timeCalculator(),
|
|
4006
|
+
lighthouseRecording: this.#k.bind(this)
|
|
4007
|
+
})), this.#M(r);
|
|
4008
|
+
let i = t?.prompt;
|
|
4009
|
+
if (i && typeof i == "string") {
|
|
4010
|
+
if (!this.#Q()) return;
|
|
4011
|
+
w.actionTaken(S.AiAssistanceQuerySubmitted), this.#c && this.#c.isBlockedByOrigin && this.#ae(), await this.#ue(i);
|
|
4012
|
+
} else this.#r.chatView?.focusTextInput();
|
|
4013
|
+
}
|
|
4014
|
+
#$(e) {
|
|
4015
|
+
let t = Rt.instance().getHistory().map((e) => St.fromSerializedConversation(e));
|
|
4016
|
+
for (let n of t.reverse()) n.isEmpty || !n.title || e.defaultSection().appendCheckboxItem(n.title, () => {
|
|
4017
|
+
this.#ie(n);
|
|
4018
|
+
}, {
|
|
4019
|
+
checked: this.#c?.id === n.id,
|
|
4020
|
+
jslogContext: "freestyler.history-item"
|
|
4021
|
+
});
|
|
4022
|
+
let n = e.defaultSection().items.length === 0;
|
|
4023
|
+
n && e.defaultSection().appendItem(Q(X.noPastConversations), () => {}, { disabled: !0 }), e.footerSection().appendItem(Q(X.clearChatHistory), () => {
|
|
4024
|
+
Rt.instance().deleteAll();
|
|
4025
|
+
}, { disabled: n });
|
|
4026
|
+
}
|
|
4027
|
+
#ee() {
|
|
4028
|
+
this.#M();
|
|
4029
|
+
}
|
|
4030
|
+
#te() {
|
|
4031
|
+
this.#b.isExpanded = !1, this.#b.activeSidebarMessage = null, this.#b.inlineExpandedMessages = [];
|
|
4032
|
+
}
|
|
4033
|
+
#ne() {
|
|
4034
|
+
this.#c && (this.#te(), Rt.instance().deleteHistoryEntry(this.#c.id), this.#M(), Ce.alert(Q(X.chatDeleted)));
|
|
4035
|
+
}
|
|
4036
|
+
async #re() {
|
|
4037
|
+
if (this.#c) return await Ta(this.#c);
|
|
4038
|
+
}
|
|
4039
|
+
async #ie(e) {
|
|
4040
|
+
this.#c?.id !== e.id && (this.#M(e), await this.#de(e.history));
|
|
4041
|
+
}
|
|
4042
|
+
#ae() {
|
|
4043
|
+
this.#M(), this.#te(), Ce.alert(Q(X.newChatCreated)), ke.annotationsEnabled() && ke.instance().deleteAllAnnotations();
|
|
4044
|
+
}
|
|
4045
|
+
#oe() {
|
|
4046
|
+
this.#y.abort(), this.#y = new AbortController();
|
|
4047
|
+
}
|
|
4048
|
+
#se(e) {
|
|
4049
|
+
switch (e) {
|
|
4050
|
+
case O.STYLING: return this.#u;
|
|
4051
|
+
case O.FILE: return this.#l;
|
|
4052
|
+
case O.NETWORK: return this.#f;
|
|
4053
|
+
case O.PERFORMANCE: return this.#d;
|
|
4054
|
+
case O.ACCESSIBILITY: return this.#p;
|
|
4055
|
+
case O.STORAGE: return this.#m;
|
|
4056
|
+
case O.NONE:
|
|
4057
|
+
case void 0: return null;
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
#ce = (e) => {
|
|
4061
|
+
e instanceof pt ? this.#l = e : e instanceof zt ? this.#u = e : e instanceof Ot ? this.#f = e : e instanceof Vt ? this.#d = e : e instanceof ft ? this.#p = e : e instanceof Pt && (this.#m = e), tt(`context-change-${this.#c?.type}`), this.requestUpdate();
|
|
4062
|
+
};
|
|
4063
|
+
async #le() {
|
|
4064
|
+
if (!this.#e) return null;
|
|
4065
|
+
let e = new Promise((e) => {
|
|
4066
|
+
let t = (t) => {
|
|
4067
|
+
t.data && (e(Ma(t.data)), r());
|
|
4068
|
+
}, n = (t) => {
|
|
4069
|
+
t.data || window.setTimeout(() => {
|
|
4070
|
+
e(Ma(b.instance().flavor(Ye))), r();
|
|
4071
|
+
}, 50);
|
|
4072
|
+
}, r = () => {
|
|
4073
|
+
b.instance().removeFlavorChangeListener(Ye, t), this.#e?.removeEventListener(Me.TOGGLED, n);
|
|
4074
|
+
};
|
|
4075
|
+
b.instance().addFlavorChangeListener(Ye, t), this.#e?.addEventListener(Me.TOGGLED, n), this.#y.signal.addEventListener("abort", () => {
|
|
4076
|
+
e(null), r();
|
|
4077
|
+
}, { once: !0 });
|
|
4078
|
+
});
|
|
4079
|
+
this.#e.execute();
|
|
4080
|
+
try {
|
|
4081
|
+
return await e;
|
|
4082
|
+
} finally {
|
|
4083
|
+
this.#e.toggled() && this.#e.execute();
|
|
4084
|
+
}
|
|
4085
|
+
}
|
|
4086
|
+
async #ue(e, t, n) {
|
|
4087
|
+
if (!this.#c) return;
|
|
4088
|
+
this.#oe();
|
|
4089
|
+
let r = this.#y.signal;
|
|
4090
|
+
this.#c.isEmpty && dt.instance().recordAction(Ft.STARTED_AI_CONVERSATION);
|
|
4091
|
+
let i = qe.instance().isEnabled("emulationCapabilities"), a, o = this.#c.getPendingMultimodalInput();
|
|
4092
|
+
i && o ? a = o : Ya() && t && n && (a = {
|
|
4093
|
+
input: t,
|
|
4094
|
+
id: crypto.randomUUID(),
|
|
4095
|
+
type: n
|
|
4096
|
+
}), tt(`start-conversation-${this.#c.type}`, "ui"), await this.#de(this.#c.run(e, {
|
|
4097
|
+
signal: r,
|
|
4098
|
+
multimodalInput: a
|
|
4099
|
+
}));
|
|
4100
|
+
}
|
|
4101
|
+
async #de(e) {
|
|
4102
|
+
let t = await this.#s.acquire();
|
|
4103
|
+
try {
|
|
4104
|
+
let t = {
|
|
4105
|
+
entity: Sr.MODEL,
|
|
4106
|
+
parts: [],
|
|
4107
|
+
id: crypto.randomUUID()
|
|
4108
|
+
}, n = { isLoading: !0 };
|
|
4109
|
+
function r() {
|
|
4110
|
+
let e = t.parts.at(-1);
|
|
4111
|
+
e?.type === "step" && e.step === n || t.parts.push({
|
|
4112
|
+
type: "step",
|
|
4113
|
+
step: n
|
|
4114
|
+
});
|
|
4115
|
+
}
|
|
4116
|
+
this.#g = !0;
|
|
4117
|
+
let i = !1, a = !1;
|
|
4118
|
+
for await (let o of e) {
|
|
4119
|
+
switch (n.requestApproval = void 0, o.type) {
|
|
4120
|
+
case D.USER_QUERY:
|
|
4121
|
+
this.#h.push({
|
|
4122
|
+
entity: Sr.USER,
|
|
4123
|
+
text: o.query,
|
|
4124
|
+
imageInput: o.imageInput,
|
|
4125
|
+
id: crypto.randomUUID()
|
|
4126
|
+
}), t = {
|
|
4127
|
+
entity: Sr.MODEL,
|
|
4128
|
+
parts: [],
|
|
4129
|
+
id: crypto.randomUUID()
|
|
4130
|
+
}, this.#h.push(t), this.#b.isExpanded && !this.#b.isInlined && this.#w(t);
|
|
4131
|
+
break;
|
|
4132
|
+
case D.QUERYING:
|
|
4133
|
+
n = { isLoading: !0 }, t.parts.length || r();
|
|
4134
|
+
break;
|
|
4135
|
+
case D.CONTEXT:
|
|
4136
|
+
n.title = $(Z.analyzingData), n.contextDetails = o.details, n.widgets = o.widgets, n.isLoading = !1, r();
|
|
4137
|
+
break;
|
|
4138
|
+
case D.TITLE:
|
|
4139
|
+
n.title = o.title, r();
|
|
4140
|
+
break;
|
|
4141
|
+
case D.THOUGHT:
|
|
4142
|
+
n.isLoading = !1, n.thought = o.thought, r();
|
|
4143
|
+
break;
|
|
4144
|
+
case D.SUGGESTIONS: {
|
|
4145
|
+
let e = t.parts.at(-1);
|
|
4146
|
+
e?.type === "answer" ? e.suggestions = o.suggestions : t.parts.push({
|
|
4147
|
+
type: "answer",
|
|
4148
|
+
text: "",
|
|
4149
|
+
suggestions: o.suggestions
|
|
4150
|
+
});
|
|
4151
|
+
break;
|
|
4152
|
+
}
|
|
4153
|
+
case D.SIDE_EFFECT:
|
|
4154
|
+
n.isLoading = !1, n.code ??= o.code, n.requestApproval = {
|
|
4155
|
+
description: o.description,
|
|
4156
|
+
onAnswer: (e) => {
|
|
4157
|
+
o.confirm(e), n.requestApproval = void 0, this.requestUpdate();
|
|
4158
|
+
}
|
|
4159
|
+
}, r();
|
|
4160
|
+
break;
|
|
4161
|
+
case D.ACTION:
|
|
4162
|
+
n.isLoading = !1, n.code ??= o.code, n.output ??= o.output, n.canceled = o.canceled, n.widgets ??= o.widgets, r();
|
|
4163
|
+
break;
|
|
4164
|
+
case D.ANSWER: {
|
|
4165
|
+
t.rpcId = o.rpcId;
|
|
4166
|
+
let e = t.parts.at(-1);
|
|
4167
|
+
if (e?.type === "answer") e.text = o.text, o.suggestions && (e.suggestions = o.suggestions);
|
|
4168
|
+
else {
|
|
4169
|
+
let e = {
|
|
4170
|
+
type: "answer",
|
|
4171
|
+
text: o.text
|
|
4172
|
+
};
|
|
4173
|
+
o.suggestions && (e.suggestions = o.suggestions), t.parts.push(e);
|
|
4174
|
+
}
|
|
4175
|
+
if (o.widgets && d.devToolsAiAssistanceV2?.enabled && t.parts.push({
|
|
4176
|
+
type: "widget",
|
|
4177
|
+
widgets: o.widgets
|
|
4178
|
+
}), t.parts.length > 1) {
|
|
4179
|
+
let e = t.parts[0];
|
|
4180
|
+
e.type === "step" && e.step.isLoading && !e.step.thought && !e.step.code && !e.step.contextDetails && t.parts.shift();
|
|
4181
|
+
}
|
|
4182
|
+
n.isLoading = !1;
|
|
4183
|
+
break;
|
|
4184
|
+
}
|
|
4185
|
+
case D.ERROR: {
|
|
4186
|
+
t.error = o.error;
|
|
4187
|
+
let e = t.parts.at(-1);
|
|
4188
|
+
if (e?.type === "step") {
|
|
4189
|
+
let n = e.step;
|
|
4190
|
+
o.error === It.ABORT ? n.canceled = !0 : n.isLoading && t.parts.pop();
|
|
4191
|
+
}
|
|
4192
|
+
o.error === It.BLOCK && t.parts.at(-1)?.type === "answer" && t.parts.pop();
|
|
4193
|
+
break;
|
|
4194
|
+
}
|
|
4195
|
+
case D.CONTEXT_CHANGE:
|
|
4196
|
+
this.#ce(o.context), n.isLoading = !1, n.widgets = o.widgets, r(), n = { isLoading: !0 };
|
|
4197
|
+
break;
|
|
4198
|
+
}
|
|
4199
|
+
if (!this.#c?.isReadOnly) switch (this.requestUpdate(), (o.type === D.CONTEXT || o.type === D.SIDE_EFFECT) && this.#r.chatView?.scrollToBottom(), o.type) {
|
|
4200
|
+
case D.CONTEXT:
|
|
4201
|
+
Ce.status($(Z.analyzingData));
|
|
4202
|
+
break;
|
|
4203
|
+
case D.ANSWER: !o.complete && !i ? (i = !0, Ce.status($(Z.answerLoading))) : o.complete && !a && (a = !0, Ce.status($(Z.answerReady)));
|
|
4204
|
+
}
|
|
4205
|
+
}
|
|
4206
|
+
this.#g = !1, this.requestUpdate();
|
|
4207
|
+
} finally {
|
|
4208
|
+
t();
|
|
4209
|
+
}
|
|
4210
|
+
}
|
|
4211
|
+
};
|
|
4212
|
+
function Ka(e) {
|
|
4213
|
+
let t = ["## AI"];
|
|
4214
|
+
for (let n of e.parts) if (n.type === "answer") t.push(`### Answer\n\n${n.text}`);
|
|
4215
|
+
else if (n.type === "step") {
|
|
4216
|
+
let e = n.step;
|
|
4217
|
+
e.title && t.push(`### ${e.title}`), e.contextDetails && t.push(At(e.contextDetails)), e.thought && t.push(e.thought), e.code && t.push(`**Code executed:**\n\`\`\`\n${e.code.trim()}\n\`\`\``), e.output && t.push(`**Data returned:**\n\`\`\`\n${e.output}\n\`\`\``);
|
|
4218
|
+
}
|
|
4219
|
+
return t.join("\n\n");
|
|
4220
|
+
}
|
|
4221
|
+
var qa = class {
|
|
4222
|
+
handleAction(e, t, n) {
|
|
4223
|
+
switch (t) {
|
|
4224
|
+
case "freestyler.elements-floating-button":
|
|
4225
|
+
case "freestyler.element-panel-context":
|
|
4226
|
+
case "freestyler.main-menu":
|
|
4227
|
+
case "drjones.network-floating-button":
|
|
4228
|
+
case "drjones.network-panel-context":
|
|
4229
|
+
case "drjones.performance-panel-context":
|
|
4230
|
+
case "drjones.sources-floating-button":
|
|
4231
|
+
case "drjones.sources-panel-context": return (async () => {
|
|
4232
|
+
let e = x.instance().view(Ga.panelName);
|
|
4233
|
+
if (!e) return;
|
|
4234
|
+
await x.instance().showView(Ga.panelName);
|
|
4235
|
+
let r = be.instance().totalSize() / 4;
|
|
4236
|
+
be.instance().drawerSize() < r && be.instance().setDrawerSize(r), (await e.widget()).handleAction(t, n);
|
|
4237
|
+
})(), !0;
|
|
4238
|
+
}
|
|
4239
|
+
return !1;
|
|
4240
|
+
}
|
|
4241
|
+
};
|
|
4242
|
+
function Ja() {
|
|
4243
|
+
return Ya() && !!d.devToolsFreestyler?.multimodalUploadInput;
|
|
4244
|
+
}
|
|
4245
|
+
function Ya() {
|
|
4246
|
+
return !!d.devToolsFreestyler?.multimodal;
|
|
4247
|
+
}
|
|
4248
|
+
function Xa() {
|
|
4249
|
+
return !!d.devToolsAiAssistanceContextSelectionAgent?.enabled;
|
|
4250
|
+
}
|
|
4251
|
+
function Za() {
|
|
4252
|
+
return !d.aidaAvailability?.disallowLogging;
|
|
4253
|
+
}
|
|
4254
|
+
//#endregion
|
|
4255
|
+
export { Xn as AccessibilityAgentMarkdownRenderer, qa as ActionDelegate, Ga as AiAssistancePanel, _i as ChatInput, gr as ChatMessage, Zi as ChatView, $i as DisabledWidget, sa as ExploreWidget, wa as ExportConversation, Pi as ExportForAgentsDialog, qn as MarkdownRendererWithCodeBlock, pa as OptInChangeDialog, li as PatchWidget, si as SELECT_WORKSPACE_DIALOG_DEFAULT_VIEW, ci as SelectWorkspaceDialog, Fa as ViewState, Qn as WalkthroughUtils, nr as WalkthroughView, Yi as getCSSChangeSummaryMessage, Ka as getResponseMarkdown };
|