@pasko70/pibo 1.0.0
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/.codex/skills/pi-agent-harness/SKILL.md +319 -0
- package/.codex/skills/pi-agent-harness/agents/openai.yaml +4 -0
- package/README.md +318 -0
- package/context/codex-base-prompt.md +144 -0
- package/context/pibo-compaction-prompt.md +100 -0
- package/context/pibo-system-prompt.md +17 -0
- package/dist/apps/chat/agent-profiles.js +26 -0
- package/dist/apps/chat/agent-store.js +336 -0
- package/dist/apps/chat/event-log.js +307 -0
- package/dist/apps/chat/read-model.js +218 -0
- package/dist/apps/chat/rooms.js +321 -0
- package/dist/apps/chat/session-metadata.js +14 -0
- package/dist/apps/chat/stream.js +122 -0
- package/dist/apps/chat/trace.js +1182 -0
- package/dist/apps/chat/web-app.js +2569 -0
- package/dist/apps/chat-ui/assets/apl-BxEMbctQ.js +1 -0
- package/dist/apps/chat-ui/assets/asciiarmor-eFjeGRuZ.js +1 -0
- package/dist/apps/chat-ui/assets/asn1-Cfx-0pt9.js +1 -0
- package/dist/apps/chat-ui/assets/asterisk-B5BHTsBr.js +1 -0
- package/dist/apps/chat-ui/assets/brainfuck-CAA2xofr.js +1 -0
- package/dist/apps/chat-ui/assets/clike-BoDCOLzN.js +1 -0
- package/dist/apps/chat-ui/assets/clojure-kVFSWX0o.js +1 -0
- package/dist/apps/chat-ui/assets/cmake-BUPAhezI.js +1 -0
- package/dist/apps/chat-ui/assets/cobol-BfgHZgup.js +1 -0
- package/dist/apps/chat-ui/assets/coffeescript-G1Pe_1AZ.js +1 -0
- package/dist/apps/chat-ui/assets/commonlisp-B3N0CjHn.js +1 -0
- package/dist/apps/chat-ui/assets/crystal-C15ndaGM.js +1 -0
- package/dist/apps/chat-ui/assets/css-BqOeyZOV.js +1 -0
- package/dist/apps/chat-ui/assets/cypher-KjIKv-wW.js +1 -0
- package/dist/apps/chat-ui/assets/d-BlT5AEC-.js +1 -0
- package/dist/apps/chat-ui/assets/diff-oF98tbqj.js +1 -0
- package/dist/apps/chat-ui/assets/dist--55mTWk3.js +1 -0
- package/dist/apps/chat-ui/assets/dist-B5rcjVCj.js +1 -0
- package/dist/apps/chat-ui/assets/dist-BPv5MdlL.js +1 -0
- package/dist/apps/chat-ui/assets/dist-BZ39rB1W.js +1 -0
- package/dist/apps/chat-ui/assets/dist-BsedZGJo.js +1 -0
- package/dist/apps/chat-ui/assets/dist-BvO6SpaM.js +9 -0
- package/dist/apps/chat-ui/assets/dist-C5YJOwhH.js +1 -0
- package/dist/apps/chat-ui/assets/dist-C5oXtFSP.js +1 -0
- package/dist/apps/chat-ui/assets/dist-CG_gRSwv.js +23 -0
- package/dist/apps/chat-ui/assets/dist-CKM5j-iy.js +1 -0
- package/dist/apps/chat-ui/assets/dist-CUp9us2q.js +1 -0
- package/dist/apps/chat-ui/assets/dist-CZ9T4Cly.js +1 -0
- package/dist/apps/chat-ui/assets/dist-D4HhiFWB.js +6 -0
- package/dist/apps/chat-ui/assets/dist-DHE-yBLH.js +1 -0
- package/dist/apps/chat-ui/assets/dist-DSKQpPaz.js +1 -0
- package/dist/apps/chat-ui/assets/dist-L1B-KWZO.js +1 -0
- package/dist/apps/chat-ui/assets/dist-SVPsM5Oi.js +13 -0
- package/dist/apps/chat-ui/assets/dist-Zqt9kNG9.js +1 -0
- package/dist/apps/chat-ui/assets/dist-_DPv0-QF.js +1 -0
- package/dist/apps/chat-ui/assets/dist-_oM7g0eh.js +11 -0
- package/dist/apps/chat-ui/assets/dist-laadbMWg.js +1 -0
- package/dist/apps/chat-ui/assets/dist-nFui3f-r.js +2 -0
- package/dist/apps/chat-ui/assets/dist-tGfufz3b.js +1 -0
- package/dist/apps/chat-ui/assets/dockerfile-CUaqzcqp.js +1 -0
- package/dist/apps/chat-ui/assets/dtd-VCA9yr61.js +1 -0
- package/dist/apps/chat-ui/assets/dylan-O-V5Dw5W.js +1 -0
- package/dist/apps/chat-ui/assets/ebnf-SPmdBkvT.js +1 -0
- package/dist/apps/chat-ui/assets/ecl-ChfCttfI.js +1 -0
- package/dist/apps/chat-ui/assets/eiffel-cB9EbjeN.js +1 -0
- package/dist/apps/chat-ui/assets/elm-BTiVflBU.js +1 -0
- package/dist/apps/chat-ui/assets/erlang-egf0TXFm.js +1 -0
- package/dist/apps/chat-ui/assets/factor-C2tAxNob.js +1 -0
- package/dist/apps/chat-ui/assets/fcl-BiCjh1tj.js +1 -0
- package/dist/apps/chat-ui/assets/forth-C4kDGW6u.js +1 -0
- package/dist/apps/chat-ui/assets/fortran-DzkLaPnd.js +1 -0
- package/dist/apps/chat-ui/assets/gas-DMOxskQF.js +1 -0
- package/dist/apps/chat-ui/assets/gherkin-BPxBpp-k.js +1 -0
- package/dist/apps/chat-ui/assets/groovy-CkEnc0ZY.js +1 -0
- package/dist/apps/chat-ui/assets/haskell-Dadpo9-w.js +1 -0
- package/dist/apps/chat-ui/assets/haxe-CDNZL9MW.js +1 -0
- package/dist/apps/chat-ui/assets/http-jy9Zxxt3.js +1 -0
- package/dist/apps/chat-ui/assets/idl-CGSB6iiy.js +1 -0
- package/dist/apps/chat-ui/assets/index-BdcqTugD.js +151 -0
- package/dist/apps/chat-ui/assets/index-Dk-opWl3.css +1 -0
- package/dist/apps/chat-ui/assets/javascript-DSlzRUd8.js +1 -0
- package/dist/apps/chat-ui/assets/julia-DTiF9v6R.js +1 -0
- package/dist/apps/chat-ui/assets/livescript-Ci8Xxna6.js +1 -0
- package/dist/apps/chat-ui/assets/lua-eVxIrt9t.js +1 -0
- package/dist/apps/chat-ui/assets/mathematica-Da3grj36.js +1 -0
- package/dist/apps/chat-ui/assets/mbox-BWBMSafM.js +1 -0
- package/dist/apps/chat-ui/assets/mirc-CtHu9S1B.js +1 -0
- package/dist/apps/chat-ui/assets/mllike-wTFlPWXS.js +1 -0
- package/dist/apps/chat-ui/assets/modelica-cKbQ0UXu.js +1 -0
- package/dist/apps/chat-ui/assets/mscgen-C5pXQCMK.js +1 -0
- package/dist/apps/chat-ui/assets/mumps-CKBHkOQq.js +1 -0
- package/dist/apps/chat-ui/assets/nginx-B00AiQel.js +1 -0
- package/dist/apps/chat-ui/assets/nsis-SMDwKltR.js +1 -0
- package/dist/apps/chat-ui/assets/ntriples-B_36EBV0.js +1 -0
- package/dist/apps/chat-ui/assets/octave-BXPjzAif.js +1 -0
- package/dist/apps/chat-ui/assets/oz-Dedpat1M.js +1 -0
- package/dist/apps/chat-ui/assets/pascal-CMcUg72K.js +1 -0
- package/dist/apps/chat-ui/assets/perl-DoVTbnzt.js +1 -0
- package/dist/apps/chat-ui/assets/pig-CULXT1YV.js +1 -0
- package/dist/apps/chat-ui/assets/powershell-Cv5Uhf6b.js +1 -0
- package/dist/apps/chat-ui/assets/properties-CQ1C2P-M.js +1 -0
- package/dist/apps/chat-ui/assets/protobuf-SRlvzrl6.js +1 -0
- package/dist/apps/chat-ui/assets/pug-Bo3wfL-f.js +1 -0
- package/dist/apps/chat-ui/assets/puppet-ClSqCGj6.js +1 -0
- package/dist/apps/chat-ui/assets/python-C2_X1GpX.js +1 -0
- package/dist/apps/chat-ui/assets/q-B_6Gdyzl.js +1 -0
- package/dist/apps/chat-ui/assets/r-BD07NGED.js +1 -0
- package/dist/apps/chat-ui/assets/rolldown-runtime-S-ySWqyJ.js +1 -0
- package/dist/apps/chat-ui/assets/rpm-CRu5Z2Jl.js +1 -0
- package/dist/apps/chat-ui/assets/ruby-dZPnOz8h.js +1 -0
- package/dist/apps/chat-ui/assets/sas-S2t8_sDI.js +1 -0
- package/dist/apps/chat-ui/assets/scheme-WcyFWLW2.js +1 -0
- package/dist/apps/chat-ui/assets/shell-DUelnYSh.js +1 -0
- package/dist/apps/chat-ui/assets/sieve-jDjlVhNh.js +1 -0
- package/dist/apps/chat-ui/assets/simple-mode-CL04yRVp.js +1 -0
- package/dist/apps/chat-ui/assets/smalltalk-ddWDYy10.js +1 -0
- package/dist/apps/chat-ui/assets/solr-C7rQhLuW.js +1 -0
- package/dist/apps/chat-ui/assets/sparql--fPCCgVd.js +1 -0
- package/dist/apps/chat-ui/assets/spreadsheet-DjthqD5G.js +1 -0
- package/dist/apps/chat-ui/assets/sql-D_dieYbr.js +1 -0
- package/dist/apps/chat-ui/assets/stex-rHcFYcA0.js +1 -0
- package/dist/apps/chat-ui/assets/stylus-DxF70RNr.js +1 -0
- package/dist/apps/chat-ui/assets/swift-T0hDoOb-.js +1 -0
- package/dist/apps/chat-ui/assets/tcl-Dlzy1mPk.js +1 -0
- package/dist/apps/chat-ui/assets/textile-Dy5rFZe5.js +1 -0
- package/dist/apps/chat-ui/assets/tiddlywiki-DQP1OymS.js +1 -0
- package/dist/apps/chat-ui/assets/tiki-0vOj3DB2.js +1 -0
- package/dist/apps/chat-ui/assets/toml-DEltN0lI.js +1 -0
- package/dist/apps/chat-ui/assets/troff-CRbBpEqY.js +1 -0
- package/dist/apps/chat-ui/assets/ttcn-M5q1nLKg.js +1 -0
- package/dist/apps/chat-ui/assets/ttcn-cfg-Rmw9NWq9.js +1 -0
- package/dist/apps/chat-ui/assets/turtle-BCDWhJK0.js +1 -0
- package/dist/apps/chat-ui/assets/vb-QQ7LGlOz.js +1 -0
- package/dist/apps/chat-ui/assets/vbscript-BiSEdUzz.js +1 -0
- package/dist/apps/chat-ui/assets/velocity-CzMg5_6w.js +1 -0
- package/dist/apps/chat-ui/assets/verilog-BJOO83gk.js +1 -0
- package/dist/apps/chat-ui/assets/vhdl-ed4zAZAA.js +1 -0
- package/dist/apps/chat-ui/assets/webidl-Ddy6hbV6.js +1 -0
- package/dist/apps/chat-ui/assets/xquery-Bw1zwhh6.js +1 -0
- package/dist/apps/chat-ui/assets/yacas-DZdTXy3s.js +1 -0
- package/dist/apps/chat-ui/assets/z80-DMG02_YV.js +1 -0
- package/dist/apps/chat-ui/index.html +15 -0
- package/dist/apps/context-files-ui/assets/apl-14BqhLYK.js +1 -0
- package/dist/apps/context-files-ui/assets/asciiarmor-WLvjqI7d.js +1 -0
- package/dist/apps/context-files-ui/assets/asn1-Bg4FbdCg.js +1 -0
- package/dist/apps/context-files-ui/assets/asterisk-B2MO-X4d.js +1 -0
- package/dist/apps/context-files-ui/assets/brainfuck-CV9kufud.js +1 -0
- package/dist/apps/context-files-ui/assets/clike-CjmcUpt6.js +1 -0
- package/dist/apps/context-files-ui/assets/clojure-De3QGfx6.js +1 -0
- package/dist/apps/context-files-ui/assets/cmake-i2VDNaRq.js +1 -0
- package/dist/apps/context-files-ui/assets/cobol-BwO6DF08.js +1 -0
- package/dist/apps/context-files-ui/assets/coffeescript-BtivDvRz.js +1 -0
- package/dist/apps/context-files-ui/assets/commonlisp-DFkEQdLP.js +1 -0
- package/dist/apps/context-files-ui/assets/crystal-CU0NkcVL.js +1 -0
- package/dist/apps/context-files-ui/assets/css-CbMZAQ1W.js +1 -0
- package/dist/apps/context-files-ui/assets/cypher-Dke5QOzv.js +1 -0
- package/dist/apps/context-files-ui/assets/d-TPqSVaHM.js +1 -0
- package/dist/apps/context-files-ui/assets/diff-B365LSoZ.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-B5PTVnox.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-B5ZAfwf5.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-BJW3917N.js +11 -0
- package/dist/apps/context-files-ui/assets/dist-BkUONE3N.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-CKQF1zEu.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-CwbH_3RN.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-CxRLRmMx.js +2 -0
- package/dist/apps/context-files-ui/assets/dist-D1KyNDg5.js +13 -0
- package/dist/apps/context-files-ui/assets/dist-DFi2YGux.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DKoyMSNr.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DLMjd26T.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DQXzt2Ng.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DotDq_kD.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DyfSeBMu.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-MyZgX9K2.js +9 -0
- package/dist/apps/context-files-ui/assets/dist-QQuDy4KA.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-YwR9dpb-.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-dTBsFYAl.js +1 -0
- package/dist/apps/context-files-ui/assets/dockerfile-CJb2sekW.js +1 -0
- package/dist/apps/context-files-ui/assets/dtd-CBMymJ7O.js +1 -0
- package/dist/apps/context-files-ui/assets/dylan-08Azy1NK.js +1 -0
- package/dist/apps/context-files-ui/assets/ebnf-Dkum_1J8.js +1 -0
- package/dist/apps/context-files-ui/assets/ecl-dhxjHL8y.js +1 -0
- package/dist/apps/context-files-ui/assets/eiffel-C446m6dI.js +1 -0
- package/dist/apps/context-files-ui/assets/elm-po1E9de0.js +1 -0
- package/dist/apps/context-files-ui/assets/erlang-BD5LkVkR.js +1 -0
- package/dist/apps/context-files-ui/assets/factor-B2EMQZkP.js +1 -0
- package/dist/apps/context-files-ui/assets/fcl-DkEOamHd.js +1 -0
- package/dist/apps/context-files-ui/assets/forth-dCg2_HVB.js +1 -0
- package/dist/apps/context-files-ui/assets/fortran-3ZpXLFh1.js +1 -0
- package/dist/apps/context-files-ui/assets/gas-DMmxLZRI.js +1 -0
- package/dist/apps/context-files-ui/assets/gherkin-DUSFg2R6.js +1 -0
- package/dist/apps/context-files-ui/assets/groovy-Cmduloe1.js +1 -0
- package/dist/apps/context-files-ui/assets/haskell-Cyr255R9.js +1 -0
- package/dist/apps/context-files-ui/assets/haxe-BJVKtprM.js +1 -0
- package/dist/apps/context-files-ui/assets/http-DszHFpc-.js +1 -0
- package/dist/apps/context-files-ui/assets/idl-Cati9Nrv.js +1 -0
- package/dist/apps/context-files-ui/assets/index-BwRDoHMC.css +1 -0
- package/dist/apps/context-files-ui/assets/index-GwvjXytt.js +202 -0
- package/dist/apps/context-files-ui/assets/javascript-C5pDVaoP.js +1 -0
- package/dist/apps/context-files-ui/assets/julia-DlqY1cTU.js +1 -0
- package/dist/apps/context-files-ui/assets/livescript-C6p8-2W1.js +1 -0
- package/dist/apps/context-files-ui/assets/lua-BxuTHaF7.js +1 -0
- package/dist/apps/context-files-ui/assets/mathematica-nDHZUMJT.js +1 -0
- package/dist/apps/context-files-ui/assets/mbox-DAaR0Hcz.js +1 -0
- package/dist/apps/context-files-ui/assets/mirc-CCA0FRfl.js +1 -0
- package/dist/apps/context-files-ui/assets/mllike-Cw3Iccsb.js +1 -0
- package/dist/apps/context-files-ui/assets/modelica-Czx80fNR.js +1 -0
- package/dist/apps/context-files-ui/assets/mscgen-BmfuTbzG.js +1 -0
- package/dist/apps/context-files-ui/assets/mumps-Ds_ZaumL.js +1 -0
- package/dist/apps/context-files-ui/assets/nginx-D9M2PQ4U.js +1 -0
- package/dist/apps/context-files-ui/assets/nsis-DOo3SJmd.js +1 -0
- package/dist/apps/context-files-ui/assets/ntriples-DLHGTvHs.js +1 -0
- package/dist/apps/context-files-ui/assets/octave-8jj96JiC.js +1 -0
- package/dist/apps/context-files-ui/assets/oz-BmMq7iC4.js +1 -0
- package/dist/apps/context-files-ui/assets/pascal-BgMr6XpT.js +1 -0
- package/dist/apps/context-files-ui/assets/perl-D6YJObi_.js +1 -0
- package/dist/apps/context-files-ui/assets/pig-nx7uchs8.js +1 -0
- package/dist/apps/context-files-ui/assets/powershell-B4IPkVxR.js +1 -0
- package/dist/apps/context-files-ui/assets/properties-CoavQdLC.js +1 -0
- package/dist/apps/context-files-ui/assets/protobuf-D5EWhcmc.js +1 -0
- package/dist/apps/context-files-ui/assets/pug-QU72BPAa.js +1 -0
- package/dist/apps/context-files-ui/assets/puppet-B_0GFuyD.js +1 -0
- package/dist/apps/context-files-ui/assets/python-Cs7sNzy_.js +1 -0
- package/dist/apps/context-files-ui/assets/q-BIB9pPtI.js +1 -0
- package/dist/apps/context-files-ui/assets/r-CN5s4f3o.js +1 -0
- package/dist/apps/context-files-ui/assets/rpm-Ct_Ck8mQ.js +1 -0
- package/dist/apps/context-files-ui/assets/ruby-BVPradRk.js +1 -0
- package/dist/apps/context-files-ui/assets/sas-DN4j74IF.js +1 -0
- package/dist/apps/context-files-ui/assets/scheme-CvNgHAnh.js +1 -0
- package/dist/apps/context-files-ui/assets/shell-BjiMLAaM.js +1 -0
- package/dist/apps/context-files-ui/assets/sieve-C2U1O5Z4.js +1 -0
- package/dist/apps/context-files-ui/assets/simple-mode-DnMbQuKW.js +1 -0
- package/dist/apps/context-files-ui/assets/smalltalk-DkYwYufV.js +1 -0
- package/dist/apps/context-files-ui/assets/solr-BopnSD-v.js +1 -0
- package/dist/apps/context-files-ui/assets/sparql-Cpg3YQfd.js +1 -0
- package/dist/apps/context-files-ui/assets/spreadsheet-kRxtVt9J.js +1 -0
- package/dist/apps/context-files-ui/assets/sql-DYI2GwJR.js +1 -0
- package/dist/apps/context-files-ui/assets/stex-BCRT8IJ3.js +1 -0
- package/dist/apps/context-files-ui/assets/stylus-CARoeVE9.js +1 -0
- package/dist/apps/context-files-ui/assets/swift-DKNaLAK6.js +1 -0
- package/dist/apps/context-files-ui/assets/tcl-CQyXkgMH.js +1 -0
- package/dist/apps/context-files-ui/assets/textile-Yg_UWn-t.js +1 -0
- package/dist/apps/context-files-ui/assets/tiddlywiki-dqVbkfX4.js +1 -0
- package/dist/apps/context-files-ui/assets/tiki-CC_ic8g0.js +1 -0
- package/dist/apps/context-files-ui/assets/toml-B7gGzVkJ.js +1 -0
- package/dist/apps/context-files-ui/assets/troff-Bq3z6oAu.js +1 -0
- package/dist/apps/context-files-ui/assets/ttcn-GvRgs2AT.js +1 -0
- package/dist/apps/context-files-ui/assets/ttcn-cfg-CGCXz7Vo.js +1 -0
- package/dist/apps/context-files-ui/assets/turtle-CwIpz2yy.js +1 -0
- package/dist/apps/context-files-ui/assets/vb-BmcHUM2C.js +1 -0
- package/dist/apps/context-files-ui/assets/vbscript-Cs9dylre.js +1 -0
- package/dist/apps/context-files-ui/assets/velocity-CBWU0VCy.js +1 -0
- package/dist/apps/context-files-ui/assets/verilog-DVCHmufx.js +1 -0
- package/dist/apps/context-files-ui/assets/vhdl-BGDk4f1d.js +1 -0
- package/dist/apps/context-files-ui/assets/webidl-egXQEWlC.js +1 -0
- package/dist/apps/context-files-ui/assets/xquery-5f0hn7cg.js +1 -0
- package/dist/apps/context-files-ui/assets/yacas-DNs9XkmQ.js +1 -0
- package/dist/apps/context-files-ui/assets/z80-B7Dfb4UO.js +1 -0
- package/dist/apps/context-files-ui/index.html +14 -0
- package/dist/auth/better-auth.js +129 -0
- package/dist/auth/types.js +14 -0
- package/dist/bin/pibo.js +3 -0
- package/dist/channels/types.js +1 -0
- package/dist/cli-errors.js +18 -0
- package/dist/cli.js +264 -0
- package/dist/config/config.js +167 -0
- package/dist/core/base-prompt.js +104 -0
- package/dist/core/codex-compat.js +44 -0
- package/dist/core/compaction-prompt.js +258 -0
- package/dist/core/events.js +1 -0
- package/dist/core/profiles.js +138 -0
- package/dist/core/routed-session.js +538 -0
- package/dist/core/runtime.js +323 -0
- package/dist/core/session-router.js +437 -0
- package/dist/core/system-prompt-template.js +56 -0
- package/dist/core/thinking.js +9 -0
- package/dist/core/workspace.js +5 -0
- package/dist/debug/events.js +92 -0
- package/dist/debug/index.js +631 -0
- package/dist/debug/session.js +200 -0
- package/dist/debug/sql.js +238 -0
- package/dist/debug/stores.js +49 -0
- package/dist/debug/trace.js +245 -0
- package/dist/env.js +32 -0
- package/dist/gateway/client.js +200 -0
- package/dist/gateway/protocol.js +46 -0
- package/dist/gateway/request.js +146 -0
- package/dist/gateway/server.js +221 -0
- package/dist/gateway/tool.js +69 -0
- package/dist/gateway/web.js +80 -0
- package/dist/index.js +23 -0
- package/dist/local/client.js +77 -0
- package/dist/local/extension.js +548 -0
- package/dist/local/tui.js +25 -0
- package/dist/mcp/agent-context.js +123 -0
- package/dist/mcp/client.js +332 -0
- package/dist/mcp/commands/call.js +146 -0
- package/dist/mcp/commands/grep.js +145 -0
- package/dist/mcp/commands/info.js +71 -0
- package/dist/mcp/commands/list.js +94 -0
- package/dist/mcp/config-command.js +217 -0
- package/dist/mcp/config.js +440 -0
- package/dist/mcp/daemon-client.js +266 -0
- package/dist/mcp/daemon.js +327 -0
- package/dist/mcp/errors.js +287 -0
- package/dist/mcp/index.js +431 -0
- package/dist/mcp/output.js +171 -0
- package/dist/mcp/python-runtime.js +131 -0
- package/dist/mcp/registry.js +116 -0
- package/dist/mcp/version.js +5 -0
- package/dist/pi-packages/cli.js +92 -0
- package/dist/pi-packages/installer.js +70 -0
- package/dist/pi-packages/metadata.js +231 -0
- package/dist/pi-packages/runtime.js +61 -0
- package/dist/pi-packages/store.js +175 -0
- package/dist/pi-packages/types.js +1 -0
- package/dist/plugins/better-auth.js +11 -0
- package/dist/plugins/builtin.js +249 -0
- package/dist/plugins/chat-web.js +11 -0
- package/dist/plugins/codex-compat.js +72 -0
- package/dist/plugins/context-files-store.js +354 -0
- package/dist/plugins/context-files.js +999 -0
- package/dist/plugins/core-tools.js +94 -0
- package/dist/plugins/example.js +67 -0
- package/dist/plugins/registry.js +368 -0
- package/dist/plugins/remote-agent.js +9 -0
- package/dist/plugins/types.js +1 -0
- package/dist/plugins/web.js +11 -0
- package/dist/reliability/store.js +759 -0
- package/dist/remote/channel.js +176 -0
- package/dist/remote/client.js +92 -0
- package/dist/remote/examples/tui-controller.js +263 -0
- package/dist/remote/protocol.js +55 -0
- package/dist/remote/session-client.js +189 -0
- package/dist/runs/registry.js +323 -0
- package/dist/runs/tools.js +185 -0
- package/dist/sessions/bindings.js +41 -0
- package/dist/sessions/sqlite-store.js +154 -0
- package/dist/sessions/store.js +125 -0
- package/dist/shared/trace-order.js +83 -0
- package/dist/subagents/tool.js +63 -0
- package/dist/tools/browser-use-cdp.js +207 -0
- package/dist/tools/browser-use-leases.js +338 -0
- package/dist/tools/browser-use-wrapper.js +338 -0
- package/dist/tools/codex-compat.js +85 -0
- package/dist/tools/desktop-env.js +90 -0
- package/dist/tools/guides.js +276 -0
- package/dist/tools/index.js +366 -0
- package/dist/tools/python-runtime.js +154 -0
- package/dist/tools/registry.js +107 -0
- package/dist/tools/web-search.js +137 -0
- package/dist/web/auth.js +10 -0
- package/dist/web/channel.js +151 -0
- package/dist/web/http.js +110 -0
- package/dist/web/types.js +1 -0
- package/package.json +74 -0
- package/src/mcp/LICENSE.mcp-cli +21 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-nFui3f-r.js","assets/dist-SVPsM5Oi.js","assets/dist-tGfufz3b.js","assets/dist-C5YJOwhH.js","assets/dist-CKM5j-iy.js","assets/rolldown-runtime-S-ySWqyJ.js","assets/dist-_oM7g0eh.js","assets/dist-laadbMWg.js","assets/dist-CG_gRSwv.js","assets/dist--55mTWk3.js","assets/dist-B5rcjVCj.js","assets/dist-BZ39rB1W.js","assets/dist-C5oXtFSP.js","assets/dist-BPv5MdlL.js","assets/dist-D4HhiFWB.js","assets/dist-_DPv0-QF.js","assets/dist-BvO6SpaM.js","assets/dist-CUp9us2q.js","assets/dist-DSKQpPaz.js","assets/dist-CZ9T4Cly.js","assets/dist-Zqt9kNG9.js","assets/dist-BsedZGJo.js","assets/dockerfile-CUaqzcqp.js","assets/simple-mode-CL04yRVp.js","assets/factor-C2tAxNob.js","assets/nsis-SMDwKltR.js","assets/pug-Bo3wfL-f.js","assets/javascript-DSlzRUd8.js","assets/dist-L1B-KWZO.js","assets/dist-DHE-yBLH.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-S-ySWqyJ.js";import{$ as r,A as i,At as a,Ct as o,Dt as s,E as c,Et as l,G as u,J as d,K as f,L as p,Mt as m,Nt as h,O as g,Ot as _,P as v,Pt as y,Q as b,S as x,St as S,T as C,Tt as w,W as T,X as E,Y as D,Z as O,_t as k,a as A,at as j,bt as M,c as N,ct as P,dt as F,et as ee,f as te,ft as ne,g as re,gt as I,ht as ie,it as ae,j as oe,jt as se,kt as ce,l as le,lt as ue,mt as de,n as fe,nt as pe,o as me,ot as he,pt as ge,q as _e,rt as ve,st as ye,t as be,tt as xe,ut as Se,v as Ce,vt as we,w as Te,wt as Ee,x as De,xt as Oe,yt as ke}from"./dist-SVPsM5Oi.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Ae=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ee=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},te={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),je=n(((e,t)=>{t.exports=Ae()})),Me=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ne=n(((e,t)=>{t.exports=Me()})),Pe=n((e=>{var t=je();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),Fe=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Pe()})),Ie=n((e=>{var t=Ne(),n=je(),r=Fe();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},ee=[],te=-1;function ne(e){return{current:e}}function re(e){0>te||(e.current=ee[te],ee[te]=null,te--)}function I(e,t){te++,ee[te]=e.current,e.current=t}var ie=ne(null),ae=ne(null),oe=ne(null),se=ne(null);function ce(e,t){switch(I(oe,t),I(ae,e),I(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$d(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$d(t),e=ef(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}re(ie),I(ie,e)}function le(){re(ie),re(ae),re(oe)}function ue(e){e.memoizedState!==null&&I(se,e);var t=ie.current,n=ef(t,e.type);t!==n&&(I(ae,e),I(ie,n))}function de(e){ae.current===e&&(re(ie),re(ae)),se.current===e&&(re(se),up._currentValue=F)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,we=t.unstable_now,Te=t.unstable_getCurrentPriorityLevel,Ee=t.unstable_ImmediatePriority,De=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,ke=t.unstable_LowPriority,Ae=t.unstable_IdlePriority,Me=t.log,Pe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Me==`function`&&Pe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=P.p;return e===0?(e=window.event,e===void 0?32:Ep(e.type)):e}function ot(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,ut=`__reactContainer$`+st,dt=`__reactEvents$`+st,ft=`__reactListeners$`+st,pt=`__reactHandles$`+st,mt=`__reactResources$`+st,ht=`__reactMarker$`+st;function gt(e){delete e[ct],delete e[lt],delete e[dt],delete e[ft],delete e[pt]}function _t(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cf(e);e!==null;){if(n=e[ct])return n;e=Cf(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[ct]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function bt(e){var t=e[mt];return t||=e[mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[ht]=!0}var St=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)St.add(t[e])}var Et=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Dt={},Ot={};function kt(e){return ye.call(Ot,e)?!0:ye.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Mt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function It(e){if(!e._valueTracker){var t=Pt(e)?`checked`:`value`;e._valueTracker=Ft(e,t,``+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Rt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Nt(n)):Ut(e,o,Nt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Nt(s):e.removeAttribute(`name`)}function Ht(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){It(e);return}n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),It(e)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Gt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),It(e)}function qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var L=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function R(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||L.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&R(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&R(e,o,t[o])}function Yt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Xt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Zt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qt(e){return Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function $t(){}var en=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,rn=null;function an(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[lt]||null;if(!a)throw Error(i(90));Vt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var on=!1;function sn(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(nn!==null||rn!==null)&&(ju(),nn&&(t=nn,e=rn,rn=nn=null,an(t),e)))for(t=0;t<e.length;t++)an(e[t])}}function cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var ln=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,`passive`,{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return mn=i.slice(e,1<r?1-r:void 0)}function gn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _n(){return!0}function vn(){return!1}function yn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?_n:vn,this.isPropagationStopped=vn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),Sn=f({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,En,Dn=f({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==En&&(En&&e.type===`mousemove`?(wn=e.screenX-En.screenX,Tn=e.screenY-En.screenY):Tn=wn=0,En=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),On=yn(Dn),kn=yn(f({},Dn,{dataTransfer:0})),An=yn(f({},Sn,{relatedTarget:0})),jn=yn(f({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Mn=yn(f({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Nn=yn(f({},bn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var zn=yn(f({},Sn,{key:function(e){if(e.key){var t=Pn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Bn=yn(f({},Dn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Vn=yn(f({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Hn=yn(f({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=yn(f({},Dn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Wn=yn(f({},bn,{newState:0,oldState:0})),Gn=[9,13,27,32],Kn=ln&&`CompositionEvent`in window,qn=null;ln&&`documentMode`in document&&(qn=document.documentMode);var Jn=ln&&`TextEvent`in window&&!qn,Yn=ln&&(!Kn||qn&&8<qn&&11>=qn),Xn=` `,Zn=!1;function Qn(e,t){switch(e){case`keyup`:return Gn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function $n(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var er=!1;function tr(e,t){switch(e){case`compositionend`:return $n(t);case`keypress`:return t.which===32?(Zn=!0,Xn):null;case`textInput`:return e=t.data,e===Xn&&Zn?null:e;default:return null}}function nr(e,t){if(er)return e===`compositionend`||!Kn&&Qn(e,t)?(e=hn(),mn=pn=fn=null,er=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Yn&&t.locale!==`ko`?null:t.data;default:return null}}var rr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!rr[e.type]:t===`textarea`}function ar(e,t,n,r){nn?rn?rn.push(r):rn=[r]:nn=r,t=Rd(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var or=null,sr=null;function cr(e){jd(e,0)}function lr(e){if(Lt(yt(e)))return e}function ur(e,t){if(e===`change`)return t}var dr=!1;if(ln){var fr;if(ln){var pr=`oninput`in document;if(!pr){var mr=document.createElement(`div`);mr.setAttribute(`oninput`,`return;`),pr=typeof mr.oninput==`function`}fr=pr}else fr=!1;dr=fr&&(!document.documentMode||9<document.documentMode)}function hr(){or&&(or.detachEvent(`onpropertychange`,gr),sr=or=null)}function gr(e){if(e.propertyName===`value`&&lr(sr)){var t=[];ar(t,sr,e,tn(e)),sn(cr,t)}}function _r(e,t,n){e===`focusin`?(hr(),or=t,sr=n,or.attachEvent(`onpropertychange`,gr)):e===`focusout`&&hr()}function vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return lr(sr)}function yr(e,t){if(e===`click`)return lr(t)}function br(e,t){if(e===`input`||e===`change`)return lr(t)}function xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:xr;function Cr(e,t){if(Sr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ye.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rt(e.document)}return t}function Or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var kr=ln&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==Rt(r)||(r=Ar,`selectionStart`in r&&Or(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mr&&Cr(Mr,r)||(Mr=r,r=Rd(jr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ir={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Lr={},Rr={};ln&&(Rr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),`TransitionEvent`in window||delete Ir.transitionend.transition);function zr(e){if(Lr[e])return Lr[e];if(!Ir[e])return e;var t=Ir[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rr)return Lr[e]=t[n];return e}var Br=zr(`animationend`),Vr=zr(`animationiteration`),Hr=zr(`animationstart`),Ur=zr(`transitionrun`),Wr=zr(`transitionstart`),Gr=zr(`transitioncancel`),Kr=zr(`transitionend`),qr=new Map,Jr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Jr.push(`scrollEnd`);function Yr(e,t){qr.set(e,t),wt(t,[e])}var Xr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Zr=[],Qr=0,$r=0;function ei(){for(var e=Qr,t=$r=Qr=0;t<e;){var n=Zr[t];Zr[t++]=null;var r=Zr[t];Zr[t++]=null;var i=Zr[t];Zr[t++]=null;var a=Zr[t];if(Zr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ii(n,i,a)}}function ti(e,t,n,r){Zr[Qr++]=e,Zr[Qr++]=t,Zr[Qr++]=n,Zr[Qr++]=r,$r|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ni(e,t,n,r){return ti(e,t,n,r),ai(e)}function ri(e,t){return ti(e,null,null,t),ai(e)}function ii(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ai(e){if(50<Su)throw Su=0,Cu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function si(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(e,t,n,r){return new si(e,t,n,r)}function li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,t){var n=e.alternate;return n===null?(n=ci(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function di(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)li(e)&&(s=1);else if(typeof e==`string`)s=tp(e,n,ie.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=ci(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return pi(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=ci(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=ci(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=ci(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ci(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function pi(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function mi(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function hi(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function gi(e,t,n){return t=ci(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _i=new WeakMap;function vi(e,t){if(typeof e==`object`&&e){var n=_i.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},_i.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var yi=[],bi=0,xi=null,Si=0,Ci=[],wi=0,Ti=null,Ei=1,Di=``;function Oi(e,t){yi[bi++]=Si,yi[bi++]=xi,xi=e,Si=t}function ki(e,t,n){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ti=e;var r=Ei;e=Di;var i=32-ze(r)-1;r&=~(1<<i),n+=1;var a=32-ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ei=1<<32-ze(t)+i|n<<i|r,Di=a+e}else Ei=1<<a|n<<i|r,Di=e}function Ai(e){e.return!==null&&(Oi(e,1),ki(e,1,0))}function ji(e){for(;e===xi;)xi=yi[--bi],yi[bi]=null,Si=yi[--bi],yi[bi]=null;for(;e===Ti;)Ti=Ci[--wi],Ci[wi]=null,Di=Ci[--wi],Ci[wi]=null,Ei=Ci[--wi],Ci[wi]=null}function Mi(e,t){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ei=t.id,Di=t.overflow,Ti=e}var Ni=null,Pi=null,Fi=!1,Ii=null,Li=!1,Ri=Error(i(519));function zi(e){throw Gi(vi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ri}function Bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:B(`cancel`,t),B(`close`,t);break;case`iframe`:case`object`:case`embed`:B(`load`,t);break;case`video`:case`audio`:for(n=0;n<kd.length;n++)B(kd[n],t);break;case`source`:B(`error`,t);break;case`img`:case`image`:case`link`:B(`error`,t),B(`load`,t);break;case`details`:B(`toggle`,t);break;case`input`:B(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:B(`invalid`,t);break;case`textarea`:B(`invalid`,t),Kt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Wd(t.textContent,n)?(r.popover!=null&&(B(`beforetoggle`,t),B(`toggle`,t)),r.onScroll!=null&&B(`scroll`,t),r.onScrollEnd!=null&&B(`scrollend`,t),r.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||zi(e,!0)}function Vi(e){for(Ni=e.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Ni=Ni.return}}function Hi(e){if(e!==Ni)return!1;if(!Fi)return Vi(e),Fi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||tf(e.type,e.memoizedProps)),n=!n),n&&Pi&&zi(e),Vi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=Sf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=Sf(e)}else t===27?(t=Pi,uf(e.type)?(e=xf,xf=null,Pi=e):Pi=t):Pi=Ni?bf(e.stateNode.nextSibling):null;return!0}function Ui(){Pi=Ni=null,Fi=!1}function Wi(){var e=Ii;return e!==null&&(cu===null?cu=e:cu.push.apply(cu,e),Ii=null),e}function Gi(e){Ii===null?Ii=[e]:Ii.push(e)}var Ki=ne(null),qi=null,Ji=null;function Yi(e,t,n){I(Ki,t._currentValue),t._currentValue=n}function Xi(e){e._currentValue=Ki.current,re(Ki)}function Zi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Zi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Zi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function $i(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Sr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[up]:e.push(up))}a=a.return}e!==null&&Qi(t,e,n,r),t.flags|=262144}function ea(e){for(e=e.firstContext;e!==null;){if(!Sr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ta(e){qi=e,Ji=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function na(e){return ia(qi,e)}function ra(e,t){return qi===null&&ta(e),ia(e,t)}function ia(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ji===null){if(e===null)throw Error(i(308));Ji=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ji=Ji.next=t;return n}var aa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},oa=t.unstable_scheduleCallback,sa=t.unstable_NormalPriority,ca={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function la(){return{controller:new aa,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&oa(sa,function(){e.controller.abort()})}var da=null,fa=0,pa=0,ma=null;function ha(e,t){if(da===null){var n=da=[];fa=0,pa=Cd(),ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return fa++,t.then(ga,ga),t}function ga(){if(--fa===0&&da!==null){ma!==null&&(ma.status=`fulfilled`);var e=da;da=null,pa=0,ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _a(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var va=N.S;N.S=function(e,t){du=we(),typeof t==`object`&&t&&typeof t.then==`function`&&ha(e,t),va!==null&&va(e,t)};var ya=ne(null);function ba(){var e=ya.current;return e===null?Kl.pooledCache:e}function xa(e,t){t===null?I(ya,ya.current):I(ya,t.pool)}function Sa(){var e=ba();return e===null?null:{parent:ca._currentValue,pool:e}}var Ca=Error(i(460)),wa=Error(i(474)),Ta=Error(i(542)),Ea={then:function(){}};function Da(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Oa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e;default:if(typeof t.status==`string`)t.then($t,$t);else{if(e=Kl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e}throw Aa=t,Ca}}function ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Aa=e,Ca):e}}var Aa=null;function ja(){if(Aa===null)throw Error(i(459));var e=Aa;return Aa=null,e}function Ma(e){if(e===Ca||e===Ta)throw Error(i(483))}var Na=null,Pa=0;function Fa(e){var t=Pa;return Pa+=1,Na===null&&(Na=[]),Oa(Na,e,t)}function Ia(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function La(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ra(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ui(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=mi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&ka(i)===t.type)?(t=a(t,n.props),Ia(t,n),t.return=e,t):(t=fi(n.type,n.key,n.props,null,e.mode,r),Ia(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=gi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=pi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=fi(t.type,t.key,t.props,null,e.mode,n),Ia(n,t),n.return=e,n;case h:return t=gi(t,e.mode,n),t.return=e,t;case T:return t=ka(t),f(e,t,n)}if(M(t)||k(t))return t=pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Fa(t),n);if(t.$$typeof===b)return f(e,ra(e,t),n);La(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=ka(n),p(e,t,n,r)}if(M(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Fa(n),r);if(n.$$typeof===b)return p(e,t,ra(e,n),r);La(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=ka(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Fa(r),i);if(r.$$typeof===b)return _(e,t,n,ra(t,r),i);La(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Fi&&Oi(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Fi&&Oi(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Fi&&Oi(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Fi&&Oi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Fi&&Oi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Fi&&Oi(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=pi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=fi(o.type,o.key,o.props,null,e.mode,c),Ia(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=gi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=ka(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Fa(o),c);if(o.$$typeof===b)return x(e,r,ra(e,o),c);La(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=x(e,t,n,r);return Na=null,i}catch(t){if(t===Ca||t===Ta)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var za=Ra(!0),Ba=Ra(!1),Va=!1;function Ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Gl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return ti(e,r,t,n),ai(e)}function Ka(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}function qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ja=!1;function Ya(){if(Ja){var e=ma;if(e!==null)throw e}}function Xa(e,t,n,r){Ja=!1;var i=e.updateQueue;Va=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Jl&p)===p:(r&p)===p){p!==0&&p===pa&&(Ja=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Va=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),nu|=o,e.lanes=o,e.memoizedState=d}}function Za(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Za(n[e],t)}var $a=ne(null),eo=ne(0);function to(e,t){e=eu,I(eo,e),I($a,t),eu=e|t.baseLanes}function no(){I(eo,eu),I($a,$a.current)}function ro(){eu=eo.current,re($a),re(eo)}var io=ne(null),ao=null;function oo(e){var t=e.alternate;I(fo,fo.current&1),I(io,e),ao===null&&(t===null||$a.current!==null||t.memoizedState!==null)&&(ao=e)}function so(e){I(fo,fo.current),I(io,e),ao===null&&(ao=e)}function co(e){e.tag===22?(I(fo,fo.current),I(io,e),ao===null&&(ao=e)):lo(e)}function lo(){I(fo,fo.current),I(io,io.current)}function uo(e){re(io),ao===e&&(ao=null),re(fo)}var fo=ne(0);function po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_f(n)||vf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mo=0,ho=null,go=null,_o=null,vo=!1,yo=!1,bo=!1,xo=0,So=0,Co=null,wo=0;function To(){throw Error(i(321))}function Eo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function Do(e,t,n,r,i,a){return mo=a,ho=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ws:Gs,bo=!1,a=n(r,i),bo=!1,yo&&(a=ko(t,n,r,i)),Oo(e),a}function Oo(e){N.H=Us;var t=go!==null&&go.next!==null;if(mo=0,_o=go=ho=null,vo=!1,So=0,Co=null,t)throw Error(i(300));e===null||cc||(e=e.dependencies,e!==null&&ea(e)&&(cc=!0))}function ko(e,t,n,r){ho=e;var a=0;do{if(yo&&(Co=null),So=0,yo=!1,25<=a)throw Error(i(301));if(a+=1,_o=go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Ks,o=t(n,r)}while(yo);return o}function Ao(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Lo(t):t,e=e.useState()[0],(go===null?null:go.memoizedState)!==e&&(ho.flags|=1024),t}function jo(){var e=xo!==0;return xo=0,e}function Mo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function No(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}mo=0,_o=go=ho=null,yo=!1,So=xo=0,Co=null}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _o===null?ho.memoizedState=_o=e:_o=_o.next=e,_o}function Fo(){if(go===null){var e=ho.alternate;e=e===null?null:e.memoizedState}else e=go.next;var t=_o===null?ho.memoizedState:_o.next;if(t!==null)_o=t,go=e;else{if(e===null)throw ho.alternate===null?Error(i(467)):Error(i(310));go=e,e={memoizedState:go.memoizedState,baseState:go.baseState,baseQueue:go.baseQueue,queue:go.queue,next:null},_o===null?ho.memoizedState=_o=e:_o=_o.next=e}return _o}function Io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(e){var t=So;return So+=1,Co===null&&(Co=[]),e=Oa(Co,e,t),t=ho,(_o===null?t.memoizedState:_o.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ws:Gs),e}function Ro(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Lo(e);if(e.$$typeof===b)return na(e)}throw Error(i(438,String(e)))}function zo(e){var t=null,n=ho.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=ho.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Io(),ho.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function Bo(e,t){return typeof t==`function`?t(e):t}function Vo(e){return Ho(Fo(),go,e)}function Ho(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(mo&f)===f:(Jl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===pa&&(d=!0);else if((mo&p)===p){u=u.next,p===pa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,ho.lanes|=p,nu|=p;f=u.action,bo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,ho.lanes|=f,nu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Sr(o,e.memoizedState)&&(cc=!0,d&&(n=ma,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Uo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Sr(o,t.memoizedState)||(cc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Wo(e,t,n){var r=ho,a=Fo(),o=Fi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Sr((go||a).memoizedState,n);if(s&&(a.memoizedState=n,cc=!0),a=a.queue,hs(qo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||_o!==null&&_o.memoizedState.tag&1){if(r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,a,n,t),null),Kl===null)throw Error(i(349));o||mo&127||Go(r,t,n)}return n}function Go(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ho.updateQueue,t===null?(t=Io(),ho.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ko(e,t,n,r){t.value=n,t.getSnapshot=r,Jo(t)&&Yo(e)}function qo(e,t,n){return n(function(){Jo(t)&&Yo(e)})}function Jo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function Yo(e){var t=ri(e,2);t!==null&&Eu(t,e,2)}function Xo(e){var t=Po();if(typeof e==`function`){var n=e;if(e=n(),bo){Re(!0);try{n()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t}function Zo(e,t,n,r){return e.baseState=n,Ho(e,go,typeof r==`function`?r:Bo)}function Qo(e,t,n,r,a){if(Bs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,$o(t,o)):(o.next=n.next,t.pending=n.next=o)}}function $o(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),es(e,t,s)}catch(n){ns(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),es(e,t,a)}catch(n){ns(e,t,n)}}function es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ts(e,t,n)},function(n){return ns(e,t,n)}):ts(e,t,n)}function ts(e,t,n){t.status=`fulfilled`,t.value=n,rs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,$o(e,n)))}function ns(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,rs(t),t=t.next;while(t!==r)}e.action=null}function rs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function is(e,t){return t}function as(e,t){if(Fi){var n=Kl.formState;if(n!==null){a:{var r=ho;if(Fi){if(Pi){b:{for(var i=Pi,a=Li;i.nodeType!==8;){if(!a){i=null;break b}if(i=bf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Pi=bf(i.nextSibling),r=i.data===`F!`;break a}}zi(r)}r=!1}r&&(t=n[0])}}return n=Po(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:t},n.queue=r,n=Ls.bind(null,ho,r),r.dispatch=n,r=Xo(!1),a=zs.bind(null,ho,!1,r.queue),r=Po(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Qo.bind(null,ho,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function os(e){return ss(Fo(),go,e)}function ss(e,t,n){if(t=Ho(e,t,is)[0],e=Vo(Bo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Lo(t)}catch(e){throw e===Ca?Ta:e}else r=t;t=Fo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(ho.flags|=2048,us(9,{destroy:void 0},cs.bind(null,i,n),null)),[r,a,e]}function cs(e,t){e.action=t}function ls(e){var t=Fo(),n=go;if(n!==null)return ss(t,n,e);Fo(),t=t.memoizedState,n=Fo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function us(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=ho.updateQueue,t===null&&(t=Io(),ho.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ds(){return Fo().memoizedState}function fs(e,t,n,r){var i=Po();ho.flags|=e,i.memoizedState=us(1|t,{destroy:void 0},n,r===void 0?null:r)}function ps(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=i.memoizedState.inst;go!==null&&r!==null&&Eo(r,go.memoizedState.deps)?i.memoizedState=us(t,a,n,r):(ho.flags|=e,i.memoizedState=us(1|t,a,n,r))}function ms(e,t){fs(8390656,8,e,t)}function hs(e,t){ps(2048,8,e,t)}function gs(e){ho.flags|=4;var t=ho.updateQueue;if(t===null)t=Io(),ho.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function _s(e){var t=Fo().memoizedState;return gs({ref:t,nextImpl:e}),function(){if(Gl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function vs(e,t){return ps(4,2,e,t)}function ys(e,t){return ps(4,4,e,t)}function bs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xs(e,t,n){n=n==null?null:n.concat([e]),ps(4,4,bs.bind(null,t,e),n)}function Ss(){}function Cs(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Eo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ws(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Eo(t,r[1]))return r[0];if(r=e(),bo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r}function Ts(e,t,n){return n===void 0||mo&1073741824&&!(Jl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Tu(),ho.lanes|=e,nu|=e,n)}function Es(e,t,n,r){return Sr(n,t)?n:$a.current===null?!(mo&42)||mo&1073741824&&!(Jl&261930)?(cc=!0,e.memoizedState=n):(e=Tu(),ho.lanes|=e,nu|=e,t):(e=Ts(e,n,r),Sr(e,t)||(cc=!0),e)}function Ds(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,zs(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Rs(e,t,_a(c,r),wu(e)):Rs(e,t,r,wu(e))}catch(n){Rs(e,t,{then:function(){},status:`rejected`,reason:n},wu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function Os(){}function ks(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=As(e).queue;Ds(e,a,t,F,n===null?Os:function(){return js(e),n(r)})}function As(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function js(e){var t=As(e);t.next===null&&(t=e.alternate.memoizedState),Rs(e,t.next.queue,{},wu())}function Ms(){return na(up)}function Ns(){return Fo().memoizedState}function Ps(){return Fo().memoizedState}function Fs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=wu();e=Wa(n);var r=Ga(t,e,n);r!==null&&(Eu(r,t,n),Ka(r,t,n)),t={cache:la()},e.payload=t;return}t=t.return}}function Is(e,t,n){var r=wu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bs(e)?Vs(t,n):(n=ni(e,t,n,r),n!==null&&(Eu(n,e,r),Hs(n,t,r)))}function Ls(e,t,n){Rs(e,t,n,wu())}function Rs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bs(e))Vs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Sr(s,o))return ti(e,t,i,0),Kl===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return Eu(n,e,r),Hs(n,t,r),!0}return!1}function zs(e,t,n,r){if(r={lane:2,revertLane:Cd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Bs(e)){if(t)throw Error(i(479))}else t=ni(e,n,r,2),t!==null&&Eu(t,e,2)}function Bs(e){var t=e.alternate;return e===ho||t!==null&&t===ho}function Vs(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Us={readContext:na,use:Ro,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useInsertionEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useSyncExternalStore:To,useId:To,useHostTransitionStatus:To,useFormState:To,useActionState:To,useOptimistic:To,useMemoCache:To,useCacheRefresh:To};Us.useEffectEvent=To;var Ws={readContext:na,use:Ro,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:na,useEffect:ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),fs(4194308,4,bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fs(4194308,4,e,t)},useInsertionEffect:function(e,t){fs(4,2,e,t)},useMemo:function(e,t){var n=Po();t=t===void 0?null:t;var r=e();if(bo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Po();if(n!==void 0){var i=n(t);if(bo){Re(!0);try{n(t)}finally{Re(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Is.bind(null,ho,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:function(e){e=Xo(e);var t=e.queue,n=Ls.bind(null,ho,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ss,useDeferredValue:function(e,t){return Ts(Po(),e,t)},useTransition:function(){var e=Xo(!1);return e=Ds.bind(null,ho,e.queue,!0,!1),Po().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ho,a=Po();if(Fi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Kl===null)throw Error(i(349));Jl&127||Go(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ms(qo.bind(null,r,o,e),[e]),r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,o,n,t),null),n},useId:function(){var e=Po(),t=Kl.identifierPrefix;if(Fi){var n=Di,r=Ei;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ms,useFormState:as,useActionState:as,useOptimistic:function(e){var t=Po();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=zs.bind(null,ho,!0,n),n.dispatch=t,[e,t]},useMemoCache:zo,useCacheRefresh:function(){return Po().memoizedState=Fs.bind(null,ho)},useEffectEvent:function(e){var t=Po(),n={impl:e};return t.memoizedState=n,function(){if(Gl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Gs={readContext:na,use:Ro,useCallback:Cs,useContext:na,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Vo,useRef:ds,useState:function(){return Vo(Bo)},useDebugValue:Ss,useDeferredValue:function(e,t){return Es(Fo(),go.memoizedState,e,t)},useTransition:function(){var e=Vo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ns,useHostTransitionStatus:Ms,useFormState:os,useActionState:os,useOptimistic:function(e,t){return Zo(Fo(),go,e,t)},useMemoCache:zo,useCacheRefresh:Ps};Gs.useEffectEvent=_s;var Ks={readContext:na,use:Ro,useCallback:Cs,useContext:na,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Uo,useRef:ds,useState:function(){return Uo(Bo)},useDebugValue:Ss,useDeferredValue:function(e,t){var n=Fo();return go===null?Ts(n,e,t):Es(n,go.memoizedState,e,t)},useTransition:function(){var e=Uo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ns,useHostTransitionStatus:Ms,useFormState:ls,useActionState:ls,useOptimistic:function(e,t){var n=Fo();return go===null?(n.baseState=e,[e,n.queue.dispatch]):Zo(n,go,e,t)},useMemoCache:zo,useCacheRefresh:Ps};Ks.useEffectEvent=_s;function qs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Js={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wu(),i=Wa(r);i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Eu(t,e,r),Ka(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wu(),i=Wa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Eu(t,e,r),Ka(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wu(),r=Wa(n);r.tag=2,t!=null&&(r.callback=t),t=Ga(e,r,n),t!==null&&(Eu(t,e,n),Ka(t,e,n))}};function Ys(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Cr(n,r)||!Cr(i,a):!0}function Xs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Js.enqueueReplaceState(t,t.state,null)}function Zs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Qs(e){Xr(e)}function $s(e){console.error(e)}function ec(e){Xr(e)}function tc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function nc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function rc(e,t,n){return n=Wa(n),n.tag=3,n.payload={element:null},n.callback=function(){tc(e,t)},n}function ic(e){return e=Wa(e),e.tag=3,e}function ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){nc(t,n,r),typeof i!=`function`&&(mu===null?mu=new Set([this]):mu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function oc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&$i(t,n,a,!0),n=io.current,n!==null){switch(n.tag){case 31:case 13:return ao===null?Ru():n.alternate===null&&tu===0&&(tu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),rd(e,r,a)),!1;case 22:return n.flags|=65536,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),rd(e,r,a)),!1}throw Error(i(435,n.tag))}return rd(e,r,a),Ru(),!1}if(Fi)return t=io.current,t===null?(r!==Ri&&(t=Error(i(423),{cause:r}),Gi(vi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=vi(r,n),a=rc(e.stateNode,r,a),qa(e,a),tu!==4&&(tu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ri&&(e=Error(i(422),{cause:r}),Gi(vi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=vi(o,n),su===null?su=[o]:su.push(o),tu!==4&&(tu=2),t===null)return!0;r=vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=rc(n.stateNode,r,e),qa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(mu===null||!mu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ic(a),ac(a,e,n,r),qa(n,a),!1}n=n.return}while(n!==null);return!1}var sc=Error(i(461)),cc=!1;function lc(e,t,n,r){t.child=e===null?Ba(t,null,n,r):za(t,e.child,n,r)}function uc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ta(t),r=Do(e,t,n,o,a,i),s=jo(),e!==null&&!cc?(Mo(e,t,i),Nc(e,t,i)):(Fi&&s&&Ai(t),t.flags|=1,lc(e,t,r,i),t.child)}function dc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,fc(e,t,a,r,i)):(e=fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Pc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return Nc(e,t,i)}return t.flags|=1,e=ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(cc=!1,t.pendingProps=r=a,Pc(e,i))e.flags&131072&&(cc=!0);else return t.lanes=e.lanes,Nc(e,t,i)}return yc(e,t,n,r,i)}function pc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xa(t,a===null?null:a.cachePool),a===null?no():to(t,a),co(t);else return r=t.lanes=536870912,hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&xa(t,null),no(),lo(t)):(xa(t,a.cachePool),to(t,a),lo(t),t.memoizedState=null);return lc(e,t,i,n),t.child}function mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hc(e,t,n,r,i){var a=ba();return a=a===null?null:{parent:ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&xa(t,null),no(),co(t),e!==null&&$i(e,t,r,!0),t.childLanes=i,null}function z(e,t){return t=Oc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function gc(e,t,n){return za(t,e.child,null,n),e=z(t,t.pendingProps),e.flags|=2,uo(t),t.memoizedState=null,e}function _c(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Fi){if(r.mode===`hidden`)return e=z(t,r),t.lanes=536870912,mc(null,e);if(so(t),(e=Pi)?(e=gf(e,Li),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw zi(t);return t.lanes=536870912,null}return z(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(so(t),a)if(t.flags&256)t.flags&=-257,t=gc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(cc||$i(e,t,n,!1),a=(n&e.childLanes)!==0,cc||a){if(r=Kl,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ri(e,s),Eu(r,e,s),sc;Ru(),t=gc(e,t,n)}else e=o.treeContext,Pi=bf(s.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&Mi(t,e),t=z(t,r),t.flags|=4096;return t}return e=ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function vc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function yc(e,t,n,r,i){return ta(t),n=Do(e,t,n,r,void 0,i),r=jo(),e!==null&&!cc?(Mo(e,t,i),Nc(e,t,i)):(Fi&&r&&Ai(t),t.flags|=1,lc(e,t,n,i),t.child)}function bc(e,t,n,r,i,a){return ta(t),t.updateQueue=null,n=ko(t,r,n,i),Oo(e),r=jo(),e!==null&&!cc?(Mo(e,t,a),Nc(e,t,a)):(Fi&&r&&Ai(t),t.flags|=1,lc(e,t,n,a),t.child)}function xc(e,t,n,r,i){if(ta(t),t.stateNode===null){var a=oi,o=n.contextType;typeof o==`object`&&o&&(a=na(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Js,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ha(t),o=n.contextType,a.context=typeof o==`object`&&o?na(o):oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(qs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Js.enqueueReplaceState(a,a.state,null),Xa(t,r,a,i),Ya(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=oi,typeof u==`object`&&u&&(o=na(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Xs(t,a,r,o),Va=!1;var f=t.memoizedState;a.state=f,Xa(t,r,a,i),Ya(),l=t.memoizedState,s||f!==l||Va?(typeof d==`function`&&(qs(t,n,d,r),l=t.memoizedState),(c=Va||Ys(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ua(e,t),o=t.memoizedProps,u=Zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=oi,typeof l==`object`&&l&&(c=na(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Xs(t,a,r,c),Va=!1,f=t.memoizedState,a.state=f,Xa(t,r,a,i),Ya();var p=t.memoizedState;o!==d||f!==p||Va||e!==null&&e.dependencies!==null&&ea(e.dependencies)?(typeof s==`function`&&(qs(t,n,s,r),p=t.memoizedState),(u=Va||Ys(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ea(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,vc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=za(t,e.child,null,i),t.child=za(t,null,n,i)):lc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Nc(e,t,i),e}function Sc(e,t,n,r){return Ui(),t.flags|=256,lc(e,t,n,r),t.child}var Cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wc(e){return{baseLanes:e,cachePool:Sa()}}function Tc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=au),e}function Ec(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(fo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Fi){if(a?oo(t):lo(t),(e=Pi)?(e=gf(e,Li),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw zi(t);return vf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(lo(t),a=t.mode,c=Oc({mode:`hidden`,children:c},a),r=pi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,mc(null,r)):(oo(t),Dc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(oo(t),t.flags&=-257,t=kc(e,t,n)):t.memoizedState===null?(lo(t),c=r.fallback,a=t.mode,r=Oc({mode:`visible`,children:r.children},a),c=pi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,za(t,e.child,null,n),r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,t=mc(null,r)):(lo(t),t.child=e.child,t.flags|=128,t=null);else if(oo(t),vf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Gi({value:r,source:null,stack:null}),t=kc(e,t,n)}else if(cc||$i(e,t,n,!1),s=(n&e.childLanes)!==0,cc||s){if(s=Kl,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ri(e,r),Eu(s,e,r),sc;_f(c)||Ru(),t=kc(e,t,n)}else _f(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Pi=bf(c.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&Mi(t,e),t=Dc(t,r.children),t.flags|=4096);return t}return a?(lo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ui(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=pi(c,a,n,null),c.flags|=2):c=ui(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,mc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=wc(n):(a=c.cachePool,a===null?a=Sa():(l=ca._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Tc(e,s,n),t.memoizedState=Cc,mc(e.child,r)):(oo(t),n=e.child,e=n.sibling,n=ui(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Dc(e,t){return t=Oc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Oc(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function kc(e,t,n){return za(t,e.child,null,n),e=Dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ac(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zi(e.return,t,n)}function jc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Mc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=fo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(fo,o),lc(e,t,r,n),r=Fi?Si:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ac(e,n,t);else if(e.tag===19)Ac(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&po(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),jc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}jc(t,!0,n,null,a,r);break;case`together`:jc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Nc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),nu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if($i(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Pc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ea(e))):!0}function Fc(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Yi(t,ca,e.memoizedState.cache),Ui();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Yi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,so(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(oo(t),e=Nc(e,t,n),e===null?null:e.sibling):Ec(e,t,n):(oo(t),t.flags|=128,null);oo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=($i(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Mc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(fo,fo.current),r)break;return null;case 22:return t.lanes=0,pc(e,t,n,t.pendingProps);case 24:Yi(t,ca,e.memoizedState.cache)}return Nc(e,t,n)}function Ic(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)cc=!0;else{if(!Pc(e,n)&&!(t.flags&128))return cc=!1,Fc(e,t,n);cc=!!(e.flags&131072)}else cc=!1,Fi&&t.flags&1048576&&ki(t,Si,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ka(t.elementType),t.type=e,typeof e==`function`)li(e)?(r=Zs(e,r),t.tag=1,t=xc(null,t,e,r,n)):(t.tag=0,t=yc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=uc(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=dc(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return yc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Zs(r,t.pendingProps),xc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ua(e,t),Xa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Yi(t,ca,r),r!==o.cache&&Qi(t,[ca],n,!0),Ya(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Sc(e,t,r,n);break a}else if(r!==a){a=vi(Error(i(424)),t),Gi(a),t=Sc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Pi=bf(e.firstChild),Ni=t,Fi=!0,Ii=null,Li=!0,n=Ba(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ui(),r===a){t=Nc(e,t,n);break a}lc(e,t,r,n)}t=t.child}return t;case 26:return vc(e,t),e===null?(n=Vf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Fi||(n=t.type,e=t.pendingProps,r=Qd(oe.current).createElement(n),r[ct]=t,r[lt]=e,qd(r,n,e),xt(r),t.stateNode=r):t.memoizedState=Vf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&Fi&&(r=t.stateNode=wf(t.type,t.pendingProps,oe.current),Ni=t,Li=!0,a=Pi,uf(t.type)?(xf=a,Pi=bf(r.firstChild)):Pi=a),lc(e,t,t.pendingProps.children,n),vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fi&&((a=r=Pi)&&(r=mf(r,t.type,t.pendingProps,Li),r===null?a=!1:(t.stateNode=r,Ni=t,Pi=bf(r.firstChild),Li=!1,a=!0)),a||zi(t)),ue(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,tf(a,o)?r=null:s!==null&&tf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Do(e,t,Ao,null,null,n),up._currentValue=a),vc(e,t),lc(e,t,r,n),t.child;case 6:return e===null&&Fi&&((e=n=Pi)&&(n=hf(n,t.pendingProps,Li),n===null?e=!1:(t.stateNode=n,Ni=t,Pi=null,e=!0)),e||zi(t)),null;case 13:return Ec(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=za(t,null,r,n):lc(e,t,r,n),t.child;case 11:return uc(e,t,t.type,t.pendingProps,n);case 7:return lc(e,t,t.pendingProps,n),t.child;case 8:return lc(e,t,t.pendingProps.children,n),t.child;case 12:return lc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Yi(t,t.type,r.value),lc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ta(t),a=na(a),r=r(a),t.flags|=1,lc(e,t,r,n),t.child;case 14:return dc(e,t,t.type,t.pendingProps,n);case 15:return fc(e,t,t.type,t.pendingProps,n);case 19:return Mc(e,t,n);case 31:return _c(e,t,n);case 22:return pc(e,t,n,t.pendingProps);case 24:return ta(t),r=na(ca),e===null?(a=ba(),a===null&&(a=Kl,o=la(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ha(t),Yi(t,ca,a)):((e.lanes&n)!==0&&(Ua(e,t),Xa(t,null,null,n),Ya()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Yi(t,ca,r),r!==a.cache&&Qi(t,[ca],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Yi(t,ca,r))),lc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Lc(e){e.flags|=4}function Rc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Fu())e.flags|=8192;else throw Aa=Ea,wa}else e.flags&=-16777217}function zc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!np(t))if(Fu())e.flags|=8192;else throw Aa=Ea,wa}function Bc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,ou|=t)}function Vc(e,t){if(!Fi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Hc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Uc(e,t,n){var r=t.pendingProps;switch(ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hc(t),null;case 1:return Hc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Xi(ca),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?Lc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wi())),Hc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Lc(t),o===null?(Hc(t),Rc(t,a,null,r,n)):(Hc(t),zc(t,o))):o?o===e.memoizedState?(Hc(t),t.flags&=-16777217):(Lc(t),Hc(t),zc(t,o)):(e=e.memoizedProps,e!==r&&Lc(t),Hc(t),Rc(t,a,e,r,n)),null;case 27:if(de(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Hc(t),null}e=ie.current,Hi(t)?Bi(t,e):(e=wf(a,r,n),t.stateNode=e,Lc(t))}return Hc(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Hc(t),null}if(o=ie.current,Hi(t))Bi(t,o);else{var s=Qd(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ct]=t,o[lt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(qd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Lc(t)}}return Hc(t),Rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,Hi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ni,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Wd(e.nodeValue,n)),e||zi(t,!0)}else e=Qd(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Hc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ct]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),e=!1}else n=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(uo(t),t):(uo(t),null);if(t.flags&128)throw Error(i(558))}return Hc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ct]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),a=!1}else a=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(uo(t),t):(uo(t),null)}return uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Bc(t,t.updateQueue),Hc(t),null);case 4:return le(),e===null&&Pd(t.stateNode.containerInfo),Hc(t),null;case 10:return Xi(t.type),Hc(t),null;case 19:if(re(fo),r=t.memoizedState,r===null)return Hc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Vc(r,!1);else{if(tu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=po(e),o!==null){for(t.flags|=128,Vc(r,!1),e=o.updateQueue,t.updateQueue=e,Bc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)di(n,e),n=n.sibling;return I(fo,fo.current&1|2),Fi&&Oi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>fu&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304)}else{if(!a)if(e=po(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Bc(t,e),Vc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Fi)return Hc(t),null}else 2*we()-r.renderingStartTime>fu&&n!==536870912&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Hc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,n=fo.current,I(fo,a?n&1|2:n&1),Fi&&Oi(t,r.treeForkCount),e);case 22:case 23:return uo(t),ro(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Hc(t),t.subtreeFlags&6&&(t.flags|=8192)):Hc(t),n=t.updateQueue,n!==null&&Bc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&re(ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xi(ca),Hc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Wc(e,t){switch(ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(ca),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(uo(t),t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(fo),null;case 4:return le(),null;case 10:return Xi(t.type),null;case 22:case 23:return uo(t),ro(),e!==null&&re(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xi(ca),null;case 25:return null;default:return null}}function Gc(e,t){switch(ji(t),t.tag){case 3:Xi(ca),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&uo(t);break;case 13:uo(t);break;case 19:re(fo);break;case 10:Xi(t.type);break;case 22:case 23:uo(t),ro(),e!==null&&re(ya);break;case 24:Xi(ca)}}function Kc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){nd(t,t.return,e)}}function qc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){nd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){nd(t,t.return,e)}}function Jc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Qa(t,n)}catch(t){nd(e,e.return,t)}}}function Yc(e,t,n){n.props=Zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){nd(e,t,n)}}function Xc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){nd(e,t,n)}}function Zc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){nd(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){nd(e,t,n)}else n.current=null}function Qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){nd(e,e.return,t)}}function $c(e,t,n){try{var r=e.stateNode;Jd(r,e.type,n,t),r[lt]=t}catch(t){nd(e,e.return,t)}}function el(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&uf(e.type)||e.tag===4}function tl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||el(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&uf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);qd(t,r,n),t[ct]=e,t[lt]=n}catch(t){nd(e,e.return,t)}}var al=!1,ol=!1,sl=!1,cl=typeof WeakSet==`function`?WeakSet:Set,ll=null;function ul(e,t){if(e=e.containerInfo,Xd=yp,e=Dr(e),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Zd={focusedElem:e,selectionRange:n},yp=!1,ll=t;ll!==null;)if(t=ll,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ll=e;else for(;ll!==null;){switch(t=ll,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){nd(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)pf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:pf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ll=e;break}ll=t.return}}function dl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:El(e,n),r&4&&Kc(5,n);break;case 1:if(El(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){nd(n,n.return,e)}else{var i=Zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){nd(n,n.return,e)}}r&64&&Jc(n),r&512&&Xc(n,n.return);break;case 3:if(El(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Qa(e,t)}catch(e){nd(n,n.return,e)}}break;case 27:t===null&&r&4&&il(n);case 26:case 5:El(e,n),t===null&&r&4&&Qc(n),r&512&&Xc(n,n.return);break;case 12:El(e,n);break;case 31:El(e,n),r&4&&_l(e,n);break;case 13:El(e,n),r&4&&vl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=od.bind(null,n),yf(e,n))));break;case 22:if(r=n.memoizedState!==null||al,!r){t=t!==null&&t.memoizedState!==null||ol,i=al;var a=ol;al=r,(ol=t)&&!a?Ol(e,n,(n.subtreeFlags&8772)!=0):El(e,n),al=i,ol=a}break;case 30:break;default:El(e,n)}}function fl(e){var t=e.alternate;t!==null&&(e.alternate=null,fl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&>(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var pl=null,ml=!1;function hl(e,t,n){for(n=n.child;n!==null;)gl(e,t,n),n=n.sibling}function gl(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:ol||Zc(n,t),hl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ol||Zc(n,t);var r=pl,i=ml;uf(n.type)&&(pl=n.stateNode,ml=!1),hl(e,t,n),Tf(n.stateNode),pl=r,ml=i;break;case 5:ol||Zc(n,t);case 6:if(r=pl,i=ml,pl=null,hl(e,t,n),pl=r,ml=i,pl!==null)if(ml)try{(pl.nodeType===9?pl.body:pl.nodeName===`HTML`?pl.ownerDocument.body:pl).removeChild(n.stateNode)}catch(e){nd(n,t,e)}else try{pl.removeChild(n.stateNode)}catch(e){nd(n,t,e)}break;case 18:pl!==null&&(ml?(e=pl,df(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Gp(e)):df(pl,n.stateNode));break;case 4:r=pl,i=ml,pl=n.stateNode.containerInfo,ml=!0,hl(e,t,n),pl=r,ml=i;break;case 0:case 11:case 14:case 15:qc(2,n,t),ol||qc(4,n,t),hl(e,t,n);break;case 1:ol||(Zc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Yc(n,t,r)),hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:ol=(r=ol)||n.memoizedState!==null,hl(e,t,n),ol=r;break;default:hl(e,t,n)}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gp(e)}catch(e){nd(t,t.return,e)}}}function vl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gp(e)}catch(e){nd(t,t.return,e)}}function yl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cl),t;default:throw Error(i(435,e.tag))}}function bl(e,t){var n=yl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=sd.bind(null,e,t);t.then(r,r)}})}function xl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(uf(c.type)){pl=c.stateNode,ml=!1;break a}break;case 5:pl=c.stateNode,ml=!1;break a;case 3:case 4:pl=c.stateNode.containerInfo,ml=!0;break a}c=c.return}if(pl===null)throw Error(i(160));gl(o,s,a),pl=null,ml=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cl(t,e),t=t.sibling}var Sl=null;function Cl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xl(t,e),wl(e),r&4&&(qc(3,e,e.return),Kc(3,e),qc(5,e,e.return));break;case 1:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&64&&al&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Sl;if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ht]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),qd(o,r,n),o[ct]=e,xt(o),r=o;break a;case`link`:var s=$f(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),qd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=$f(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),qd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ct]=e,xt(o),r=o}e.stateNode=r}else ep(a,e.type,e.stateNode);else e.stateNode=Jf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&$c(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?ep(a,e.type,e.stateNode):Jf(a,r,e.memoizedProps))}break;case 27:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),n!==null&&r&4&&$c(e,e.memoizedProps,n.memoizedProps);break;case 5:if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),e.flags&32){a=e.stateNode;try{qt(a,``)}catch(t){nd(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,$c(e,a,n===null?a:n.memoizedProps)),r&1024&&(sl=!0);break;case 6:if(xl(t,e),wl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){nd(e,e.return,t)}}break;case 3:if(Qf=null,a=Sl,Sl=Of(t.containerInfo),xl(t,e),Sl=a,wl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gp(t.containerInfo)}catch(t){nd(e,e.return,t)}sl&&(sl=!1,Tl(e));break;case 4:r=Sl,Sl=Of(e.stateNode.containerInfo),xl(t,e),wl(e),Sl=r;break;case 12:xl(t,e),wl(e);break;case 31:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 13:xl(t,e),wl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(uu=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=al,d=ol;if(al=u||a,ol=d||l,xl(t,e),ol=d,al=u,wl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||al||ol||Dl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){nd(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){nd(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ff(m,!0):ff(l.stateNode,!1)}catch(e){nd(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,bl(e,n))));break;case 19:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 30:break;case 21:break;default:xl(t,e),wl(e)}}function wl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(el(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;rl(e,tl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(qt(o,``),n.flags&=-33),rl(e,tl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;nl(e,tl(e),s);break;default:throw Error(i(161))}}catch(t){nd(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function El(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dl(e,t.alternate,t),t=t.sibling}function Dl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qc(4,t,t.return),Dl(t);break;case 1:Zc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Yc(t,t.return,n),Dl(t);break;case 27:Tf(t.stateNode);case 26:case 5:Zc(t,t.return),Dl(t);break;case 22:t.memoizedState===null&&Dl(t);break;case 30:Dl(t);break;default:Dl(t)}e=e.sibling}}function Ol(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Ol(i,a,n),Kc(4,a);break;case 1:if(Ol(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){nd(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Za(c[i],s)}catch(e){nd(r,r.return,e)}}n&&o&64&&Jc(a),Xc(a,a.return);break;case 27:il(a);case 26:case 5:Ol(i,a,n),n&&r===null&&o&4&&Qc(a),Xc(a,a.return);break;case 12:Ol(i,a,n);break;case 31:Ol(i,a,n),n&&o&4&&_l(i,a);break;case 13:Ol(i,a,n),n&&o&4&&vl(i,a);break;case 22:a.memoizedState===null&&Ol(i,a,n),Xc(a,a.return);break;case 30:break;default:Ol(i,a,n)}t=t.sibling}}function kl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ua(n))}function Al(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e))}function jl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ml(e,t,n,r),t=t.sibling}function Ml(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:jl(e,t,n,r),i&2048&&Kc(9,t);break;case 1:jl(e,t,n,r);break;case 3:jl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e)));break;case 12:if(i&2048){jl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){nd(t,t.return,e)}}else jl(e,t,n,r);break;case 31:jl(e,t,n,r);break;case 13:jl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?jl(e,t,n,r):(a._visibility|=2,Nl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?jl(e,t,n,r):Pl(e,t),i&2048&&kl(o,t);break;case 24:jl(e,t,n,r),i&2048&&Al(t.alternate,t);break;default:jl(e,t,n,r)}}function Nl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Nl(a,o,s,c,i),Kc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Nl(a,o,s,c,i)):u._visibility&2?Nl(a,o,s,c,i):Pl(a,o),i&&l&2048&&kl(o.alternate,o);break;case 24:Nl(a,o,s,c,i),i&&l&2048&&Al(o.alternate,o);break;default:Nl(a,o,s,c,i)}t=t.sibling}}function Pl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Pl(n,r),i&2048&&kl(r.alternate,r);break;case 24:Pl(n,r),i&2048&&Al(r.alternate,r);break;default:Pl(n,r)}t=t.sibling}}var Fl=8192;function Il(e,t,n){if(e.subtreeFlags&Fl)for(e=e.child;e!==null;)Ll(e,t,n),e=e.sibling}function Ll(e,t,n){switch(e.tag){case 26:Il(e,t,n),e.flags&Fl&&e.memoizedState!==null&&rp(n,Sl,e.memoizedState,e.memoizedProps);break;case 5:Il(e,t,n);break;case 3:case 4:var r=Sl;Sl=Of(e.stateNode.containerInfo),Il(e,t,n),Sl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Fl,Fl=16777216,Il(e,t,n),Fl=r):Il(e,t,n));break;default:Il(e,t,n)}}function Rl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Hl(r,e)}Rl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bl(e),e=e.sibling}function Bl(e){switch(e.tag){case 0:case 11:case 15:zl(e),e.flags&2048&&qc(9,e,e.return);break;case 3:zl(e);break;case 12:zl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vl(e)):zl(e);break;default:zl(e)}}function Vl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Hl(r,e)}Rl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qc(8,t,t.return),Vl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Vl(t));break;default:Vl(t)}e=e.sibling}}function Hl(e,t){for(;ll!==null;){var n=ll;switch(n.tag){case 0:case 11:case 15:qc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ua(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ll=r;else a:for(n=e;ll!==null;){r=ll;var i=r.sibling,a=r.return;if(fl(r),r===n){ll=null;break a}if(i!==null){i.return=a,ll=i;break a}ll=a}}}var Ul={getCacheForType:function(e){var t=na(ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return na(ca).controller.signal}},Wl=typeof WeakMap==`function`?WeakMap:Map,Gl=0,Kl=null,ql=null,Jl=0,Yl=0,Xl=null,Zl=!1,Ql=!1,$l=!1,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=0,su=null,cu=null,lu=!1,uu=0,du=0,fu=1/0,pu=null,mu=null,hu=0,gu=null,_u=null,vu=0,yu=0,bu=null,xu=null,Su=0,Cu=null;function wu(){return Gl&2&&Jl!==0?Jl&-Jl:N.T===null?at():Cd()}function Tu(){if(au===0)if(!(Jl&536870912)||Fi){var e=We;We<<=1,!(We&3932160)&&(We=262144),au=e}else au=536870912;return e=io.current,e!==null&&(e.flags|=32),au}function Eu(e,t,n){(e===Kl&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)&&(Nu(e,0),Au(e,Jl,au,!1)),Qe(e,n),(!(Gl&2)||e!==Kl)&&(e===Kl&&(!(Gl&2)&&(ru|=n),tu===4&&Au(e,Jl,au,!1)),hd(e))}function Du(e,t,n){if(Gl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Je(e,t),a=r?Vu(e,t):zu(e,t,!0),o=r;do{if(a===0){Ql&&!r&&Au(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!ku(n)){a=zu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=su;var l=c.current.memoizedState.isDehydrated;if(l&&(Nu(c,s).flags|=256),s=zu(c,s,!1),s!==2){if($l&&!l){c.errorRecoveryDisabledLanes|=o,ru|=o,a=4;break a}o=cu,cu=a,o!==null&&(cu===null?cu=o:cu.push.apply(cu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Nu(e,0),Au(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Au(r,t,au,!Zl);break a;case 2:cu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=uu+300-we(),10<a)){if(Au(r,t,au,!Zl),qe(r,0,!0)!==0)break a;vu=t,r.timeoutHandle=af(Ou.bind(null,r,n,cu,pu,lu,t,au,ru,ou,Zl,o,`Throttled`,-0,0),a);break a}Ou(r,n,cu,pu,lu,t,au,ru,ou,Zl,o,null,-0,0)}}break}while(1);hd(e)}function Ou(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$t},Ll(t,a,d);var m=(a&62914560)===a?uu-we():(a&4194048)===a?du-we():0;if(m=ap(d,m),m!==null){vu=a,e.cancelPendingCommit=m(Ju.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Au(e,a,o,!l);return}}Ju(e,t,a,n,r,i,o,s,c)}function ku(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Sr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Au(e,t,n,r){t&=~iu,t&=~ru,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function ju(){return Gl&6?!0:(gd(0,!1),!1)}function Mu(){if(ql!==null){if(Yl===0)var e=ql.return;else e=ql,Ji=qi=null,No(e),Na=null,Pa=0,e=ql;for(;e!==null;)Gc(e.alternate,e),e=e.return;ql=null}}function Nu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,of(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),vu=0,Mu(),Kl=e,ql=n=ui(e.current,null),Jl=t,Yl=0,Xl=null,Zl=!1,Ql=Je(e,t),$l=!1,ou=au=iu=ru=nu=tu=0,cu=su=null,lu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-ze(r),a=1<<i;t|=e[i],r&=~a}return eu=t,ei(),n}function Pu(e,t){ho=null,N.H=Us,t===Ca||t===Ta?(t=ja(),Yl=3):t===wa?(t=ja(),Yl=4):Yl=t===sc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Xl=t,ql===null&&(tu=1,tc(e,vi(t,e.current)))}function Fu(){var e=io.current;return e===null?!0:(Jl&4194048)===Jl?ao===null:(Jl&62914560)===Jl||Jl&536870912?e===ao:!1}function Iu(){var e=N.H;return N.H=Us,e===null?Us:e}function Lu(){var e=N.A;return N.A=Ul,e}function Ru(){tu=4,Zl||(Jl&4194048)!==Jl&&io.current!==null||(Ql=!0),!(nu&134217727)&&!(ru&134217727)||Kl===null||Au(Kl,Jl,au,!1)}function zu(e,t,n){var r=Gl;Gl|=2;var i=Iu(),a=Lu();(Kl!==e||Jl!==t)&&(pu=null,Nu(e,t)),t=!1;var o=tu;a:do try{if(Yl!==0&&ql!==null){var s=ql,c=Xl;switch(Yl){case 8:Mu(),o=6;break a;case 3:case 2:case 9:case 6:io.current===null&&(t=!0);var l=Yl;if(Yl=0,Xl=null,Gu(e,s,c,l),n&&Ql){o=0;break a}break;default:l=Yl,Yl=0,Xl=null,Gu(e,s,c,l)}}Bu(),o=tu;break}catch(t){Pu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ji=qi=null,Gl=r,N.H=i,N.A=a,ql===null&&(Kl=null,Jl=0,ei()),o}function Bu(){for(;ql!==null;)Uu(ql)}function Vu(e,t){var n=Gl;Gl|=2;var r=Iu(),a=Lu();Kl!==e||Jl!==t?(pu=null,fu=we()+500,Nu(e,t)):Ql=Je(e,t);a:do try{if(Yl!==0&&ql!==null){t=ql;var o=Xl;b:switch(Yl){case 1:Yl=0,Xl=null,Gu(e,t,o,1);break;case 2:case 9:if(Da(o)){Yl=0,Xl=null,Wu(t);break}t=function(){Yl!==2&&Yl!==9||Kl!==e||(Yl=7),hd(e)},o.then(t,t);break a;case 3:Yl=7;break a;case 4:Yl=5;break a;case 7:Da(o)?(Yl=0,Xl=null,Wu(t)):(Yl=0,Xl=null,Gu(e,t,o,7));break;case 5:var s=null;switch(ql.tag){case 26:s=ql.memoizedState;case 5:case 27:var c=ql;if(s?np(s):c.stateNode.complete){Yl=0,Xl=null;var l=c.sibling;if(l!==null)ql=l;else{var u=c.return;u===null?ql=null:(ql=u,Ku(u))}break b}}Yl=0,Xl=null,Gu(e,t,o,5);break;case 6:Yl=0,Xl=null,Gu(e,t,o,6);break;case 8:Mu(),tu=6;break a;default:throw Error(i(462))}}Hu();break}catch(t){Pu(e,t)}while(1);return Ji=qi=null,N.H=r,N.A=a,Gl=n,ql===null?(Kl=null,Jl=0,ei(),tu):0}function Hu(){for(;ql!==null&&!Se();)Uu(ql)}function Uu(e){var t=Ic(e.alternate,e,eu);e.memoizedProps=e.pendingProps,t===null?Ku(e):ql=t}function Wu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=bc(n,t,t.pendingProps,t.type,void 0,Jl);break;case 11:t=bc(n,t,t.pendingProps,t.type.render,t.ref,Jl);break;case 5:No(t);default:Gc(n,t),t=ql=di(t,eu),t=Ic(n,t,eu)}e.memoizedProps=e.pendingProps,t===null?Ku(e):ql=t}function Gu(e,t,n,r){Ji=qi=null,No(t),Na=null,Pa=0;var i=t.return;try{if(oc(e,i,t,n,Jl)){tu=1,tc(e,vi(n,e.current)),ql=null;return}}catch(t){if(i!==null)throw ql=i,t;tu=1,tc(e,vi(n,e.current)),ql=null;return}t.flags&32768?(Fi||r===1?e=!0:Ql||Jl&536870912?e=!1:(Zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=io.current,r!==null&&r.tag===13&&(r.flags|=16384))),qu(t,e)):Ku(t)}function Ku(e){var t=e;do{if(t.flags&32768){qu(t,Zl);return}e=t.return;var n=Uc(t.alternate,t,eu);if(n!==null){ql=n;return}if(t=t.sibling,t!==null){ql=t;return}ql=t=e}while(t!==null);tu===0&&(tu=5)}function qu(e,t){do{var n=Wc(e.alternate,e);if(n!==null){n.flags&=32767,ql=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ql=e;return}ql=e=n}while(e!==null);tu=6,ql=null}function Ju(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do $u();while(hu!==0);if(Gl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=$r,$e(e,n,o,s,c,l),e===Kl&&(ql=Kl=null,Jl=0),_u=t,gu=e,vu=n,yu=o,bu=a,xu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,cd(Oe,function(){return ed(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Gl,Gl|=4;try{ul(e,t,n)}finally{Gl=s,P.p=a,N.T=r}}hu=1,Yu(),Xu(),Zu()}}function Yu(){if(hu===1){hu=0;var e=gu,t=_u,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Gl;Gl|=4;try{Cl(t,e);var a=Zd,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Er(s.ownerDocument.documentElement,s)){if(c!==null&&Or(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Tr(s,h),v=Tr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}yp=!!Xd,Zd=Xd=null}finally{Gl=i,P.p=r,N.T=n}}e.current=t,hu=2}}function Xu(){if(hu===2){hu=0;var e=gu,t=_u,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Gl;Gl|=4;try{dl(e,t.alternate,t)}finally{Gl=i,P.p=r,N.T=n}}hu=3}}function Zu(){if(hu===4||hu===3){hu=0,Ce();var e=gu,t=_u,n=vu,r=xu;t.subtreeFlags&10256||t.flags&10256?hu=5:(hu=0,_u=gu=null,Qu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(mu=null),it(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}vu&3&&$u(),hd(e),i=e.pendingLanes,n&261930&&i&42?e===Cu?Su++:(Su=0,Cu=e):Su=0,gd(0,!1)}}function Qu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ua(t)))}function $u(){return Yu(),Xu(),Zu(),ed()}function ed(){if(hu!==5)return!1;var e=gu,t=yu;yu=0;var n=it(vu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=bu,bu=null;var o=gu,s=vu;if(hu=0,_u=gu=null,vu=0,Gl&6)throw Error(i(331));var c=Gl;if(Gl|=4,Bl(o.current),Ml(o,o.current,s,n),Gl=c,gd(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{P.p=a,N.T=r,Qu(e,t)}}function td(e,t,n){t=vi(n,t),t=rc(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&(Qe(e,2),hd(e))}function nd(e,t,n){if(e.tag===3)td(e,e,n);else for(;t!==null;){if(t.tag===3){td(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(mu===null||!mu.has(r))){e=vi(n,e),n=ic(2),r=Ga(t,n,2),r!==null&&(ac(n,r,t,e),Qe(r,2),hd(r));break}}t=t.return}}function rd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Wl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||($l=!0,i.add(n),e=id.bind(null,e,t,n),t.then(e,e))}function id(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Kl===e&&(Jl&n)===n&&(tu===4||tu===3&&(Jl&62914560)===Jl&&300>we()-uu?!(Gl&2)&&Nu(e,0):iu|=n,ou===Jl&&(ou=0)),hd(e)}function ad(e,t){t===0&&(t=Xe()),e=ri(e,t),e!==null&&(Qe(e,t),hd(e))}function od(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ad(e,n)}function sd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),ad(e,n)}function cd(e,t){return be(e,t)}var ld=null,ud=null,dd=!1,fd=!1,pd=!1,md=0;function hd(e){e!==ud&&e.next===null&&(ud===null?ld=ud=e:ud=ud.next=e),fd=!0,dd||(dd=!0,Sd())}function gd(e,t){if(!pd&&fd){pd=!0;do for(var n=!1,r=ld;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,xd(r,a))}else a=Jl,a=qe(r,r===Kl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,xd(r,a));r=r.next}while(n);pd=!1}}function _d(){vd()}function vd(){fd=dd=!1;var e=0;md!==0&&rf()&&(e=md);for(var t=we(),n=null,r=ld;r!==null;){var i=r.next,a=yd(r,t);a===0?(r.next=null,n===null?ld=i:n.next=i,i===null&&(ud=n)):(n=r,(e!==0||a&3)&&(fd=!0)),r=i}hu!==0&&hu!==5||gd(e,!1),md!==0&&(md=0)}function yd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Kl,n=Jl,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),it(n)){case 2:case 8:n=De;break;case 32:n=Oe;break;case 268435456:n=Ae;break;default:n=Oe}return r=bd.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(r),e.callbackPriority=2,e.callbackNode=null,2}function bd(e,t){if(hu!==0&&hu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($u()&&e.callbackNode!==n)return null;var r=Jl;return r=qe(e,e===Kl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Du(e,r,t),yd(e,we()),e.callbackNode!=null&&e.callbackNode===n?bd.bind(null,e):null)}function xd(e,t){if($u())return null;Du(e,t,!0)}function Sd(){cf(function(){Gl&6?be(Ee,_d):vd()})}function Cd(){if(md===0){var e=pa;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),md=e}return md}function wd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function Td(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ed(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=wd((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?wd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(md!==0){var e=o?Td(i,o):new FormData(i);ks(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Td(i,o):new FormData(i),ks(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Dd=0;Dd<Jr.length;Dd++){var Od=Jr[Dd];Yr(Od.toLowerCase(),`on`+(Od[0].toUpperCase()+Od.slice(1)))}Yr(Br,`onAnimationEnd`),Yr(Vr,`onAnimationIteration`),Yr(Hr,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Ur,`onTransitionRun`),Yr(Wr,`onTransitionStart`),Yr(Gr,`onTransitionCancel`),Yr(Kr,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var kd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Ad=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(kd));function jd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Xr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Xr(e)}i.currentTarget=null,a=c}}}}function B(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(Fd(t,e,2,!1),n.add(r))}function Md(e,t,n){var r=0;t&&(r|=4),Fd(n,e,r,t)}var Nd=`_reactListening`+Math.random().toString(36).slice(2);function Pd(e){if(!e[Nd]){e[Nd]=!0,St.forEach(function(t){t!==`selectionchange`&&(Ad.has(t)||Md(t,!1,e),Md(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nd]||(t[Nd]=!0,Md(`selectionchange`,!1,t))}}function Fd(e,t,n,r){switch(Ep(t)){case 2:var i=bp;break;case 8:i=xp;break;default:i=Sp}n=i.bind(null,t,n,e),i=void 0,!un||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Id(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=_t(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}sn(function(){var r=a,i=tn(n),s=[];a:{var c=qr.get(e);if(c!==void 0){var l=xn,u=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:l=zn;break;case`focusin`:u=`focus`,l=An;break;case`focusout`:u=`blur`,l=An;break;case`beforeblur`:case`afterblur`:l=An;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=On;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Vn;break;case Br:case Vr:case Hr:l=jn;break;case Kr:l=Hn;break;case`scroll`:case`scrollend`:l=Cn;break;case`wheel`:l=Un;break;case`copy`:case`cut`:case`paste`:l=Mn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Bn;break;case`toggle`:case`beforetoggle`:l=Wn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=cn(m,p),g!=null&&d.push(Ld(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==en&&(u=n.relatedTarget||n.fromElement)&&(_t(u)||u[ut]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?_t(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=On,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:yt(l),h=u==null?c:yt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,_t(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=zd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Bd(s,c,l,d,!1),u!==null&&f!==null&&Bd(s,f,u,d,!0)}}a:{if(c=r?yt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ur;else if(ir(c))if(dr)v=br;else{v=vr;var y=_r}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Yt(r.elementType)&&(v=ur):v=yr;if(v&&=v(e,r)){ar(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ut(c,`number`,c.value)}switch(y=r?yt(r):window,e){case`focusin`:(ir(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(s,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:Pr(s,n,i)}var b;if(Kn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else er?Qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Yn&&n.locale!==`ko`&&(er||x!==`onCompositionStart`?x===`onCompositionEnd`&&er&&(b=hn()):(fn=i,pn=`value`in fn?fn.value:fn.textContent,er=!0)),y=Rd(r,x),0<y.length&&(x=new Nn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=$n(n),b!==null&&(x.data=b)))),(b=Jn?tr(e,n):nr(e,n))&&(x=Rd(r,`onBeforeInput`),0<x.length&&(y=new Nn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Ed(s,e,r,n,i)}jd(s,t)})}function Ld(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Rd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=cn(e,n),i!=null&&r.unshift(Ld(e,i,a)),i=cn(e,t),i!=null&&r.push(Ld(e,i,a))),e.tag===3)return r;e=e.return}return[]}function zd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Bd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=cn(n,a),l!=null&&o.unshift(Ld(n,l,c))):i||(l=cn(n,a),l!=null&&o.push(Ld(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Vd=/\r\n?/g,Hd=/\u0000|\uFFFD/g;function Ud(e){return(typeof e==`string`?e:``+e).replace(Vd,`
|
|
10
|
+
`).replace(Hd,``)}function Wd(e,t){return t=Ud(t),Ud(e)===t}function Gd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Jt(e,r,o);break;case`data`:if(t!==`object`){jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Gd(e,t,`name`,a.name,a,null),Gd(e,t,`formEncType`,a.formEncType,a,null),Gd(e,t,`formMethod`,a.formMethod,a,null),Gd(e,t,`formTarget`,a.formTarget,a,null)):(Gd(e,t,`encType`,a.encType,a,null),Gd(e,t,`method`,a.method,a,null),Gd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`onScroll`:r!=null&&B(`scroll`,e);break;case`onScrollEnd`:r!=null&&B(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:B(`beforetoggle`,e),B(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Xt.get(n)||n,At(e,n,r))}}function Kd(e,t,n,r,a,o){switch(n){case`style`:Jt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&B(`scroll`,e);break;case`onScrollEnd`:r!=null&&B(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[lt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function qd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:B(`error`,e),B(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Gd(e,t,o,s,n,null)}}a&&Gd(e,t,`srcSet`,n.srcSet,n,null),r&&Gd(e,t,`src`,n.src,n,null);return;case`input`:B(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Gd(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1);return;case`select`:for(a in B(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Gd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in B(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Gd(e,t,s,c,n,null)}Kt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Gd(e,t,l,r,n,null)}return;case`dialog`:B(`beforetoggle`,e),B(`toggle`,e),B(`cancel`,e),B(`close`,e);break;case`iframe`:case`object`:B(`load`,e);break;case`video`:case`audio`:for(r=0;r<kd.length;r++)B(kd[r],e);break;case`image`:B(`error`,e),B(`load`,e);break;case`details`:B(`toggle`,e);break;case`embed`:case`source`:case`link`:B(`error`,e),B(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Gd(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Kd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Gd(e,t,c,r,n,null))}function Jd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Gd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Gd(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Gd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Gd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Gd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Gd(e,t,s,a,r,o)}Gt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Gd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Gd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Gd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Gd(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Kd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Kd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Gd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Gd(e,t,f,p,r,m)}function Yd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function V(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Yd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Yd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Xd=null,Zd=null;function Qd(e){return e.nodeType===9?e:e.ownerDocument}function $d(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function ef(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function tf(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nf=null;function rf(){var e=window.event;return e&&e.type===`popstate`?e===nf?!1:(nf=e,!0):(nf=null,!1)}var af=typeof setTimeout==`function`?setTimeout:void 0,of=typeof clearTimeout==`function`?clearTimeout:void 0,sf=typeof Promise==`function`?Promise:void 0,cf=typeof queueMicrotask==`function`?queueMicrotask:sf===void 0?af:function(e){return sf.resolve(null).then(e).catch(lf)};function lf(e){setTimeout(function(){throw e})}function uf(e){return e===`head`}function df(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Gp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tf(e.ownerDocument.body);n=i}while(n);Gp(t)}function ff(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function pf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:pf(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ht])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=bf(e.nextSibling),e===null)break}return null}function hf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bf(e.nextSibling),e===null))return null;return e}function gf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bf(e.nextSibling),e===null))return null;return e}function _f(e){return e.data===`$?`||e.data===`$~`}function vf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function yf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function bf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var xf=null;function Sf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function wf(e,t,n){switch(t=Qd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Tf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var Ef=new Map,Df=new Set;function Of(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var kf=P.d;P.d={f:Af,r:jf,D:Pf,C:Ff,L:If,m:Lf,X:zf,S:Rf,M:Bf};function Af(){var e=kf.f(),t=ju();return e||t}function jf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?js(t):kf.r(e)}var Mf=typeof document>`u`?null:document;function Nf(e,t,n){var r=Mf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Df.has(i)||(Df.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),qd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Pf(e){kf.D(e),Nf(`dns-prefetch`,e,null)}function Ff(e,t){kf.C(e,t),Nf(`preconnect`,e,t)}function If(e,t,n){kf.L(e,t,n);var r=Mf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=Hf(e);break;case`script`:a=Kf(e)}Ef.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Ef.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Uf(a))||t===`script`&&r.querySelector(qf(a))||(t=r.createElement(`link`),qd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Lf(e,t){kf.m(e,t);var n=Mf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Kf(e)}if(!Ef.has(a)&&(e=f({rel:`modulepreload`,href:e},t),Ef.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qf(a)))return}r=n.createElement(`link`),qd(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Rf(e,t,n){kf.S(e,t,n);var r=Mf;if(r&&e){var i=bt(r).hoistableStyles,a=Hf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Uf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Ef.get(a))&&Xf(e,n);var c=o=r.createElement(`link`);xt(c),qd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Yf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zf(e,t){kf.X(e,t);var n=Mf;if(n&&e){var r=bt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=f({src:e,async:!0},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),xt(a),qd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t){kf.M(e,t);var n=Mf;if(n&&e){var r=bt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),xt(a),qd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t,n,r){var a=(a=oe.current)?Of(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Hf(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hf(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Uf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Ef.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ef.set(e,n),o||Gf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Kf(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hf(e){return`href="`+Bt(e)+`"`}function Uf(e){return`link[rel="stylesheet"][`+e+`]`}function Wf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Gf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),qd(t,`link`,n),xt(t),e.head.appendChild(t))}function Kf(e){return`[src="`+Bt(e)+`"]`}function qf(e){return`script[async]`+e}function Jf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),qd(r,`style`,a),Yf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hf(n.href);var o=e.querySelector(Uf(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Wf(n),(a=Ef.get(a))&&Xf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),qd(o,`link`,r),t.state.loading|=4,Yf(o,n.precedence,e),t.instance=o;case`script`:return o=Kf(n.src),(a=e.querySelector(qf(o)))?(t.instance=a,xt(a),a):(r=n,(a=Ef.get(o))&&(r=f({},n),Zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),qd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Yf(r,n.precedence,e));return t.instance}function Yf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qf=null;function $f(e,t,n){if(Qf===null){var r=new Map,i=Qf=new Map;i.set(n,r)}else i=Qf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ht]||a[ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function ep(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function tp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function np(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hf(r.href),a=t.querySelector(Uf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=op.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Wf(r),(i=Ef.get(i))&&Xf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),qd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=op.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ip=0;function ap(e,t){return e.stylesheets&&e.count===0&&cp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ip===0&&(ip=62500*V());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ip?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sp=null;function cp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sp=new Map,t.forEach(lp,e),sp=null,op.call(e))}function lp(e,t){if(!(t.state.loading&4)){var n=sp.get(e);if(n)var r=n.get(null);else{n=new Map,sp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=op.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var up={$$typeof:b,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function dp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function fp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new dp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=la(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ha(a),e}function pp(e){return e?(e=oi,e):oi}function mp(e,t,n,r,i,a){i=pp(i),r.context===null?r.context=i:r.pendingContext=i,r=Wa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ga(e,r,t),n!==null&&(Eu(n,e,t),Ka(n,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gp(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function _p(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&Eu(t,e,67108864),gp(e,67108864)}}function vp(e){if(e.tag===13||e.tag===31){var t=wu();t=rt(t);var n=ri(e,t);n!==null&&Eu(n,e,t),gp(e,t)}}var yp=!0;function bp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,Sp(e,t,n,r)}finally{P.p=a,N.T=i}}function xp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,Sp(e,t,n,r)}finally{P.p=a,N.T=i}}function Sp(e,t,n,r){if(yp){var i=Cp(r);if(i===null)Id(e,t,r,wp,n),Fp(e,r);else if(Lp(i,e,t,n,r))r.stopPropagation();else if(Fp(e,r),t&4&&-1<Pp.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ze(o);s.entanglements[1]|=c,o&=~c}hd(a),!(Gl&6)&&(fu=we()+500,gd(0,!1))}}break;case 31:case 13:s=ri(a,2),s!==null&&Eu(s,a,2),ju(),gp(a,2)}if(a=Cp(r),a===null&&Id(e,t,r,wp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Id(e,t,r,null,n)}}function Cp(e){return e=tn(e),Tp(e)}var wp=null;function Tp(e){if(wp=null,e=_t(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return wp=e,null}function Ep(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Te()){case Ee:return 2;case De:return 8;case Oe:case ke:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var Dp=!1,Op=null,kp=null,Ap=null,jp=new Map,Mp=new Map,Np=[],Pp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Fp(e,t){switch(e){case`focusin`:case`focusout`:Op=null;break;case`dragenter`:case`dragleave`:kp=null;break;case`mouseover`:case`mouseout`:Ap=null;break;case`pointerover`:case`pointerout`:jp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mp.delete(t.pointerId)}}function Ip(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=vt(t),t!==null&&_p(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lp(e,t,n,r,i){switch(t){case`focusin`:return Op=Ip(Op,e,t,n,r,i),!0;case`dragenter`:return kp=Ip(kp,e,t,n,r,i),!0;case`mouseover`:return Ap=Ip(Ap,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jp.set(a,Ip(jp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mp.set(a,Ip(Mp.get(a)||null,e,t,n,r,i)),!0}return!1}function Rp(e){var t=_t(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ot(e.priority,function(){vp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){vp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);en=r,n.target.dispatchEvent(r),en=null}else return t=vt(n),t!==null&&_p(t),e.blockedOn=n,!1;t.shift()}return!0}function Bp(e,t,n){zp(e)&&n.delete(t)}function Vp(){Dp=!1,Op!==null&&zp(Op)&&(Op=null),kp!==null&&zp(kp)&&(kp=null),Ap!==null&&zp(Ap)&&(Ap=null),jp.forEach(Bp),Mp.forEach(Bp)}function Hp(e,n){e.blockedOn===n&&(e.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vp)))}var Up=null;function Wp(e){Up!==e&&(Up=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Up===e&&(Up=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Tp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gp(e){function t(t){return Hp(t,e)}Op!==null&&Hp(Op,e),kp!==null&&Hp(kp,e),Ap!==null&&Hp(Ap,e),jp.forEach(t),Mp.forEach(t);for(var n=0;n<Np.length;n++){var r=Np[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Np.length&&(n=Np[0],n.blockedOn===null);)Rp(n),n.blockedOn===null&&Np.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[lt]||null;if(typeof a==`function`)o||Wp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(Tp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wp(n)}}}function Kp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function qp(e){this._internalRoot=e}Jp.prototype.render=qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;mp(n,wu(),e,t,null,null)},Jp.prototype.unmount=qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),ju(),t[ut]=null}};function Jp(e){this._internalRoot=e}Jp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Np.length&&t!==0&&t<Np[n].priority;n++);Np.splice(n,0,e),n===0&&Rp(e)}};var Yp=n.version;if(Yp!==`19.2.5`)throw Error(i(527,Yp,`19.2.5`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Xp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zp.isDisabled&&Zp.supportsFiber)try{Ie=Zp.inject(Xp),Le=Zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Qs,s=$s,c=ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=fp(e,1,!1,null,null,n,r,null,o,s,c,Kp),e[ut]=t.current,Pd(e),new qp(t)}})),Le=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ie()})),Re=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ze=new class extends Re{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Be={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ve=new class{#e=Be;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function He(e){setTimeout(e,0)}var Ue=typeof window>`u`||`Deno`in globalThis;function We(){}function Ge(e,t){return typeof e==`function`?e(t):e}function Ke(e){return typeof e==`number`&&e>=0&&e!==1/0}function qe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Je(e,t){return typeof e==`function`?e(t):e}function Ye(e,t){return typeof e==`function`?e(t):e}function Xe(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Qe(o,t.options))return!1}else if(!et(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ze(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if($e(t.options.mutationKey)!==$e(a))return!1}else if(!et(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Qe(e,t){return(t?.queryKeyHashFn||$e)(e)}function $e(e){return JSON.stringify(e,(e,t)=>at(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function et(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>et(e[n],t[n])):!1}var tt=Object.prototype.hasOwnProperty;function nt(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=it(e)&&it(t);if(!r&&!(at(e)&&at(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:tt.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=nt(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function rt(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function it(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function at(e){if(!ot(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ot(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ot(e){return Object.prototype.toString.call(e)===`[object Object]`}function st(e){return new Promise(t=>{Ve.setTimeout(t,e)})}function ct(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:nt(e,t)}function lt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ut(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var dt=Symbol();function ft(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===dt?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function pt(e,t){return typeof e==`function`?e(...t):!!e}function mt(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ht=(()=>{let e=()=>Ue;return{isServer(){return e()},setIsServer(t){e=t}}})();function gt(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var _t=He;function vt(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=_t,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var yt=vt(),bt=new class extends Re{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function xt(e){return Math.min(1e3*2**e,3e4)}function St(e){return(e??`online`)===`online`?bt.isOnline():!0}var Ct=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function wt(e){let t=!1,n=0,r,i=gt(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Ct(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>ze.isFocused()&&(e.networkMode===`always`||bt.isOnline())&&e.canRun(),u=()=>St(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(ht.isServer()?0:3),o=e.retryDelay??xt,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),st(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Tt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ke(this.gcTime)&&(this.#e=Ve.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ht.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Ve.clearTimeout(this.#e),this.#e=void 0)}};function Et(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{mt(e,()=>t.signal,()=>n=!0)},u=ft(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?ut:lt;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ot:Dt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Dt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Dt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ot(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var kt=class extends Tt{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Mt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Mt(this.options);e.data!==void 0&&(this.setState(jt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ct(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(We).catch(We):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ye(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dt||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Je(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!qe(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ft(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Et(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=wt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ct&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ct){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...At(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...jt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),yt.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function At(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:St(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function jt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Mt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Nt=class extends Re{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=gt(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ft(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return It(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return It(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Ye(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!rt(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Lt(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Ye(this.options.enabled,this.#t)!==Ye(t.enabled,this.#t)||Je(this.options.staleTime,this.#t)!==Je(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Ye(this.options.enabled,this.#t)!==Ye(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return zt(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(We)),t}#g(){this.#b();let e=Je(this.options.staleTime,this.#t);if(ht.isServer()||this.#r.isStale||!Ke(e))return;let t=qe(this.#r.dataUpdatedAt,e)+1;this.#d=Ve.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(ht.isServer()||Ye(this.options.enabled,this.#t)===!1||!Ke(this.#p)||this.#p===0)&&(this.#f=Ve.setInterval(()=>{(this.options.refetchIntervalInBackground||ze.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(Ve.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Ve.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ft(e,t),o=i&&Lt(e,n,t,r);(a||o)&&(l={...l,...At(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=ct(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=ct(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Rt(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Ye(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=gt())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!rt(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){yt.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Pt(e,t){return Ye(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&Ye(t.retryOnMount,e)===!1)}function Ft(e,t){return Pt(e,t)||e.state.data!==void 0&&It(e,t,t.refetchOnMount)}function It(e,t,n){if(Ye(t.enabled,e)!==!1&&Je(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Rt(e,t)}return!1}function Lt(e,t,n,r){return(e!==t||Ye(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Rt(e,n)}function Rt(e,t){return Ye(t.enabled,e)!==!1&&e.isStaleByTime(Je(t.staleTime,e))}function zt(e,t){return!rt(e.getCurrentResult(),t)}var Bt=class extends Tt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Vt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=wt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),yt.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Vt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ht=class extends Re{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Bt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ut(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ut(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ut(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Ut(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){yt.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ze(t,e))}findAll(e={}){return this.getAll().filter(t=>Ze(e,t))}notify(e){yt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return yt.batch(()=>Promise.all(e.map(e=>e.continue().catch(We))))}};function Ut(e){return e.options.scope?.id}var Wt=class extends Re{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Qe(r,t),a=this.get(i);return a||(a=new kt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){yt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Xe(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Xe(e,t)):t}notify(e){yt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){yt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Gt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Wt,this.#t=e.mutationCache||new Ht,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ze.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=bt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Je(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ge(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return yt.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;yt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return yt.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=yt.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(We).catch(We)}invalidateQueries(e,t={}){return yt.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=yt.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(We)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(We)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Je(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(We).catch(We)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(We).catch(We)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return bt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set($e(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{et(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set($e(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{et(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Qe(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===dt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Kt=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),qt=n(((e,t)=>{t.exports=Kt()})),L=t(je(),1),R=qt(),Jt=L.createContext(void 0),Yt=e=>{let t=L.useContext(Jt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Xt=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(Jt.Provider,{value:e,children:t})),Zt=L.createContext(!1),Qt=()=>L.useContext(Zt);Zt.Provider;function $t(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var en=L.createContext($t()),tn=()=>L.useContext(en),nn=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?pt(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},rn=e=>{L.useEffect(()=>{e.clearReset()},[e])},an=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||pt(n,[e.error,r])),on=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},sn=(e,t)=>e.isLoading&&e.isFetching&&!t,cn=(e,t)=>e?.suspense&&t.isPending,ln=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function un(e,t,n){let r=Qt(),i=tn(),a=Yt(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,on(o),nn(o,i,s),rn(i);let c=!a.getQueryCache().get(o.queryHash),[l]=L.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(L.useSyncExternalStore(L.useCallback(e=>{let t=d?l.subscribe(yt.batchCalls(e)):We;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),L.useEffect(()=>{l.setOptions(o)},[o,l]),cn(o,u))throw ln(o,l,i);if(an({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!ht.isServer()&&sn(u,r)&&(c?ln(o,l,i):s?.promise)?.catch(We).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function dn(e,t){return un(e,Nt,t)}var fn=typeof window<`u`?L.useLayoutEffect:L.useEffect;function pn(e){let t=L.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function mn(e,t,n={},r={}){L.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function hn(e){let t=L.useRef(null);return L.useImperativeHandle(e,()=>t.current,[]),t}function gn(e){return e[e.length-1]}function _n(e){return typeof e==`function`}function vn(e,t){return _n(e)?e(t):e}var yn=Object.prototype.hasOwnProperty,bn=Object.prototype.propertyIsEnumerable;function xn(e){for(let t in e)if(yn.call(e,t))return!0;return!1}var Sn=()=>Object.create(null),Cn=(e,t)=>wn(e,t,Sn);function wn(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=On(e)&&On(i);if(!a&&!(En(e)&&En(i)))return i;let o=a?e:Tn(e);if(!o)return i;let s=a?i:Tn(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:yn.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=wn(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function Tn(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!bn.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!bn.call(e,t))return!1;r.push(t)}return r}function En(e){if(!Dn(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Dn(n)||!n.hasOwnProperty(`isPrototypeOf`))}function Dn(e){return Object.prototype.toString.call(e)===`[object Object]`}function On(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function kn(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!kn(e[r],t[r],n))return!1;return!0}if(En(e)&&En(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!kn(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!kn(e[o],t[o],n)))return!1;return i===a}return!1}function An(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function jn(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Mn(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function Nn(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Mn(t)}var Pn=[`http:`,`https:`,`mailto:`,`tel:`];function Fn(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function In(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Nn(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Nn(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Ln(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Rn(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function zn(){throw Error(`Invariant failed`)}function Bn(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Vn=4,Hn=5;function Un(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Wn(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=Un(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Gn(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=Wn(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=Jn(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=Jn(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Yn(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Yn(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Yn(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Jn(n.fullPath??n.from);e.kind=Hn,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=Jn(n.fullPath??n.from);e.kind=Vn,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Gn(e,t,r,s,i,a,o)}function Kn(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function qn(e){if(e.pathless)for(let t of e.pathless)qn(t);if(e.static)for(let t of e.static.values())qn(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())qn(t);if(e.dynamic?.length){e.dynamic.sort(Kn);for(let t of e.dynamic)qn(t)}if(e.optional?.length){e.optional.sort(Kn);for(let t of e.optional)qn(t)}if(e.wildcard?.length){e.wildcard.sort(Kn);for(let t of e.wildcard)qn(t)}}function Jn(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null}}function Yn(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,caseSensitive:n,prefix:r,suffix:i}}function Xn(e,t){let n=Jn(`/`),r=new Uint16Array(6);for(let t of e)Gn(!1,r,t,1,n,0);qn(n),t.masksTree=n,t.flatCache=Bn(1e3)}function Zn(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=nr(e,t.masksTree);return t.flatCache.set(e,r),r}function Qn(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Jn(`/`),Gn(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),nr(r,o,n)}function $n(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=nr(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ir(a.route)),t.matchCache.set(r,a),a}function er(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function tr(e,t=!1,n){let r=Jn(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Gn(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&zn(),a[e.id]=e,s!==0&&e.path){let t=er(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),qn(r),{processedTree:{segmentTree:r,singleCache:Bn(1e3),matchCache:Bn(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function nr(e,t,n=!1){let r=e.split(`/`),i=or(e,r,t,n);if(!i)return null;let[a]=rr(e,r,i);return{route:i.node.route,rawParams:a}}function rr(e,t,n){let r=ar(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Vn)break;if(u.kind===Hn){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function ir(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ar(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function or(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!gn(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!ur(l,n))continue;if(i.parse){if(!lr(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==Vn&&ur(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===Vn||i.kind===2)&&ur(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(lr(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&cr(p,o))return n;ur(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+sr(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+sr(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+sr(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+sr(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function sr(e,t){return 2**(e-t-1)}function cr(e,t){return e===2**(t-1)-1}function lr(e,t,n){let r,i;try{[r,i]=rr(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function ur(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Vn)>(e.node.kind===Vn)||t.node.kind===Vn==(e.node.kind===Vn)&&t.depth>e.depth))):!0}function dr(e){return fr(e.filter(e=>e!==void 0).join(`/`))}function fr(e){return e.replace(/\/{2,}/g,`/`)}function pr(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function mr(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function hr(e){return mr(pr(e))}function gr(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function _r(e,t,n){return gr(e,n)===gr(t,n)}function vr({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&gn(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(gn(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=fr(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function yr(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function br(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Sr(e,n)).join(`/`):Sr(r,n):r}function xr({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Wn(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=br(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=br(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=br(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Sr(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Cr(e){return e?.isNotFound===!0}function wr(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var Tr=`tsr-scroll-restoration-v1_3`;function Er(){let e=wr();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);En(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=vn(e,t)||t},persist:()=>{try{e.setItem(Tr,JSON.stringify(t))}catch{}}}}var Dr=Er(),Or=e=>e.state.__TSR_key||e.href;function kr(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var Ar=!1,jr=`window`,Mr=`data-scroll-restoration-id`;function Nr(e,t){if(!Dr)return;let n=Dr;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,Ar=!1;let r=e.options.getScrollRestorationKey||Or,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(Ar||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(jr,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===jr)n=jr;else if(e.isConnected){let t=e.getAttribute(Mr);n=t?`[${Mr}="${t}"]`:kr(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){Ar=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!En(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===jr)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===jr)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{Ar=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function Pr(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Fr(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ir(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Fr(r):Array.isArray(t)?t.push(Fr(r)):n[e]=[t,Fr(r)]}return n}var Lr=zr(JSON.parse),Rr=Br(JSON.stringify,JSON.parse);function zr(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ir(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Br(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Pr(e,r);return t?`?${t}`:``}}var Vr=`__root__`;function Hr(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Ur(e){return e instanceof Response&&!!e.options}function Wr(e){return{input:({url:t})=>{for(let n of e)t=Kr(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=qr(e[n],t);return t}}}function Gr(e){let t=hr(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=dr([`/`,t,e.pathname]),e)}}function Kr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function qr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Jr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Yr(o,_.get())),x=r(()=>Yr(s,v.get())),S=r(()=>Yr(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=Bn(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:j,setCached:M};A(e.matches),a?.(k);function A(e){Xr(e,o,_,n,i)}function j(e){Xr(e,s,v,n,i)}function M(e){Xr(e,c,y,n,i)}return k}function Yr(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Xr(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}Rn(n.get(),a)||n.set(a)})}var Zr=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Qr=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),$r=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),ei=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},ti=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},ni=(e,t,n)=>{if(!(!Ur(n)&&!Cr(n)))throw Ur(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Ur(n)?`redirected`:Cr(n)?`notFound`:r.status===`pending`?`success`:r.status,context:ei(e,t.index),isFetching:!1,error:n})),Cr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Ur(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},ri=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},ii=(e,t,n)=>{let r=ei(e,n);e.updateMatch(t,e=>({...e,context:r}))},ai=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,ni(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,ni(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Ur(n)&&!Cr(n)&&(e.serialError??=n)},oi=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!$r(e,t)&&(n.options.loader||n.options.beforeLoad||_i(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Zr(e)},i);r._nonReactive.pendingTimeout=t}},si=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;oi(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&ni(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},ci=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=An(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&ai(e,n,o,`PARSE_PARAMS`),s&&ai(e,n,s,`VALIDATE_SEARCH`),oi(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=An();let f={...ei(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=$r(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Ur(r)||Cr(r))&&(u(),ai(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),jn(y))return u(),y.catch(t=>{ai(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),ai(e,n,t,`BEFORE_LOAD`)}v(y)},li=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>ci(e,n,t,i),s=()=>{if(ri(e,n))return;let t=si(e,n,i);return jn(t)?t.then(o):o()};return a()},ui=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},di=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=ei(e,r),d=$r(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},fi=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{gi(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(di(e,t,n,r,i)),l=!!s&&jn(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;ni(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:ei(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:ei(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,Cr(t)&&await i.options.notFoundComponent?.preload?.(),ni(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,ni(e,e.router.getMatch(n),t)}!Ur(o)&&!Cr(o)&&await gi(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:ei(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),ni(e,r,t)}},pi=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(di(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await fi(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){Ur(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await fi(e,t,i,n,d):ii(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(ri(e,i)){if(!e.router.getMatch(i))return e.matches[n];ii(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=$r(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&ni(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=An(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function mi(e){let t=e,n=[];Qr(t.router)&&Zr(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=li(t,e);jn(n)&&await n}catch(e){if(Ur(e))throw e;if(Cr(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?ti(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(pi(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(Ur(e))throw e;Cr(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=ti(t,l);e===void 0&&zn();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await gi(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await gi(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=ui(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Zr(t);if(jn(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function hi(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function gi(e,t=vi){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===vi?(()=>{if(e._componentsPromise===void 0){let t=hi(e,vi);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():hi(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function _i(e){for(let t of vi)if(e.options[t]?.preload)return!0;return!1}var vi=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],yi=`__TSR_index`,bi=`popstate`,xi=`beforeunload`;function Si(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Ei(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[yi];i=Ci(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[yi];i=Ci(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[yi]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ci(e,t){t||={};let n=Di();return{...t,key:n,__TSR_key:n,[yi]:e}}function wi(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Ei(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Di();t.history.replaceState({[yi]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Ei(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[yi]-l.state[yi],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Si({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(xi,S,{capture:!0}),t.removeEventListener(bi,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(xi,S,{capture:!0}),t.addEventListener(bi,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Ti(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Ei(e,t){let n=Ti(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Di();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[yi]:0,key:a,__TSR_key:a}}}function Di(){return(Math.random()+1).toString(36).substring(7)}function Oi(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var ki=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=yr(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=wi()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Bn(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Jr(Mi(this.latestLocation),e),Nr(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=hr(o);t&&t!==`/`&&e.push(Gr({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Wr(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=tr(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Xn(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:In(e).path,external:!1,searchStr:o,search:Cn(t?.search,i),hash:In(r.slice(1)).path,state:wn(t?.state,a)}}let o=new URL(i,this.origin),s=Kr(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:In(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:Cn(t?.search,c),hash:In(s.hash.slice(1)).path,state:wn(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>vr({base:e,to:t.includes(`//`)?fr(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Pi({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,vn(t.params,s)),d=this.routesByPath[mr(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&xn(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:In(xr({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Ni(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=Fi({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=Cn(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?vn(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?vn(t.state,n.state):{};v=wn(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=qr(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=Ln(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=Zn(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,vn(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=kn(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=mr(this.latestLocation.href)===mr(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=An(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Ei(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Kr(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(Fn(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.get()??this.stores.location.get();for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=Oi(t,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...n}),this.emit({type:`onBeforeLoad`,...n}),await mi({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatches.get(),location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){Ur(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):Cr(e)&&(n=e);let r=t?t.status:n?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(r),this.stores.redirect.set(t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Oi(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&Fn(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=gi,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await mi({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(Ur(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});Cr(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Qn(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!kn(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?kn(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Rr,parseSearch:e.parseSearch??Lr,protocolAllowlist:e.protocolAllowlist??Pn}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=ir(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:mr(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Li(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Ni(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof Ai||(r=new Ai(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=xr({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,x;if(!v)try{Ri(r,b)}catch(e){if(x=Cr(e)||Ur(e)?e:new ji(e.message,{cause:e}),t?.throwOnError)throw x}Object.assign(i,b);let S=y?`stay`:`enter`,C;if(v)C={...v,cause:S,params:y?.params??i,_strictParams:b,search:Cn(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||_i(r)?`pending`:`success`;C={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?Cn(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:An()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?wn(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(C.globalNotFound=s===r.id),C.searchError=f;let w=this.getParentContext(o);C.context={...w,...C.__routeContext,...C.__beforeLoadContext},c[n]=C}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?Cn(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=gn(t),i={...e.search};for(let e of t)try{Object.assign(i,Ni(e.options.validateSearch,i))}catch{}let a=gn(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{Ri(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},Ai=class extends Error{},ji=class extends Error{};function Mi(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Ni(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Ai(`Async validation not supported`);if(n.issues)throw new Ai(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Pi({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=mr(e),a,o=$n(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Fi({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Ii(n)(e,t,r??!1)}function Ii(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Ni(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:vn(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Li(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Vr}function Ri(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var zi=`Error preloading route! ☝️`,Bi=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Vr:this.parentRoute||zn();let r=n?Vr:t?.path;r&&r!==`/`&&(r=pr(r));let i=t?.id||r,a=n?Vr:dr([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=dr([`/`,a]));let o=a===`__root__`?`/`:dr([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=mr(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Hr({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Vi=class extends Bi{constructor(e){super(e)}};function Hi(e){if(typeof document<`u`&&document.querySelector){let t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==``){let e=document.getElementById(t.hash);e&&e.scrollIntoView(n)}}}function Ui(e){let t=e.errorComponent??Gi;return(0,R.jsx)(Wi,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?L.createElement(t,{error:n,reset:r}):e.children})}var Wi=class extends L.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Gi({error:e}){let[t,n]=L.useState(!1);return(0,R.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,R.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,R.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,R.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,R.jsx)(`div`,{children:(0,R.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,R.jsx)(`code`,{children:e.message}):null})}):null]})}function Ki({children:e,fallback:t=null}){return qi()?(0,R.jsx)(L.Fragment,{children:e}):(0,R.jsx)(L.Fragment,{children:t})}function qi(){return L.useSyncExternalStore(Ji,()=>!0,()=>!1)}function Ji(){return()=>{}}var Yi=L.createContext(null);function Xi(e){return L.useContext(Yi)}var Zi=L.createContext(void 0),Qi=L.createContext(void 0),$i=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))($i||{});function ea({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function ta(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var na=[],ra=0,{link:ia,unlink:aa,propagate:oa,checkDirty:sa,shallowPropagate:ca}=ea({update(e){return e._update()},notify(e){na[ua++]=e,e.flags&=~$i.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=$i.Mutable|$i.Dirty,ma(e))}}),la=0,ua=0,da,fa=0;function pa(e){try{++fa,e()}finally{--fa||ha()}}function ma(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=aa(n,e)}function ha(){if(!(fa>0)){for(;la<ua;){let e=na[la];na[la++]=void 0,e.notify()}la=0,ua=0}}function ga(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?$i.None:$i.Mutable,get(){return da!==void 0&&ia(i,da,ra),i._snapshot},subscribe(e){let t=ta(e),n={current:!1},r=_a(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=da,o=t?.compare??Object.is;if(n)da=i,++ra,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=$i.Mutable|$i.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{da=a,n&&(i.flags&=~$i.RecursedCheck),ma(i)}}};return n?(i.flags=$i.Mutable|$i.Dirty,i.get=function(){let e=i.flags;if(e&$i.Dirty||e&$i.Pending&&sa(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ca(e)}}else e&$i.Pending&&(i.flags=e&~$i.Pending);return da!==void 0&&ia(i,da,ra),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(oa(e),ca(e),ha())}},i}function _a(e){let t=()=>{let t=da;da=n,++ra,n.depsTail=void 0,n.flags=$i.Watching|$i.RecursedCheck;try{return e()}finally{da=t,n.flags&=~$i.RecursedCheck,ma(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:$i.Watching|$i.RecursedCheck,notify(){let e=this.flags;e&$i.Dirty||e&$i.Pending&&sa(this.deps,this)?t():this.flags=$i.Watching},stop(){this.flags=$i.None,this.depsTail=void 0,ma(this)}};return t(),n}var va=n((e=>{var t=je();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ya=n(((e,t)=>{t.exports=va()})),ba=n((e=>{var t=je(),n=ya();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),xa=n(((e,t)=>{t.exports=ba()}))();function Sa(e,t){return e===t}function Ca(e,t,n=Sa){let r=(0,L.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,L.useCallback)(()=>e?.get(),[e]);return(0,xa.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var wa={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function Ta(e){let t=Xi(),n=L.useContext(e.from?Qi:Zi),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=L.useRef(void 0);return Ca(i??wa,n=>{if((e.shouldThrow??!0)&&!n&&zn(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=wn(a.current,r);return a.current=e,e}return r})}function Ea(e){return Ta({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Da(e){let{select:t,...n}=e;return Ta({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Oa(e){return Ta({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function ka(e){return Ta({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Aa(e){let t=Xi();return L.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function ja(e){return Ta({...e,select:t=>e.select?e.select(t.context):t.context})}var Ma=t(Fe(),1);function Na(e,t){let n=Xi(),r=hn(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:k,hash:A,state:j,mask:M,reloadDocument:N,unsafeRelative:P,from:F,_fromLocation:ee,...te}=e,ne=qi(),re=L.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),I=Ca(n.stores.location,e=>e,(e,t)=>e.href===t.href),ie=L.useMemo(()=>{let e={_fromLocation:I,...re};return n.buildLocation(e)},[n,I,re]),ae=ie.maskedLocation?ie.maskedLocation.publicHref:ie.publicHref,oe=ie.maskedLocation?ie.maskedLocation.external:ie.external,se=L.useMemo(()=>Ha(ae,oe,n.history,v),[v,oe,ae,n.history]),ce=L.useMemo(()=>{if(se?.external)return Fn(se.href,n.protocolAllowlist)?void 0:se.href;if(!Ua(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),Fn(s,n.protocolAllowlist)?void 0:s}catch{}},[s,se,n.protocolAllowlist]),le=L.useMemo(()=>{if(ce)return!1;if(o?.exact){if(!_r(I.pathname,ie.pathname,n.basepath))return!1}else{let e=gr(I.pathname,n.basepath),t=gr(ie.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!kn(I.search,ie.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ne&&I.hash===ie.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,I,ce,ne,ie.hash,ie.pathname,ie.search,n.basepath]),ue=le?vn(i,{})??Fa:Pa,de=le?Pa:vn(a,{})??Pa,fe=[b,ue.className,de.className].filter(Boolean).join(` `),pe=(y||ue.style||de.style)&&{...y,...ue.style,...de.style},[me,he]=L.useState(!1),ge=L.useRef(!1),_e=e.reloadDocument||ce?!1:c??n.options.defaultPreload,ve=l??n.options.defaultPreloadDelay??0,ye=L.useCallback(()=>{n.preloadRoute({...re,_builtLocation:ie}).catch(e=>{console.warn(e),console.warn(zi)})},[n,re,ie]);mn(r,L.useCallback(e=>{e?.isIntersecting&&ye()},[ye]),Ba,{disabled:!!v||_e!==`viewport`}),L.useEffect(()=>{ge.current||!v&&_e===`render`&&(ye(),ge.current=!0)},[v,ye,_e]);let be=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!Ga(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Ma.flushSync)(()=>{he(!0)});let t=n.subscribe(`onResolved`,()=>{t(),he(!1)});n.navigate({...re,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(ce)return{...te,ref:r,href:ce,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let xe=e=>{if(v||_e!==`intent`)return;if(!ve){ye();return}let t=e.currentTarget;if(za.has(t))return;let n=setTimeout(()=>{za.delete(t),ye()},ve);za.set(t,n)},Se=e=>{v||_e!==`intent`||ye()},Ce=e=>{if(v||!_e||!ve)return;let t=e.currentTarget,n=za.get(t);n&&(clearTimeout(n),za.delete(t))};return{...te,...ue,...de,href:se?.href,ref:r,onClick:Va([x,be]),onBlur:Va([S,Ce]),onFocus:Va([C,xe]),onMouseEnter:Va([w,xe]),onMouseLeave:Va([T,Ce]),onTouchStart:Va([E,Se]),disabled:!!v,target:_,...pe&&{style:pe},...fe&&{className:fe},...v&&Ia,...le&&La,...ne&&me&&Ra}}var Pa={},Fa={className:`active`},Ia={role:`link`,"aria-disabled":!0},La={"data-status":`active`,"aria-current":`page`},Ra={"data-transitioning":`transitioning`},za=new WeakMap,Ba={rootMargin:`100px`},Va=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ha(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Ua(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Wa=L.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Na(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return L.createElement(`a`,t,o)}return L.createElement(n,a,o)});function Ga(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Ka=class extends Bi{constructor(e){super(e),this.useMatch=e=>Ta({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ja({...e,from:this.id}),this.useSearch=e=>ka({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Oa({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Da({...e,from:this.id}),this.useLoaderData=e=>Ea({...e,from:this.id}),this.useNavigate=()=>Aa({from:this.fullPath}),this.Link=L.forwardRef((e,t)=>(0,R.jsx)(Wa,{ref:t,from:this.fullPath,...e}))}};function qa(e){return new Ka(e)}var Ja=class extends Vi{constructor(e){super(e),this.useMatch=e=>Ta({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ja({...e,from:this.id}),this.useSearch=e=>ka({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Oa({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Da({...e,from:this.id}),this.useLoaderData=e=>Ea({...e,from:this.id}),this.useNavigate=()=>Aa({from:this.fullPath}),this.Link=L.forwardRef((e,t)=>(0,R.jsx)(Wa,{ref:t,from:this.fullPath,...e}))}};function Ya(e){return new Ja(e)}function Xa(e){let t=Xi(),n=`not-found-${Ca(t.stores.location,e=>e.pathname)}-${Ca(t.stores.status,e=>e)}`;return(0,R.jsx)(Ui,{getResetKey:()=>n,onCatch:(t,n)=>{if(Cr(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Cr(t))return e.fallback?.(t);throw t},children:e.children})}function Za(){return(0,R.jsx)(`p`,{children:`Not Found`})}function Qa(e){return(0,R.jsx)(R.Fragment,{children:e.children})}function $a(e,t,n){return t.options.notFoundComponent?(0,R.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,R.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,R.jsx)(Za,{})}var eo=L.memo(function({matchId:e}){let t=Xi(),n=t.stores.matchStores.get(e);n||zn();let r=Ca(t.stores.loadedAt,e=>e),i=Ca(n,e=>e);return(0,R.jsx)(to,{router:t,matchId:e,resetKey:r,matchState:L.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function to({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,R.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?L.Suspense:Qa,f=s?Ui:Qa,p=l?Xa:Qa;return(0,R.jsxs)(i.isRoot?i.options.shellComponent??Qa:Qa,{children:[(0,R.jsx)(Zi.Provider,{value:t,children:(0,R.jsx)(d,{fallback:o,children:(0,R.jsx)(f,{getResetKey:()=>n,errorComponent:s||Gi,onCatch:(e,t)=>{if(Cr(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,R.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return L.createElement(l,e)},children:u||r._displayPending?(0,R.jsx)(Ki,{fallback:o,children:(0,R.jsx)(ro,{matchId:t})}):(0,R.jsx)(ro,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(no,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function no({resetKey:e}){let t=Xi(),n=L.useRef(void 0);return fn(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Oi(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var ro=L.memo(function({matchId:e}){let t=Xi(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||zn();let i=Ca(r,e=>e),a=i.routeId,o=t.routesById[a],s=L.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=L.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,R.jsx)(e,{},s):(0,R.jsx)(io,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=An();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return Cr(i.error)||zn(),$a(t,o,i.error);if(i.status===`redirected`)throw Ur(i.error)||zn(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),io=L.memo(function(){let e=Xi(),t=L.useContext(Zi),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=Ca(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=Ca(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,R.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||zn(),$a(e,a,void 0);if(!i)return null;let s=(0,R.jsx)(eo,{matchId:i});return n===`__root__`?(0,R.jsx)(L.Suspense,{fallback:o,children:s}):s});function ao(){let e=Xi(),t=L.useRef({router:e,mounted:!1}),[n,r]=L.useState(!1),i=Ca(e.stores.isLoading,e=>e),a=Ca(e.stores.hasPending,e=>e),o=pn(i),s=i||n||a,c=pn(s),l=i||a,u=pn(l);return e.startTransition=e=>{r(!0),L.startTransition(()=>{e(),r(!1)})},L.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return mr(e.latestLocation.publicHref)!==mr(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),fn(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),fn(()=>{o&&!i&&e.emit({type:`onLoad`,...Oi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),fn(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Oi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),fn(()=>{if(c&&!s){let t=Oi(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),pa(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())}),t.hrefChanged&&Hi(e)}},[s,c,e]),null}function oo(){let e=Xi(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,R.jsx)(t,{}):null,r=(0,R.jsxs)(typeof document<`u`&&e.ssr?Qa:L.Suspense,{fallback:n,children:[(0,R.jsx)(ao,{}),(0,R.jsx)(so,{})]});return e.options.InnerWrap?(0,R.jsx)(e.options.InnerWrap,{children:r}):r}function so(){let e=Xi(),t=Ca(e.stores.firstId,e=>e),n=Ca(e.stores.loadedAt,e=>e),r=t?(0,R.jsx)(eo,{matchId:t}):null;return(0,R.jsx)(Zi.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,R.jsx)(Ui,{getResetKey:()=>n,errorComponent:Gi,onCatch:void 0,children:r})})}var co=e=>({createMutableStore:ga,createReadonlyStore:ga,batch:pa}),lo=e=>new uo(e),uo=class extends ki{constructor(e){super(e,co)}};function fo({router:e,children:t,...n}){xn(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,R.jsx)(Yi.Provider,{value:e,children:t});return e.options.Wrap?(0,R.jsx)(e.options.Wrap,{children:r}):r}function po({router:e,...t}){return(0,R.jsx)(fo,{router:e,...t,children:(0,R.jsx)(oo,{})})}function mo(e){let t=Xi({warn:e?.router===void 0}),n=e?.router||t,r=(0,L.useRef)(void 0);return Ca(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=wn(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var ho=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),go=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_o=e=>{let t=go(e);return t.charAt(0).toUpperCase()+t.slice(1)},vo=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),yo=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},bo={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},xo=(0,L.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,L.createElement)(`svg`,{ref:c,...bo,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vo(`lucide`,i),...!a&&!yo(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,L.createElement)(e,t)),...Array.isArray(a)?a:[a]])),So=(e,t)=>{let n=(0,L.forwardRef)(({className:n,...r},i)=>(0,L.createElement)(xo,{ref:i,iconNode:t,className:vo(`lucide-${ho(_o(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_o(e),n},Co=So(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),wo=So(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),To=So(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Eo=So(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Do=So(`bolt`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),Oo=So(`book-open-text`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M16 12h2`,key:`7q9ll5`}],[`path`,{d:`M16 8h2`,key:`msurwy`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}],[`path`,{d:`M6 12h2`,key:`32wvfc`}],[`path`,{d:`M6 8h2`,key:`30oboj`}]]),ko=So(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ao=So(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),jo=So(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Mo=So(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),No=So(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Po=So(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Fo=So(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),Io=So(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),Lo=So(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Ro=So(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),zo=So(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Bo=So(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Vo=So(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ho=So(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Uo=So(`file-plus-2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M3 15h6`,key:`4e2qda`}],[`path`,{d:`M6 12v6`,key:`1u72j0`}]]),Wo=So(`files`,[[`path`,{d:`M15 2a2 2 0 0 1 1.414.586l4 4A2 2 0 0 1 21 8v7a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z`,key:`1vo8kb`}],[`path`,{d:`M15 2v4a2 2 0 0 0 2 2h4`,key:`sud9ri`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),Go=So(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ko=So(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),qo=So(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),Jo=So(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Yo=So(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Xo=So(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Zo=So(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Qo=So(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),$o=So(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),es=So(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ts=So(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),ns=So(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),rs=So(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),is=So(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),as=So(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),os=So(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),ss=So(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),cs=So(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),ls=So(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),us=So(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ds=So(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),fs=So(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ps=So(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),ms=So(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),hs=So(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),gs=So(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),_s=Le();async function vs(e,t=!1,n,r=!1){let i=new URLSearchParams;return e&&i.set(`piboSessionId`,e),t&&i.set(`includeArchived`,`true`),n&&i.set(`roomId`,n),r&&i.set(`markRead`,`true`),nc(`/api/chat/bootstrap${i.size?`?${i.toString()}`:``}`).then(rc)}async function ys(e,t={}){let n=new URLSearchParams({piboSessionId:e});t.includeRawEvents&&n.set(`includeRawEvents`,`true`),t.rawEventsLimit&&n.set(`rawEventsLimit`,String(t.rawEventsLimit));let r=await fetch(`/api/chat/trace?${n.toString()}`,{headers:t.knownVersion?{"if-none-match":ic(t.knownVersion)}:void 0});if(r.status===304)return{notModified:!0,version:ac(r.headers.get(`etag`))??t.knownVersion};let i=await r.json().catch(()=>void 0);if(!r.ok){let e=i&&typeof i==`object`&&`error`in i?String(i.error):`Request failed`,t=Error(e);throw t.status=r.status,t.data=i,t}return{trace:i,notModified:!1,version:ac(r.headers.get(`etag`))??i.version}}async function bs(e,t){return nc(`/api/chat/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e?{profile:e}:{},...t?{roomId:t}:{}})})}async function xs(){return(await nc(`/api/chat/base-prompt`)).basePrompt}async function Ss(e){return(await nc(`/api/chat/base-prompt`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:e})})).basePrompt}async function Cs(e){return(await nc(`/api/chat/base-prompt/custom`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({markdown:e})})).basePrompt}async function ws(){return(await nc(`/api/chat/compaction-prompt`)).compactionPrompt}async function Ts(e){return(await nc(`/api/chat/compaction-prompt`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:e})})).compactionPrompt}async function Es(e){return(await nc(`/api/chat/compaction-prompt/custom`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({markdown:e})})).compactionPrompt}async function Ds(e){return nc(`/api/context-files`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}async function Os(){return(await nc(`/api/context-files`)).files}async function ks(e){return(await nc(`/api/context-files/${encodeURIComponent(e)}`)).file}async function As(e){return(await nc(`/api/context-files`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})).file}async function js(e,t={}){return(await nc(`/api/context-files/${encodeURIComponent(e)}/link-from-plugin`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})).file}async function Ms(e,t){return(await nc(`/api/context-files/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})).file}async function Ns(e,t){return(await nc(`/api/context-files/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})).file}async function Ps(e,t){await nc(`/api/context-files/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({deleteFile:t})})}async function Fs(e){return nc(`/api/context-files/${encodeURIComponent(e)}/revisions`)}async function Is(e,t=`source`,n=`working`){let r=new URLSearchParams({base:t,target:n});return nc(`/api/context-files/${encodeURIComponent(e)}/diff?${r.toString()}`)}async function Ls(e){return(await nc(`/api/context-files/${encodeURIComponent(e)}/reset-to-source`,{method:`POST`,headers:{"content-type":`application/json`},body:`{}`})).file}async function Rs(e){return(await nc(`/api/context-files/${encodeURIComponent(e)}/adopt-source`,{method:`POST`,headers:{"content-type":`application/json`},body:`{}`})).file}async function zs(e,t){return(await nc(`/api/context-files/${encodeURIComponent(e)}/restore-revision`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({revisionId:t})})).file}async function Bs(e){return nc(`/api/chat/agents`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}async function Vs(e,t){return nc(`/api/chat/agents/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function Hs(e,t){return nc(`/api/chat/agents/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({confirmName:t})})}async function Us(e,t){return nc(`/api/chat/mcp-servers/${encodeURIComponent(e)}/description`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({description:t})})}async function Ws(e){return(await nc(`/api/chat/pi-packages`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({source:e})})).package}async function Gs(e,t){return(await nc(`/api/chat/pi-packages/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})).package}async function Ks(e){return(await nc(`/api/chat/pi-packages/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:`{}`})).removedPackage}async function qs(e){return nc(`/api/chat/rooms`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}async function Js(e,t){return nc(`/api/chat/rooms/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function Ys(e,t){return nc(`/api/chat/rooms/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({confirmName:t})})}async function Xs(e,t){return nc(`/api/chat/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function Zs(e,t){return nc(`/api/chat/sessions/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({confirmText:t})})}async function Qs(e,t,n,r){return nc(`/api/chat/message`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({piboSessionId:e,text:t,clientTxnId:n,...r?{roomId:r}:{}})})}async function $s(e,t,n){return nc(`/api/chat/action`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({piboSessionId:e,action:t,params:n})})}async function ec(){await fetch(`/api/auth/sign-out`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:`{}`})}async function tc(){let e=location.pathname.startsWith(`/apps/chat`)?`${location.pathname}${location.search}`:`/apps/chat`,t=await fetch(`/api/auth/sign-in/social`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({provider:`google`,callbackURL:e,disableRedirect:!0})}),n=await t.json();if(!t.ok||!n.url)throw Error(n.message||n.error||`Could not start Google sign in.`);location.href=n.url}async function nc(e,t){let n=await fetch(e,t),r=await n.json().catch(()=>void 0);if(!n.ok){let e=r&&typeof r==`object`&&`error`in r?String(r.error):`Request failed`,t=Error(e);throw t.status=n.status,t.data=r,t}return r}function rc(e){if(!e.session)throw Error(`Invalid bootstrap response.`);let t=e.sessions??[],n=e.selectedPiboSessionId??e.session.id??t[0]?.piboSessionId??``;return{identity:e.identity??{userId:``},session:e.session,room:e.room,selectedRoomId:e.selectedRoomId??``,selectedPiboSessionId:n,rooms:e.rooms??[],sessions:t,agents:e.agents??[],customAgents:e.customAgents??[],agentCatalog:e.agentCatalog?{...e.agentCatalog,piboTools:e.agentCatalog.piboTools??[],piPackages:(e.agentCatalog.piPackages??[]).map(e=>({...e,enabled:e.enabled!==!1}))}:e.agentCatalog,capabilities:{actions:e.capabilities?.actions??[]}}}function ic(e){return`"${e}"`}function ac(e){if(!e)return;let t=e.trim();return t.startsWith(`W/`)?ac(t.slice(2)):t.startsWith(`"`)&&t.endsWith(`"`)?t.slice(1,-1):t}var oc=new WeakMap;function sc(e,t,n){let r=n.map(e=>cc(e)),i=mc(r),a=i.length?Math.min(...i.map(e=>e.startTime)):Date.now()*1e3,o=i.flatMap(e=>e.endTime?[e.endTime]:[]),s=o.length?Math.max(...o):void 0,c=i.some(e=>e.status===`UNSET`);return{id:e,name:t,status:i.some(e=>e.status===`ERROR`)?`ERROR`:c?`UNSET`:`OK`,spans:r,startedAt:new Date(a/1e3),completedAt:s?new Date(s/1e3):void 0,totalDurationMs:s?(s-a)/1e3:0}}function cc(e){let t=oc.get(e);if(t)return t;let n=pc(e.startedAt)??Date.now()*1e3,r=pc(e.completedAt),i=fc(e.status),a=lc(e.type),o={id:e.id,parentId:e.parentId,name:uc(e),spanType:a,startTime:n,endTime:r,durationUs:e.durationMs===void 0?void 0:e.durationMs*1e3,attributes:dc(e),status:i,statusMessage:e.error,events:e.error?[{name:`exception`,timestamp:r??n,attributes:{message:e.error}}]:[],children:e.children?.map(cc),pibo:{entryId:e.entryId,linkedPiboSessionId:e.linkedPiboSessionId,traceNodeType:e.type,traceOrder:e.orderKey,stableKey:e.stableKey,source:e.source}};return oc.set(e,o),o}function lc(e){switch(e){case`user.message`:return`user.prompt`;case`assistant.message`:return`model.response`;case`model.reasoning`:return`model.reasoning`;case`tool.call`:return`tool.call`;case`tool.result`:return`tool.result`;case`agent.delegation`:return`agent.delegation`;case`agent.async`:return`agent.async`;case`execution.command`:return`tool.result`;case`yielded.run`:return`yielded.run`;case`agent.turn`:return`agent.run`;case`error`:return`tool.result`}}function uc(e){return e.type===`assistant.message`?`assistant_message`:e.type===`user.message`?`user_prompt`:e.type===`model.reasoning`?`model_reasoning`:e.title||e.type}function dc(e){let t={};return e.summary&&(t.content=e.summary),e.input!==void 0&&(t.input=e.input,t.args=e.input,t.arguments=e.input),e.output!==void 0&&(t.output=e.output,t.result=e.output),e.error&&(t.error=e.error),e.toolCallId&&(t.tool_call_id=e.toolCallId),e.runId&&(t.run_id=e.runId),(e.type===`tool.call`||e.type===`agent.delegation`)&&(t.tool_name=e.title),e.type===`assistant.message`&&(t.content=e.output??e.summary??``),e.type===`user.message`&&(t.content=e.output??e.summary??``),e.type===`model.reasoning`&&(t.reasoning=e.output??e.summary??``),e.type===`agent.delegation`&&(t[`delegation.target_agent`]=e.title.replace(/^pibo_subagent_/,``),t[`delegation.query`]=e.summary??e.input,t[`result.status`]=e.status===`done`?`completed`:e.status,t.linked_pibo_session_id=e.linkedPiboSessionId),e.type===`agent.async`&&(t[`async_agent.target_agent`]=e.title,t[`async_agent.started_by`]=hc(e.input)?e.input.startedBy:`pibo_run_start`,t[`async_agent.query`]=hc(e.input)?e.input.arguments:e.input,t[`result.status`]=e.status===`done`?`started`:e.status,t.linked_pibo_session_id=e.linkedPiboSessionId),e.type===`yielded.run`&&(t[`run.notification`]=!0,t[`run.status`]=e.status),t}function fc(e){return e===`running`?`UNSET`:e===`error`?`ERROR`:`OK`}function pc(e){if(!e)return;let t=new Date(e).getTime();return Number.isFinite(t)?t*1e3:void 0}function mc(e){return e.flatMap(e=>[e,...e.children?mc(e.children):[]])}function hc(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z.apply(null,arguments)}function gc(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _c={},vc=(0,L.createContext)(_c),yc=(e,t)=>z({},e,t),bc=()=>(0,L.useContext)(vc),xc=(0,L.createContext)(()=>{});xc.displayName=`JVR.DispatchShowTools`;function Sc(){return(0,L.useReducer)(yc,_c)}function Cc(){return(0,L.useContext)(xc)}var wc=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,R.jsx)(vc.Provider,{value:t,children:(0,R.jsx)(xc.Provider,{value:n,children:r})})};wc.displayName=`JVR.ShowTools`;var Tc={},Ec=(0,L.createContext)(Tc),Dc=(e,t)=>z({},e,t),Oc=()=>(0,L.useContext)(Ec),kc=(0,L.createContext)(()=>{});kc.displayName=`JVR.DispatchExpands`;function Ac(){return(0,L.useReducer)(Dc,Tc)}function jc(){return(0,L.useContext)(kc)}var Mc=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,R.jsx)(Ec.Provider,{value:t,children:(0,R.jsx)(kc.Provider,{value:n,children:r})})};Mc.displayName=`JVR.Expands`;var Nc={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},Pc=(0,L.createContext)(Nc),Fc=(e,t)=>z({},e,t),Ic=()=>(0,L.useContext)(Pc),Lc=(0,L.createContext)(()=>{});Lc.displayName=`JVR.DispatchTypes`;function Rc(){return(0,L.useReducer)(Fc,Nc)}function zc(){return(0,L.useContext)(Lc)}function Bc(e){var{initial:t,dispatch:n,children:r}=e;return(0,R.jsx)(Pc.Provider,{value:t,children:(0,R.jsx)(Lc.Provider,{value:n,children:r})})}Bc.displayName=`JVR.Types`;var Vc=[`style`];function Hc(e){var{style:t}=e,n=gc(e,Vc);return(0,R.jsx)(`svg`,z({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:z({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,R.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}Hc.displayName=`JVR.TriangleArrow`;var Uc={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,R.jsx)(Hc,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},Wc=(0,L.createContext)(Uc),Gc=(e,t)=>z({},e,t),Kc=()=>(0,L.useContext)(Wc),qc=(0,L.createContext)(()=>{});qc.displayName=`JVR.DispatchSymbols`;function Jc(){return(0,L.useReducer)(Gc,Uc)}function Yc(){return(0,L.useContext)(qc)}var Xc=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,R.jsx)(Wc.Provider,{value:t,children:(0,R.jsx)(qc.Provider,{value:n,children:r})})};Xc.displayName=`JVR.Symbols`;var Zc={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},Qc=(0,L.createContext)(Zc),$c=(e,t)=>z({},e,t),el=()=>(0,L.useContext)(Qc),tl=(0,L.createContext)(()=>{});tl.displayName=`JVR.DispatchSection`;function nl(){return(0,L.useReducer)($c,Zc)}function rl(){return(0,L.useContext)(tl)}var il=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,R.jsx)(Qc.Provider,{value:t,children:(0,R.jsx)(tl.Provider,{value:n,children:r})})};il.displayName=`JVR.Section`;var al={objectSortKeys:!1,indentWidth:15},ol=(0,L.createContext)(al);ol.displayName=`JVR.Context`;var sl=(0,L.createContext)(()=>{});sl.displayName=`JVR.DispatchContext`;function cl(e,t){return z({},e,t)}var ll=()=>(0,L.useContext)(ol),ul=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,L.useReducer)(cl,Object.assign({},al,n)),[o,s]=Sc(),[c,l]=Ac(),[u,d]=Rc(),[f,p]=Jc(),[m,h]=nl();return(0,L.useEffect)(()=>a(z({},n)),[n]),(0,R.jsx)(ol.Provider,{value:i,children:(0,R.jsx)(sl.Provider,{value:a,children:(0,R.jsx)(wc,{initial:o,dispatch:s,children:(0,R.jsx)(Mc,{initial:c,dispatch:l,children:(0,R.jsx)(Bc,{initial:z({},u,r),dispatch:d,children:(0,R.jsx)(Xc,{initial:f,dispatch:p,children:(0,R.jsx)(il,{initial:m,dispatch:h,children:t})})})})})})})};ul.displayName=`JVR.Provider`;function dl(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var fl=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],pl=[`as`,`render`],ml=[`as`,`render`],hl=[`as`,`render`],gl=[`as`,`style`,`render`],_l=[`as`,`render`],vl=[`as`,`render`],yl=[`as`,`render`],bl=[`as`,`render`],xl=e=>{var{Quote:t={}}=Kc(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=gc(e,fl);if(n)return null;var{as:c,render:l}=t,u=gc(t,pl),d=c||`span`,f=z({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,R.jsx)(d,z({},f))};xl.displayName=`JVR.Quote`;var Sl=e=>{var{ValueQuote:t={}}=Kc(),n=z({},(dl(e),e)),{as:r,render:i}=t,a=gc(t,ml),o=r||`span`,s=z({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,R.jsx)(o,z({},s))};Sl.displayName=`JVR.ValueQuote`;var Cl=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=Kc(),{as:o,render:s}=a,c=gc(a,hl),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,R.jsx)(l,z({},c))};Cl.displayName=`JVR.Colon`;var wl=e=>{var{Arrow:t={}}=Kc(),n=Oc(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=gc(t,gl),m=u||`span`,h=f&&typeof f==`function`,g=z({},p,{"data-expanded":l,style:z({},d,i)});return h&&f(g,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,R.jsx)(m,z({},p,{style:z({},d,i)}))};wl.displayName=`JVR.Arrow`;var Tl=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=Kc(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=gc(o,_l),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,R.jsx)(f,z({},d))}var{as:p,render:m}=s,h=gc(s,vl),g=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,R.jsx)(g,z({},h))};Tl.displayName=`JVR.BracketsOpen`;var El=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=Kc();if(t){var{as:u,render:d}=c,f=gc(c,yl),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,R.jsx)(p,z({},f))}var{as:m,render:h}=l,g=gc(l,bl),_=m||`span`;return h&&typeof h==`function`&&h(g,s)||(0,R.jsx)(_,z({},g))};El.displayName=`JVR.BracketsClose`;var Dl=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=Oc(),{collapsed:c,shouldExpandNodeInitially:l}=ll(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},g=Array.isArray(n),_=n instanceof Set;return(0,R.jsx)(`div`,{style:m,children:(0,R.jsx)(El,z({isBrackets:g||_},h,{isVisiable:!0}))})};Dl.displayName=`JVR.NestedClose`;var Ol=[`as`,`render`],kl=[`as`,`render`],Al=[`as`,`render`],jl=[`as`,`render`],Ml=[`as`,`render`],Nl=[`as`,`render`],Pl=[`as`,`render`],Fl=[`as`,`render`],Il=[`as`,`render`],Ll=[`as`,`render`],Rl=[`as`,`render`],zl=[`as`,`render`],Bl=[`as`,`render`],Vl=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},Hl=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=Ic();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=gc(r,Ol);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,R.jsx)(a||`span`,z({},s))};Hl.displayName=`JVR.SetComp`;var Ul=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=Ic();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=gc(r,kl);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,R.jsx)(a||`span`,z({},s))};Ul.displayName=`JVR.MapComp`;var Wl={opacity:.75,paddingRight:4},Gl=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=Ic(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=ll(),{as:c,render:l}=i,u=gc(i,Al),d=t,[f,p]=(0,L.useState)(o&&d.length>o);(0,L.useEffect)(()=>p(o&&d.length>o),[o]);var m=c||`span`,h=z({},Wl,i.style||{});o>0&&(u.style=z({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var g=f?``+d.slice(0,o)+s:d,_=l&&typeof l==`function`,v=_&&l(z({},u,{style:h}),{type:`type`,value:t,keyName:n,keys:r}),y=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,b=_&&l(z({},u,{children:g,className:y}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(v||(0,R.jsx)(m,z({},u,{style:h}))),b||(0,R.jsxs)(L.Fragment,{children:[(0,R.jsx)(Sl,{}),(0,R.jsx)(m,z({},u,{className:y,children:g})),(0,R.jsx)(Sl,{})]})]})};Gl.displayName=`JVR.TypeString`;var Kl=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=Ic(),{as:o,render:s}=i,c=gc(i,jl),l=o||`span`,u=z({},Wl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(f||(0,R.jsx)(l,z({},c,{style:u}))),p||(0,R.jsx)(l,z({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Kl.displayName=`JVR.TypeTrue`;var ql=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=Ic(),{as:o,render:s}=i,c=gc(i,Ml),l=o||`span`,u=z({},Wl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(f||(0,R.jsx)(l,z({},c,{style:u}))),p||(0,R.jsx)(l,z({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};ql.displayName=`JVR.TypeFalse`;var Jl=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=Ic(),{as:o,render:s}=i,c=gc(i,Nl),l=o||`span`,u=z({},Wl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(f||(0,R.jsx)(l,z({},c,{style:u}))),p||(0,R.jsx)(l,z({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Jl.displayName=`JVR.TypeFloat`;var Yl=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=Ic(),{as:o,render:s}=i,c=gc(i,Pl),l=o||`span`,u=z({},Wl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(f||(0,R.jsx)(l,z({},c,{style:u}))),p||(0,R.jsx)(l,z({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Yl.displayName=`JVR.TypeInt`;var Xl=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=Ic(),{as:o,render:s}=i,c=gc(i,Fl),l=o||`span`,u=z({},Wl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(f||(0,R.jsx)(l,z({},c,{style:u}))),p||(0,R.jsx)(l,z({},c,{className:`w-rjv-value`,children:Vl(t?.toString())}))]})};Xl.displayName=`JVR.TypeFloat`;var Zl=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=Ic(),{as:o,render:s}=i,c=gc(i,Il),l=o||`span`,u=z({},Wl,i.style),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(f||(0,R.jsx)(l,z({},c,{style:u}))),p||(0,R.jsxs)(`a`,z({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,R.jsx)(Sl,{}),t?.href,(0,R.jsx)(Sl,{})]}))]})};Zl.displayName=`JVR.TypeUrl`;var Ql=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=Ic(),{as:o,render:s}=i,c=gc(i,Ll),l=o||`span`,u=z({},Wl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,m=d&&s(z({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(f||(0,R.jsx)(l,z({},c,{style:u}))),m||(0,R.jsx)(l,z({},c,{className:`w-rjv-value`,children:p}))]})};Ql.displayName=`JVR.TypeDate`;var $l=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=Ic(),{as:o,render:s}=i,c=gc(i,Rl),l=o||`span`,u=z({},Wl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(f||(0,R.jsx)(l,z({},c,{style:u}))),p||(0,R.jsx)(l,z({},c,{className:`w-rjv-value`,children:`undefined`}))]})};$l.displayName=`JVR.TypeUndefined`;var eu=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=Ic(),{as:o,render:s}=i,c=gc(i,zl),l=o||`span`,u=z({},Wl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(f||(0,R.jsx)(l,z({},c,{style:u}))),p||(0,R.jsx)(l,z({},c,{className:`w-rjv-value`,children:`null`}))]})};eu.displayName=`JVR.TypeNull`;var tu=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=Ic(),{as:o,render:s}=i,c=gc(i,Bl),l=o||`span`,u=z({},Wl,i.style||{}),d=s&&typeof s==`function`,f=d&&s(z({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(z({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,R.jsxs)(L.Fragment,{children:[a&&(f||(0,R.jsx)(l,z({},c,{style:u}))),p||(0,R.jsx)(l,z({},c,{className:`w-rjv-value`,children:`NaN`}))]})};tu.displayName=`JVR.TypeNan`;var nu=e=>Number(e)===e&&e%1!=0||isNaN(e),ru=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,R.jsx)(Zl,z({},i,{children:t})):typeof t==`string`?(0,R.jsx)(Gl,z({},i,{children:t})):t===!0?(0,R.jsx)(Kl,z({},i,{children:t})):t===!1?(0,R.jsx)(ql,z({},i,{children:t})):t===null?(0,R.jsx)(eu,z({},i,{children:t})):t===void 0?(0,R.jsx)($l,z({},i,{children:t})):t instanceof Date?(0,R.jsx)(Ql,z({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,R.jsx)(tu,z({},i,{children:t})):typeof t==`number`&&nu(t)?(0,R.jsx)(Jl,z({},i,{children:t})):typeof t==`bigint`?(0,R.jsx)(Xl,z({},i,{children:t})):typeof t==`number`?(0,R.jsx)(Yl,z({},i,{children:t})):null};ru.displayName=`JVR.Value`;function iu(e,t,n){var r=Yc(),i=z({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:z({},e.style,t.style),children:t.children||e.children});(0,L.useEffect)(()=>r({[n]:i}),[t])}function au(e,t,n){var r=zc(),i=z({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:z({},e.style,t.style),children:t.children||e.children});(0,L.useEffect)(()=>r({[n]:i}),[t])}function ou(e,t,n){var r=rl(),i=z({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:z({},e.style,t.style),children:t.children||e.children});(0,L.useEffect)(()=>r({[n]:i}),[t])}var su=[`as`,`render`],cu=e=>{var{KeyName:t={}}=el();return ou(t,e,`KeyName`),null};cu.displayName=`JVR.KeyName`;var lu=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=el(),{as:c,render:l}=s,u=gc(s,su);u.style=z({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(z({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,R.jsx)(d,z({},u,{children:t}))};lu.displayName=`JVR.KeyNameComp`;var uu=[`children`,`value`,`parentValue`,`keyName`,`keys`],du=[`as`,`render`,`children`],fu=e=>{var{Row:t={}}=el();return ou(t,e,`Row`),null};fu.displayName=`JVR.Row`;var pu=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=gc(e,uu),{Row:s={}}=el(),{as:c,render:l}=s,u=gc(s,du),d=c||`div`;return l&&typeof l==`function`&&l(z({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,R.jsx)(d,z({},o,u,{children:t}))};pu.displayName=`JVR.RowComp`;function mu(e){var t=(0,L.useRef)();return(0,L.useEffect)(()=>{t.current=e}),t.current}function hu(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=mu(t),a=(0,L.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,L.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var gu=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],_u=[`as`,`render`],vu=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=gc(e,gu),{onCopied:c,enableClipboard:l,beforeCopy:u}=ll(),d=bc()[i],[f,p]=(0,L.useState)(!1),{Copied:m={}}=el(),h=m?.beforeCopy;if(l===!1||!d)return null;var g={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?Vl(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?Vl(t):t,2);var l=o||h||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:_}=m,v=gc(m,_u),y=z({},v,s,g,{style:z({},v.style,s.style,g.style)});return _&&typeof _==`function`&&_(z({},y,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,R.jsx)(`svg`,z({viewBox:`0 0 32 36`},y,{children:(0,R.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,R.jsx)(`svg`,z({viewBox:`0 0 32 36`},y,{children:(0,R.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};vu.displayName=`JVR.Copied`;function yu(){var e=(0,L.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var bu=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=Oc(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=ll(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,R.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,R.jsx)(Su,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};bu.displayName=`JVR.KeyValues`;var xu=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=ll(),o=typeof t==`number`,s=(0,L.useRef)(null);hu({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,R.jsxs)(L.Fragment,{children:[(0,R.jsxs)(`span`,{ref:s,children:[(0,R.jsx)(xl,z({isNumber:o,"data-placement":`left`},c)),(0,R.jsx)(lu,z({},c,{children:t})),(0,R.jsx)(xl,z({isNumber:o,"data-placement":`right`},c))]}),(0,R.jsx)(Cl,z({},c))]})};xu.displayName=`JVR.KayName`;var Su=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=Cc(),s=yu(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,R.jsx)(Iu,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,R.jsxs)(pu,z({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,R.jsx)(xu,{keyName:t,value:n,keys:a,parentValue:r}),(0,R.jsx)(ru,{keyName:t,value:n,keys:a}),(0,R.jsx)(vu,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Su.displayName=`JVR.KeyValuesItem`;var Cu=[`value`,`keyName`],wu=[`as`,`render`],Tu=e=>{var{CountInfoExtra:t={}}=el();return ou(t,e,`CountInfoExtra`),null};Tu.displayName=`JVR.CountInfoExtra`;var Eu=e=>{var{value:t={},keyName:n}=e,r=gc(e,Cu),{CountInfoExtra:i={}}=el(),{as:a,render:o}=i,s=gc(i,wu);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=z({},s,r);return l&&o(u,{value:t,keyName:n})||(0,R.jsx)(c,z({},u))};Eu.displayName=`JVR.CountInfoExtraComps`;var Du=[`value`,`keyName`],Ou=[`as`,`render`],ku=e=>{var{CountInfo:t={}}=el();return ou(t,e,`CountInfo`),null};ku.displayName=`JVR.CountInfo`;var Au=e=>{var{value:t={},keyName:n}=e,r=gc(e,Du),{displayObjectSize:i}=ll(),{CountInfo:a={}}=el();if(!i)return null;var{as:o,render:s}=a,c=gc(a,Ou),l=o||`span`;c.style=z({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=z({},c,r);return s&&typeof s==`function`&&s(z({},d,{"data-length":u}),{value:t,keyName:n})||(0,R.jsx)(l,z({},d))};Au.displayName=`JVR.CountInfoComp`;var ju=[`as`,`render`],Mu=e=>{var{Ellipsis:t={}}=el();return ou(t,e,`Ellipsis`),null};Mu.displayName=`JVR.Ellipsis`;var Nu=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=el(),{as:a,render:o}=i,s=gc(i,ju),c=a||`span`;return o&&typeof o==`function`&&o(z({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,R.jsx)(c,z({},s)))};Nu.displayName=`JVR.EllipsisComp`;var Pu=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=Oc(),l=jc(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=ll(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var g=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},_={display:`inline-flex`,alignItems:`center`},v={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},y=Object.keys(a).length,b=typeof a==`object`,x=Array.isArray(a),S=a instanceof Set,C=y!==0&&(x||S||b),w={style:_};C&&(w.onClick=g);var T={keyName:t,value:a,keys:r,parentValue:o};return(0,R.jsxs)(`span`,z({},w,{children:[C&&(0,R.jsx)(wl,z({style:v,expandKey:n},T)),(t||typeof t==`number`)&&(0,R.jsx)(xu,z({},T)),(0,R.jsx)(Hl,{value:i,keyName:t}),(0,R.jsx)(Ul,{value:i,keyName:t}),(0,R.jsx)(Tl,z({isBrackets:x||S},T)),(0,R.jsx)(Nu,{keyName:t,value:a,isExpanded:m}),(0,R.jsx)(El,z({isVisiable:m||!C,isBrackets:x||S},T)),(0,R.jsx)(Au,{value:a,keyName:t}),(0,R.jsx)(Eu,{value:a,keyName:t}),(0,R.jsx)(vu,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};Pu.displayName=`JVR.NestedOpen`;var Fu=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],Iu=(0,L.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=gc(e,Fu),u=Cc(),d=yu();return(0,R.jsxs)(`div`,z({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,R.jsx)(Pu,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,R.jsx)(bu,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,R.jsx)(Dl,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});Iu.displayName=`JVR.Container`;var Lu=e=>{var{BraceLeft:t={}}=Kc();return iu(t,e,`BraceLeft`),null};Lu.displayName=`JVR.BraceLeft`;var Ru=e=>{var{BraceRight:t={}}=Kc();return iu(t,e,`BraceRight`),null};Ru.displayName=`JVR.BraceRight`;var zu=e=>{var{BracketsLeft:t={}}=Kc();return iu(t,e,`BracketsLeft`),null};zu.displayName=`JVR.BracketsLeft`;var Bu=e=>{var{BracketsRight:t={}}=Kc();return iu(t,e,`BracketsRight`),null};Bu.displayName=`JVR.BracketsRight`;var Vu=e=>{var{Arrow:t={}}=Kc();return iu(t,e,`Arrow`),null};Vu.displayName=`JVR.Arrow`;var Hu=e=>{var{Colon:t={}}=Kc();return iu(t,e,`Colon`),null};Hu.displayName=`JVR.Colon`;var Uu=e=>{var{Quote:t={}}=Kc();return iu(t,e,`Quote`),null};Uu.displayName=`JVR.Quote`;var Wu=e=>{var{ValueQuote:t={}}=Kc();return iu(t,e,`ValueQuote`),null};Wu.displayName=`JVR.ValueQuote`;var Gu=e=>{var{Bigint:t={}}=Ic();return au(t,e,`Bigint`),null};Gu.displayName=`JVR.Bigint`;var Ku=e=>{var{Date:t={}}=Ic();return au(t,e,`Date`),null};Ku.displayName=`JVR.Date`;var qu=e=>{var{False:t={}}=Ic();return au(t,e,`False`),null};qu.displayName=`JVR.False`;var Ju=e=>{var{Float:t={}}=Ic();return au(t,e,`Float`),null};Ju.displayName=`JVR.Float`;var Yu=e=>{var{Int:t={}}=Ic();return au(t,e,`Int`),null};Yu.displayName=`JVR.Int`;var Xu=e=>{var{Map:t={}}=Ic();return au(t,e,`Map`),null};Xu.displayName=`JVR.Map`;var Zu=e=>{var{Nan:t={}}=Ic();return au(t,e,`Nan`),null};Zu.displayName=`JVR.Nan`;var Qu=e=>{var{Null:t={}}=Ic();return au(t,e,`Null`),null};Qu.displayName=`JVR.Null`;var $u=e=>{var{Set:t={}}=Ic();return au(t,e,`Set`),null};$u.displayName=`JVR.Set`;var ed=e=>{var{Str:t={}}=Ic();return au(t,e,`Str`),null};ed.displayName=`JVR.StringText`;var td=e=>{var{True:t={}}=Ic();return au(t,e,`True`),null};td.displayName=`JVR.True`;var nd=e=>{var{Undefined:t={}}=Ic();return au(t,e,`Undefined`),null};nd.displayName=`JVR.Undefined`;var rd=e=>{var{Url:t={}}=Ic();return au(t,e,`Url`),null};rd.displayName=`JVR.Url`;var id=e=>{var{Copied:t={}}=el();return ou(t,e,`Copied`),null};id.displayName=`JVR.Copied`;var ad=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],od=(0,L.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:g,onCopied:_,beforeCopy:v}=e,y=gc(e,ad),b=z({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),x=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,R.jsxs)(ul,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:_,onExpand:g,beforeCopy:v},initialTypes:{displayDataTypes:m},children:[(0,R.jsx)(Iu,z({value:i},y,{ref:t,className:x,style:b})),a]})});od.Bigint=Gu,od.Date=Ku,od.False=qu,od.Float=Ju,od.Int=Yu,od.Map=Xu,od.Nan=Zu,od.Null=Qu,od.Set=$u,od.String=ed,od.True=td,od.Undefined=nd,od.Url=rd,od.ValueQuote=Wu,od.Arrow=Vu,od.Colon=Hu,od.Quote=Uu,od.Ellipsis=Mu,od.BraceLeft=Lu,od.BraceRight=Ru,od.BracketsLeft=zu,od.BracketsRight=Bu,od.Copied=id,od.CountInfo=ku,od.CountInfoExtra=Tu,od.KeyName=cu,od.Row=fu,od.displayName=`JVR.JsonView`;var sd={"--w-rjv-font-family":`monospace`,"--w-rjv-color":`#9cdcfe`,"--w-rjv-key-string":`#9cdcfe`,"--w-rjv-background-color":`#1e1e1e`,"--w-rjv-line-color":`#36334280`,"--w-rjv-arrow-color":`#838383`,"--w-rjv-edit-color":`var(--w-rjv-color)`,"--w-rjv-info-color":`#9c9c9c7a`,"--w-rjv-update-color":`#9cdcfe`,"--w-rjv-copied-color":`#9cdcfe`,"--w-rjv-copied-success-color":`#28a745`,"--w-rjv-curlybraces-color":`#d4d4d4`,"--w-rjv-colon-color":`#d4d4d4`,"--w-rjv-brackets-color":`#d4d4d4`,"--w-rjv-quotes-color":`var(--w-rjv-key-string)`,"--w-rjv-quotes-string-color":`var(--w-rjv-type-string-color)`,"--w-rjv-type-string-color":`#ce9178`,"--w-rjv-type-int-color":`#b5cea8`,"--w-rjv-type-float-color":`#b5cea8`,"--w-rjv-type-bigint-color":`#b5cea8`,"--w-rjv-type-boolean-color":`#569cd6`,"--w-rjv-type-date-color":`#b5cea8`,"--w-rjv-type-url-color":`#3b89cf`,"--w-rjv-type-null-color":`#569cd6`,"--w-rjv-type-nan-color":`#859900`,"--w-rjv-type-undefined-color":`#569cd6`};function cd({value:e,defaultExpandLevel:t=1,className:n=``,maxHeight:r=`24rem`,showControls:i=!0}){let a=ld(e),[o,s]=(0,L.useState)(t),[c,l]=(0,L.useState)(0),u=(0,L.useCallback)(()=>{s(!1),l(e=>e+1)},[]),d=(0,L.useCallback)(()=>{s(t),l(e=>e+1)},[t]);return a?(0,R.jsxs)(`div`,{className:`min-w-0 max-w-full ${n}`,children:[i?(0,R.jsxs)(`div`,{className:`flex items-center gap-1 mb-1`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:u,className:`flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium text-slate-400 hover:text-slate-200 bg-slate-800/50 hover:bg-slate-700/60 rounded-sm transition-colors`,children:[(0,R.jsx)(Lo,{size:10}),`Expand`]}),(0,R.jsxs)(`button`,{type:`button`,onClick:d,className:`flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium text-slate-400 hover:text-slate-200 bg-slate-800/50 hover:bg-slate-700/60 rounded-sm transition-colors`,children:[(0,R.jsx)(Fo,{size:10}),`Collapse`]})]}):null,(0,R.jsx)(`div`,{className:`min-w-0 max-w-full overflow-auto rounded-sm text-xs`,style:{maxHeight:r},children:(0,R.jsx)(od,{value:a,style:{...sd,background:`transparent`,fontSize:`12px`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`},collapsed:o,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,shortenTextAfterLength:120},c)})]}):(0,R.jsx)(`pre`,{className:`max-w-full overflow-auto whitespace-pre-wrap break-words font-mono text-xs text-slate-300 ${n}`,style:{maxHeight:r},children:typeof e==`string`?e:JSON.stringify(e,null,2)})}function ld(e){if(typeof e==`object`&&e)return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return null;try{let e=JSON.parse(t);return typeof e==`object`&&e?e:null}catch{return null}}var ud={transcript:0,"event-log":1,live:2},dd={"user.message":0,"agent.turn":1,"model.reasoning":2,"tool.call":3,"agent.delegation":3,"agent.async":4,"tool.result":5,"execution.command":6,"yielded.run":7,"assistant.message":8,error:9};function fd(e,t,n){let r=e??2**53-1,i=t??2**53-1;return{sourceRank:ud.live,turnSeq:r,streamId:r,streamFrameIndex:i,phaseRank:dd[n]}}function pd(e){let[t,n]=e.split(`:`);if(t===void 0||n===void 0)return;let r=Number(t),i=Number(n);if(!(!Number.isInteger(r)||r<0)&&!(!Number.isInteger(i)||i<0))return{streamId:r,frameIndex:i}}function md(e,t){if(e)return{...e,contentPartIndex:(e.contentPartIndex??0)+.1,phaseRank:dd[t]}}function hd(e,t){return!e&&!t?0:e?t?e.turnSeq-t.turnSeq||(e.transcriptIndex??2**53-1)-(t.transcriptIndex??2**53-1)||(e.eventSequence??2**53-1)-(t.eventSequence??2**53-1)||(e.streamId??2**53-1)-(t.streamId??2**53-1)||(e.streamFrameIndex??2**53-1)-(t.streamFrameIndex??2**53-1)||(e.contentPartIndex??0)-(t.contentPartIndex??0)||e.phaseRank-t.phaseRank||e.sourceRank-t.sourceRank:-1:1}var gd=t(n(((e,t)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&`).replace(/</g,`<`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++n}),e.__id},clone:function e(t,n){n||={};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a||={};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code){i.hooks.run(`complete`,c),r&&r.call(c.element);return}if(i.hooks.run(`before-highlight`,c),!c.grammar){l(i.util.encode(c.code));return}if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`"`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof a)){var T=1,E;if(v){if(E=o(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof a)continue;for(var A=S;A!==t.tail&&(k<O||typeof A.value==`string`);A=A.next)T++,k+=A.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=o(x,0,w,_),!E)continue;var D=E.index,j=E[0],M=w.slice(0,D),N=w.slice(D+j.length),P=C+w.length;d&&P>d.reach&&(d.reach=P);var F=S.prev;M&&(F=l(t,F,M),C+=M.length),u(t,F,T);var ee=new a(f,g?i.tokenize(j,g):j,y,j);if(S=l(t,F,ee),N&&l(t,S,N),T>1){var te={cause:f+`,`+m,reach:P};s(e,t,n,S.prev,C,te),d&&te.reach>d.reach&&(d.reach=te.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside[`attr-value`].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside[`internal-subset`].inside=n.languages.markup,n.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&/,`&`))}),Object.defineProperty(n.languages.markup.tag,`addInlined`,{value:function(e,t){var r={};r[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var a={};a[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:i},n.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(n.languages.markup.tag,`addAttribute`,{value:function(e,t){n.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend(`markup`,{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend(`clike`,{"class-name":[n.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),n.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),n.languages.markup&&(n.languages.markup.tag.addInlined(`script`,`javascript`),n.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),n.languages.js=n.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}n.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),n.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=n.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
|
|
11
|
+
`),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),n.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;n.fileHighlight=function(){f||=(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))(),1);function _d(e){return typeof e==`object`&&!!e&&`languages`in e}var vd=globalThis,yd=_d(vd.Prism)?vd.Prism:gd.default;vd.Prism=yd,typeof window<`u`&&(window.Prism=yd);var bd=Object.defineProperty,xd=(e,t,n)=>t in e?bd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sd=(e,t,n)=>xd(e,typeof t==`symbol`?t:t+``,n),Cd=class e{constructor(e=new Map){this.map=e}clone(){return new e(new Map(this.map))}increment(e){let t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let n=this.map.get(e);n!==void 0&&(--n,this.map.set(e,n),n===0&&t())}},wd=class{constructor(){Sd(this,`map`,new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){let n=this.get(e);n!==void 0&&t(n)}delete(e){return this.map.delete(e)}};function Td(e,t){return t(e),e}function Ed(){}var Dd=`cell`;function Od(e,t){return e===t}var kd=new Map,Ad,jd=class{constructor(e={}){Sd(this,`subscriptions`,new wd),Sd(this,`singletonSubscriptions`,new Map),Sd(this,`graph`,new wd),Sd(this,`state`,new Map),Sd(this,`distinctNodes`,new Map),Sd(this,`executionMaps`,new Map),Sd(this,`definitionRegistry`,new Set),Sd(this,`combinedCells`,[]);for(let t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,n=Symbol()){return this.state.has(n)||this.state.set(n,e),t!==!1&&!this.distinctNodes.has(n)&&this.distinctNodes.set(n,t===!0?Od:t),n}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?Od:e),t}sub(e,t){this.register(e);let n=this.subscriptions.getOrCreate(e);return n.add(t),()=>n.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){let n=this.signalInstance();return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.sub(n,t)}pubIn(e){var t;let n=Reflect.ownKeys(e),r=this.getExecutionMap(n),i=r.refCount.clone(),a=r.participatingNodes.slice(),o=new Map(this.state),s=e=>{this.graph.use(e,t=>{for(let{sources:n,sink:r}of t)n.has(e)&&i.decrement(r,()=>{a.splice(a.indexOf(r),1),s(r)})})};for(;;){let n=a.shift();if(n===void 0)break;let i=n,c=!1,l=e=>{let t=this.distinctNodes.get(i);if(t!=null&&t(o.get(i),e)){c=!1;return}c=!0,o.set(i,e),this.state.has(i)&&this.state.set(i,e)};if(Object.prototype.hasOwnProperty.call(e,i)?l(e[i]):r.projections.use(i,e=>{for(let t of e){let e=[...Array.from(t.sources),...Array.from(t.pulls)].map(e=>o.get(e));t.map(l)(...e)}}),c){let e=o.get(i);this.inContext(()=>{this.subscriptions.use(i,t=>{for(let n of t)n(e)})}),(t=this.singletonSubscriptions.get(i))==null||t(e)}else s(i)}}connect({sources:e,pulls:t=[],map:n,sink:r}){let i={map:n,pulls:new Set(t),sink:this.register(r),sources:new Set(e)};for(let n of[...e,...t])this.register(n),this.graph.getOrCreate(n).add(i);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>Td(this.signalInstance(),n=>(this.link(this.pipe(n,...e),t),n))}link(e,t){this.connect({map:e=>t=>{e(t)},sink:t,sources:[e]})}combine(...e){return Td(this.signalInstance(),t=>{this.connect({map:e=>(...t)=>{e(t)},sink:t,sources:e})})}combineCells(...e){let t=this.combinedCells.find(t=>e.length===t.sources.length&&e.every((e,n)=>e===t.sources[n]));if(t)return t.cell;let n=this.cellInstance(e.map(e=>this.getValue(e)),!0);return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.combinedCells.push({sources:e,cell:n}),n}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(e=>this.getValue(e))}register(e){let t=kd.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),Td(t.type===Dd?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),e=>{this.inContext(()=>{t.init(this,e)})}))}inContext(e){let t=Ad;Ad=this;let n=e();return Ad=t,n}changeWith(e,t,n){this.connect({sources:[t],pulls:[e],sink:e,map:e=>(t,r)=>{e(n(r,t))}})}calculateExecutionMap(e){let t=[],n=new Set,r=new wd,i=new Cd,a=new wd,o=(e,s=0)=>{i.increment(e),!n.has(e)&&(this.register(e),r.use(e,e=>{s=Math.max(...Array.from(e).map(e=>t.indexOf(e)))+1}),this.graph.use(e,t=>{for(let n of t)n.sources.has(e)?(a.getOrCreate(n.sink).add(n),o(n.sink,s)):r.getOrCreate(n.sink).add(e)}),n.add(e),t.splice(s,0,e))};return e.forEach(o),{participatingNodes:t,pendingPulls:r,projections:a,refCount:i}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];let n=this.executionMaps.get(t);if(n!==void 0)return n}else for(let[t,n]of this.executionMaps.entries())if(Array.isArray(t)&&t.length===e.length&&t.every(t=>e.includes(t)))return n;let n=this.calculateExecutionMap(e);return this.executionMaps.set(t,n),n}combineOperators(...e){return t=>{for(let n of e)t=n(t,this);return t}}};function B(e,t=Ed,n=!0){return Td(Symbol(),r=>{kd.set(r,{type:Dd,distinct:n,initial:e,init:t})})}function Md(e=Ed,t=!1){return Td(Symbol(),n=>{kd.set(n,{type:`signal`,distinct:t,init:e})})}function Nd(e=Ed){return Td(Symbol(),t=>{kd.set(t,{type:`signal`,distinct:!1,init:e})})}var Pd=L.createContext(null);function Fd(){let e=L.useContext(Pd);if(e===null)throw Error(`useRealm must be used within a RealmContextProvider`);return e}function Id(e){let t=Fd();t.register(e);let n=L.useCallback(n=>t.sub(e,n),[t,e]);return L.useSyncExternalStore(n,()=>t.getValue(e),()=>t.getValue(e))}function Ld(...e){let t=Fd();return Id(L.useMemo(()=>t.combineCells.apply(t,e),[t,...e]))}function Rd(e){let t=Fd();return t.register(e),L.useCallback(n=>{t.pub(e,n)},[t,e])}function zd(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{t(e(n))},sink:r,sources:[t]}),r}}function Bd(...e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:e=>(...t)=>{e(t)},pulls:e,sink:r,sources:[t]}),r}}function Vd(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{e(n)&&t(n)},sink:r,sources:[t]}),r}}function Hd(e,t){return(n,r)=>{let i=r.signalInstance();return r.connect({map:n=>r=>{n(t=e(t,r))},sink:i,sources:[n]}),i}}function Ud(e,t){return t(e),e}function Wd(){}function Gd(e){return function(t){return{init:n=>e.init?.call(e,n,t),postInit:n=>e.postInit?.call(e,n,t),update:n=>e.update?.call(e,n,t)}}}function Kd({children:e,plugins:t}){let n=L.useMemo(()=>Ud(new jd,e=>{var n,r;for(let r of t)(n=r.init)==null||n.call(r,e);for(let n of t)(r=n.postInit)==null||r.call(n,e)}),[]);return L.useEffect(()=>{var e;for(let r of t)(e=r.update)==null||e.call(r,n)}),L.createElement(Pd.Provider,{value:n},e)}var qd=(0,L.createContext)(null);function Jd(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n==null?null:n.getTheme())}}}function Yd(){let e=(0,L.useContext)(qd);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function V(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Xd=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Zd=Xd&&`documentMode`in document?document.documentMode:null,Qd=Xd&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),$d=Xd&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ef=!(!Xd||!(`InputEvent`in window)||Zd)&&`getTargetRanges`in new window.InputEvent(`input`),tf=Xd&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),nf=Xd&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,rf=Xd&&/Android/.test(navigator.userAgent),af=Xd&&/^(?=.*Chrome).*/i.test(navigator.userAgent),of=Xd&&rf&&af,sf=Xd&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!af;function cf(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}var lf=1,uf=3,df=9,ff=11,pf=0,mf=1,hf=2,gf=0,_f=1,vf=2,yf=1,bf=2,xf=3,Sf=4,Cf=5,wf=6,Tf=tf||nf||sf?`\xA0`:``,Ef=`
|
|
12
|
+
|
|
13
|
+
`,Df=$d?`\xA0`:Tf,Of={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},kf={directionless:1,unmergeable:2},Af={center:bf,end:wf,justify:Sf,left:yf,right:xf,start:Cf},jf={[bf]:`center`,[wf]:`end`,[Sf]:`justify`,[yf]:`left`,[xf]:`right`,[Cf]:`start`},Mf={normal:0,segmented:2,token:1},Nf={[gf]:`normal`,[vf]:`segmented`,[_f]:`token`},Pf=`$config`;function Ff(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(G(o)&&Ff(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var If=100,Lf=!1,Rf=0;function zf(e){Rf=e.timeStamp}function Bf(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&T_(e,n)!==void 0}function Vf(e,t,n){let r=mv(sv(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&R_(t,o,i,a,!1)}function Hf(e,t,n){if(U(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return m_(t)&&n.isAttached()}function Uf(e,t,n,r){for(let i=e;i&&!Av(i);i=tv(i)){let e=T_(i,t);if(e!==void 0){let t=C_(e,n);if(t)return Lg(t)||!_v(i)?void 0:[i,t]}else if(i===r)return[r,A_(n)]}}function Wf(e,t,n){Lf=!0;let r=performance.now()-Rf>If;try{jg(e,(()=>{let i=W()||function(e){return e.getEditorState().read((()=>{let e=W();return e===null?null:e.clone()}))}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=Uf(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&H(g)&&m_(p)&&Hf(i,p,g)&&Vf(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=w_(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!Bf(r,a,e)){if($d){let e=(_v(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Bf(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Bf(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&j_(i),$d&&Q_(e)&&i.insertRawText(u))}))}finally{Lf=!1}}function Gf(e){let t=e._observer;t!==null&&Wf(e,t.takeRecords(),t)}function Kf(e){(function(e){Rf===0&&sv(e).addEventListener(`textInput`,zf,!0)})(e),e._observer=new MutationObserver(((t,n)=>{Wf(e,t,n)}))}function qf(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=Mv(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var Jf=class e{constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return Zf(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=Zf(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function Yf(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Jf(t,Xf(t));return t.__state=n,n}function Xf(e){return e.__state?e.__state.sharedNodeState:r_(wv(),e.getType()).sharedNodeState}function Zf(e){if(e)for(let t in e)return e}function Qf(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function $f(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function ep(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function tp(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;if(e&&t&&e.size!==t.size)return!1;let n=new Set;return!(e&&Qf(n,e,t)||t&&Qf(n,t,e)||e&&$f(n,e,t)||t&&$f(n,t,e))}(c,l))}function np(e,t){let n=e.mergeWithSibling(t),r=vg()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function rp(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&H(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(tp(t,r)){r=np(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&H(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(tp(r,n)){r=np(r,n);break}break}n.remove()}}else r.remove()}function ip(e){return ap(e.anchor),ap(e.focus),e}function ap(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),H(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!G(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp=``,_p=null,vp=``,yp=``,bp=!1,xp=!1;function Sp(e,t){let n=fp.get(e);if(t!==null){let n=zp(e);n.parentNode===t&&t.removeChild(n)}if(pp.has(e)||sp._keyToDOMMap.delete(e),G(n)){let e=Pp(n,fp);Cp(e,0,e.length-1,null)}n!==void 0&&Y_(hp,cp,lp,n,`destroyed`)}function Cp(e,t,n,r){let i=t;for(;i<=n;++i){let t=e[i];t!==void 0&&Sp(t,r)}}function wp(e,t){e.setProperty(`text-align`,t)}var Tp=`40px`;function Ep(e,t){let n=op.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}let r=getComputedStyle(e).getPropertyValue(`--lexical-indent-base-value`)||Tp;e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * ${r})`)}function Dp(e,t){let n=e.style;t===0?wp(n,``):t===yf?wp(n,`left`):t===bf?wp(n,`center`):t===xf?wp(n,`right`):t===Sf?wp(n,`justify`):t===Cf?wp(n,`start`):t===wf&&wp(n,`end`)}function Op(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(zg(e))return null;let n=e.getParentOrThrow();return zg(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function kp(e,t){let n=pp.get(e);n===void 0&&V(60);let r=n.createDOM(op,sp);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,sp),H(n)?r.setAttribute(`data-lexical-text`,`true`):Lg(n)&&r.setAttribute(`data-lexical-decorator`,`true`),G(n)){let e=n.__indent,t=n.__size;if(Op(r,n),e!==0&&Ep(r,e),t!==0){let e=t-1;Ap(Pp(n,pp),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&Dp(r,i),n.isInline()||Mp(null,n,r),$_(n)&&(gp+=Ef,yp+=Ef)}else{let t=n.getTextContent();if(Lg(n)){let t=n.decorate(sp,op);t!==null&&Ip(e,t),r.contentEditable=`false`}gp+=t,yp+=t}return t!==null&&t.insertChild(r),Y_(hp,cp,lp,n,`created`),r}function Ap(e,t,n,r,i){let a=gp;gp=``;let o=n;for(;o<=r;++o){kp(e[o],i);let t=pp.get(e[o]);t!==null&&H(t)&&(_p===null&&(_p=t.getFormat()),vp===``&&(vp=t.getStyle()))}$_(t)&&(gp+=Ef),i.element.__lexicalTextContent=gp,gp=a+gp}function jp(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return lh(e)?`line-break`:Lg(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function Mp(e,t,n){let r=jp(e,fp),i=jp(t,pp);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function Np(e,t,n){var r;_p=null,vp=``,function(e,t,n){let r=gp,i=e.__size,a=t.__size;gp=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)Fp(n,o);else{let e=zp(n),t=kp(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}Sp(n,null)}let i=pp.get(r);H(i)&&(_p===null&&(_p=i.getFormat()),vp===``&&(vp=i.getStyle()))}else{let r=Pp(e,fp),s=Pp(t,pp);if(r.length!==i&&V(227),s.length!==a&&V(228),i===0)a!==0&&Ap(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;Cp(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else (function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=Lp(Fp(r,a.element)),d++,f++;else{c===void 0&&(c=new Set(t)),l===void 0&&(l=new Set(n));let i=l.has(e),o=c.has(r);if(i)if(o){let e=ev(sp,r);e===u?u=Lp(Fp(r,a.element)):(a.withBefore(u).insertChild(e),Fp(r,a.element)),d++,f++}else kp(r,a.withBefore(u)),f++;else u=Lp(zp(e)),Sp(e,a.element),d++}let i=pp.get(r);i!==null&&H(i)&&(_p===null&&(_p=i.getFormat()),vp===``&&(vp=i.getStyle()))}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:sp.getElementByKey(t);Ap(n,e,f,s,a.withBefore(r))}else m&&!p&&Cp(t,d,o,a.element)})(t,r,s,i,a,n)}$_(t)&&(gp+=Ef),o.__lexicalTextContent=gp,gp=r+gp}(e,t,t.getDOMSlot(n)),r=t,_p==null||_p===r.__textFormat||xp||r.setTextFormat(_p),function(e){vp===``||vp===e.__textStyle||xp||e.setTextStyle(vp)}(t)}function Pp(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&V(101),n.push(r),r=e.__next}return n}function Fp(e,t){let n=fp.get(e),r=pp.get(e);n!==void 0&&r!==void 0||V(61);let i=bp||dp.has(e)||up.has(e),a=ev(sp,e);if(n===r&&!i){if(G(n)){let e=a.__lexicalTextContent;e!==void 0&&(gp+=e,yp+=e)}else{let e=n.getTextContent();yp+=e,gp+=e}return a}if(n!==r&&i&&Y_(hp,cp,lp,r,`updated`),r.updateDOM(n,a,op)){let n=kp(e,null);return t===null&&V(62),t.replaceChild(n,a),Sp(e,null),n}if(G(n)&&G(r)){let e=r.__indent;(bp||e!==n.__indent)&&Ep(a,e);let t=r.__format;if((bp||t!==n.__format)&&Dp(a,t),i&&(Np(n,r,a),zg(r)||r.isInline()||Mp(n,r,a)),$_(r)&&(gp+=Ef,yp+=Ef),(bp||r.__dir!==n.__dir)&&(Op(a,r),zg(r)&&!bp))for(let e of r.getChildren())G(e)&&Op(ev(sp,e.getKey()),e)}else{let t=r.getTextContent();if(Lg(r)){let t=r.decorate(sp,op);t!==null&&Ip(e,t)}gp+=t,yp+=t}if(!xp&&zg(r)&&r.__cachedText!==yp){let e=r.getWritable();e.__cachedText=yp,r=e}return a}function Ip(e,t){let n=sp._pendingDecorators,r=sp._decorators;if(n===null){if(r[e]===t)return;n=D_(sp)}n[e]=t}function Lp(e){let t=e.nextSibling;return t!==null&&t===sp._blockCursorElement&&(t=t.nextSibling),t}function Rp(e,t,n,r,i,a){gp=``,yp=``,bp=r===hf,sp=n,op=n._config,cp=n._nodes,lp=sp._listeners.mutation,up=i,dp=a,fp=e._nodeMap,pp=t._nodeMap,xp=t._readOnly,mp=new Map(n._keyToDOMMap);let o=new Map;return hp=o,Fp(`root`,null),sp=void 0,cp=void 0,up=void 0,dp=void 0,fp=void 0,pp=void 0,op=void 0,mp=void 0,hp=void 0,o}function zp(e){let t=mp.get(e);return t===void 0&&V(75,e),t}function Bp(e){return{type:e}}var Vp=Bp(`SELECTION_CHANGE_COMMAND`),Hp=Bp(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),Up=Bp(`CLICK_COMMAND`),Wp=Bp(`DELETE_CHARACTER_COMMAND`),Gp=Bp(`INSERT_LINE_BREAK_COMMAND`),Kp=Bp(`INSERT_PARAGRAPH_COMMAND`),qp=Bp(`CONTROLLED_TEXT_INSERTION_COMMAND`),Jp=Bp(`PASTE_COMMAND`),Yp=Bp(`REMOVE_TEXT_COMMAND`),Xp=Bp(`DELETE_WORD_COMMAND`),Zp=Bp(`DELETE_LINE_COMMAND`),Qp=Bp(`FORMAT_TEXT_COMMAND`),$p=Bp(`UNDO_COMMAND`),em=Bp(`REDO_COMMAND`),tm=Bp(`KEYDOWN_COMMAND`),nm=Bp(`KEY_ARROW_RIGHT_COMMAND`),eee=Bp(`MOVE_TO_END`),rm=Bp(`KEY_ARROW_LEFT_COMMAND`),im=Bp(`MOVE_TO_START`),am=Bp(`KEY_ARROW_UP_COMMAND`),om=Bp(`KEY_ARROW_DOWN_COMMAND`),sm=Bp(`KEY_ENTER_COMMAND`),cm=Bp(`KEY_SPACE_COMMAND`),lm=Bp(`KEY_BACKSPACE_COMMAND`),um=Bp(`KEY_ESCAPE_COMMAND`),dm=Bp(`KEY_DELETE_COMMAND`),fm=Bp(`KEY_TAB_COMMAND`),pm=Bp(`INSERT_TAB_COMMAND`),mm=Bp(`INDENT_CONTENT_COMMAND`),hm=Bp(`OUTDENT_CONTENT_COMMAND`),gm=Bp(`DROP_COMMAND`),tee=Bp(`FORMAT_ELEMENT_COMMAND`),_m=Bp(`DRAGSTART_COMMAND`),vm=Bp(`DRAGOVER_COMMAND`),ym=Bp(`DRAGEND_COMMAND`),bm=Bp(`COPY_COMMAND`),xm=Bp(`CUT_COMMAND`),Sm=Bp(`SELECT_ALL_COMMAND`),Cm=Bp(`CLEAR_EDITOR_COMMAND`),wm=Bp(`CLEAR_HISTORY_COMMAND`),Tm=Bp(`CAN_REDO_COMMAND`),Em=Bp(`CAN_UNDO_COMMAND`),Dm=Bp(`FOCUS_COMMAND`),Om=Bp(`BLUR_COMMAND`),nee=Bp(`KEY_MODIFIER_COMMAND`),km=Object.freeze({}),Am=30,jm=[[`keydown`,function(e,t){if(Mm=e.timeStamp,Nm=e.key,!t.isComposing()&&!K(t,tm,e)&&e.key!=null){if(Vm&&G_(e))return jg(t,(()=>{Zm(t,Hm)})),Vm=!1,void(Hm=``);if(function(e){return H_(e,`ArrowRight`,{shiftKey:`any`})}(e))K(t,nm,e);else if(function(e){return H_(e,`ArrowRight`,U_)}(e))K(t,eee,e);else if(function(e){return H_(e,`ArrowLeft`,{shiftKey:`any`})}(e))K(t,rm,e);else if(function(e){return H_(e,`ArrowLeft`,U_)}(e))K(t,im,e);else if(function(e){return H_(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))K(t,am,e);else if(function(e){return H_(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))K(t,om,e);else if(function(e){return H_(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))zm=!0,K(t,sm,e);else if(function(e){return e.key===` `}(e))K(t,cm,e);else if(function(e){return Qd&&H_(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),zm=!0,K(t,Gp,!0);else if(function(e){return H_(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))zm=!1,K(t,sm,e);else if(function(e){return H_(e,`Backspace`,{shiftKey:`any`})||Qd&&H_(e,`h`,{ctrlKey:!0})}(e))G_(e)?K(t,lm,e):(e.preventDefault(),K(t,Wp,!0));else if(function(e){return e.key===`Escape`}(e))K(t,um,e);else if(function(e){return H_(e,`Delete`,{})||Qd&&H_(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?K(t,dm,e):(e.preventDefault(),K(t,Wp,!1));else if(function(e){return H_(e,`Backspace`,W_)}(e))e.preventDefault(),K(t,Xp,!0);else if(function(e){return H_(e,`Delete`,W_)}(e))e.preventDefault(),K(t,Xp,!1);else if(function(e){return Qd&&H_(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),K(t,Zp,!0);else if(function(e){return Qd&&(H_(e,`Delete`,{metaKey:!0})||H_(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),K(t,Zp,!1);else if(function(e){return H_(e,`b`,U_)}(e))e.preventDefault(),K(t,Qp,`bold`);else if(function(e){return H_(e,`u`,U_)}(e))e.preventDefault(),K(t,Qp,`underline`);else if(function(e){return H_(e,`i`,U_)}(e))e.preventDefault(),K(t,Qp,`italic`);else if(function(e){return H_(e,`Tab`,{shiftKey:`any`})}(e))K(t,fm,e);else if(function(e){return H_(e,`z`,U_)}(e))e.preventDefault(),K(t,$p,void 0);else if(function(e){return Qd?H_(e,`z`,{metaKey:!0,shiftKey:!0}):H_(e,`y`,{ctrlKey:!0})||H_(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),K(t,em,void 0);else{let n=t._editorState._selection;n===null||U(n)?K_(e)&&(e.preventDefault(),K(t,Sm,e)):function(e){return H_(e,`c`,U_)}(e)?(e.preventDefault(),K(t,bm,e)):function(e){return H_(e,`x`,U_)}(e)?(e.preventDefault(),K(t,xm,e)):K_(e)&&(e.preventDefault(),K(t,Sm,e))}(function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey})(e)&&K(t,nee,e)}}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;vv(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&jg(t,(()=>{o_(n)||(Rm=!0)}))}],[`compositionstart`,function(e,t){jg(t,(()=>{let n=W();if(U(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();x_(r.key),(e.timeStamp<Mm+Am||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||H(i)&&i.getStyle()!==n.style)&&K(t,qp,Df)}}))}],[`compositionend`,function(e,t){$d?Bm=!0:nf||!tf&&!sf?jg(t,(()=>{Zm(t,e.data)})):(Vm=!0,Hm=e.data)}],[`input`,function(e,t){e.stopPropagation(),jg(t,(()=>{if(_v(e.target)&&o_(e.target))return;let n=W(),r=e.data,i=Xm(e);if(r!=null&&U(n)&&Gm(n,i,r,e.timeStamp,!1)){Bm&&=(Zm(t,r),!1);let i=n.anchor.getNode(),a=mv(sv(t));if(a===null)return;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,c=o?n.focus.offset:n.anchor.offset;ef&&!n.isCollapsed()&&H(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===I_(a.anchorNode)||K(t,qp,r);let l=r.length;$d&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),tf||nf||sf||!t.isComposing()||(Mm=0,x_(null))}else L_(!1,t,r===null?void 0:r),Bm&&=(Zm(t,r||void 0),!1);(function(){hg(),Gf(vg())})()}),{event:e}),Fm=null}],[`click`,function(e,t){jg(t,(()=>{let n=W(),r=mv(sv(t)),i=Zh();if(r){if(U(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!zg(a)&&k_().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=function(e,t){let n=e;for(;n!==k_()&&n!=null;){if(t(n))return n;n=n.getParent()}return null}(a,(e=>G(e)&&!e.isInline()));G(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(_v(n)||m_(n))&&j_(Xh(i,r,t,e))}}K(t,Up,e)}))}],[`cut`,km],[`copy`,km],[`dragstart`,km],[`dragover`,km],[`dragend`,km],[`paste`,km],[`focus`,km],[`blur`,km],[`drop`,km]];ef&&jm.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType,r=Xm(e);n===`deleteCompositionText`||$d&&Q_(t)||n!==`insertCompositionText`&&jg(t,(()=>{let i=W();if(n===`deleteContentBackward`){if(i===null){let e=Zh();if(!U(e))return;j_(e.clone())}if(U(i)){let n=i.anchor.key===i.focus.key;if(a=e.timeStamp,Nm===`MediaLast`&&a<Mm+Am&&t.isComposing()&&n){if(x_(null),Mm=0,setTimeout((()=>{jg(t,(()=>{x_(null)}))}),Am),U(i)){let e=i.anchor.getNode();e.markDirty(),H(e)||V(142),Ym(i,e)}}else{x_(null),e.preventDefault();let r=i.anchor.getNode(),a=r.getTextContent(),o=r.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=of&&n&&!s&&o;if(c&&i.isCollapsed()&&(c=!Lg(Z_(i.anchor,!0))),!c){K(t,Wp,!0);let e=W();of&&U(e)&&e.isCollapsed()&&(Um=e,setTimeout((()=>Um=null)))}}return}}var a;if(!U(i))return;let o=e.data;Fm!==null&&L_(!1,t,Fm),i.dirty&&Fm===null||!i.isCollapsed()||zg(i.anchor.getNode())||r===null||i.applyDOMRange(r),Fm=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(n!==`insertText`&&n!==`insertTranspose`)switch(e.preventDefault(),n){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:K(t,qp,e);break;case`insertFromComposition`:x_(null),K(t,qp,e);break;case`insertLineBreak`:x_(null),K(t,Gp,!1);break;case`insertParagraph`:x_(null),zm&&!nf?(zm=!1,K(t,Gp,!1)):K(t,Kp,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:K(t,Jp,e);break;case`deleteByComposition`:(function(e,t){return e!==t||G(e)||G(t)||!f_(e)||!f_(t)})(l,u)&&K(t,Yp,e);break;case`deleteByDrag`:case`deleteByCut`:K(t,Yp,e);break;case`deleteContent`:K(t,Wp,!1);break;case`deleteWordBackward`:K(t,Xp,!0);break;case`deleteWordForward`:K(t,Xp,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:K(t,Zp,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:K(t,Zp,!1);break;case`formatStrikeThrough`:K(t,Qp,`strikethrough`);break;case`formatBold`:K(t,Qp,`bold`);break;case`formatItalic`:K(t,Qp,`italic`);break;case`formatUnderline`:K(t,Qp,`underline`);break;case`historyUndo`:K(t,$p,void 0);break;case`historyRedo`:K(t,em,void 0)}else{if(o===`
|
|
14
|
+
`)e.preventDefault(),K(t,Gp,!1);else if(o===Ef)e.preventDefault(),K(t,Kp,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&Gm(i,r,o,e.timeStamp,!0)?(e.preventDefault(),K(t,qp,o)):Fm=o;Pm=e.timeStamp}}))}(e,t)]);var Mm=0,Nm=null,Pm=0,Fm=null,Im=new WeakMap,Lm=!1,Rm=!1,zm=!1,Bm=!1,Vm=!1,Hm=``,Um=null,Wm=[0,``,0,`root`,0];function Gm(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=vg(),l=mv(sv(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!H(s)||(!i&&(!ef||Pm<r+50)||s.isDirty()&&p<2||N_(n))&&a.offset!==o.offset&&!s.isComposing()||p_(s)||s.isDirty()&&p>1||(i||!ef)&&f!==null&&!s.isComposing()&&u!==h_(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||s.getFormat()!==e.format||s.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=f_(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(H(t)||G(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function Km(e,t){return m_(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function qm(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;Lm&&(Lm=!1,Km(r,i)&&Km(a,o)&&!Um)||jg(t,(()=>{if(!n)return void j_(null);if(!c_(t,r,a))return;let s=W();if(Um&&U(s)&&s.isCollapsed()){let e=s.anchor,t=Um.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=Um.clone(),j_(s))}if(Um=null,U(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=sv(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=Wm,f=k_(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)Jm(s,o,c);else if(n.type===`text`)H(r)||V(141),Ym(s,r);else if(n.type===`element`&&!p){G(r)||V(259);let e=n.getNode();e.isEmpty()?function(e,t){Jm(e,t.getTextFormat(),t.getTextStyle())}(s,e):Jm(s,0,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(H(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}K(t,Vp,void 0)}))}function Jm(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Ym(e,t){Jm(e,t.getFormat(),t.getStyle())}function Xm(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function Zm(e,t){let n=e._compositionKey;if(x_(null),n!==null&&t!=null){if(t===``){let t=C_(n),r=h_(e.getElementByKey(n));r!==null&&r.nodeValue!==null&&H(t)&&R_(t,r.nodeValue,null,null,!0);return}if(t[t.length-1]===`
|
|
15
|
+
`){let t=W();if(U(t)){let n=t.focus;t.anchor.set(n.key,n.offset,n.type),K(e,sm,null);return}}}L_(!0,e,t)}function Qm(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var $m=new Map;function eh(e){let t=hv(e.target);if(t===null)return;let n=u_(t.anchorNode);if(n===null)return;Rm&&(Rm=!1,jg(n,(()=>{let r=Zh(),i=t.anchorNode;(_v(i)||m_(i))&&j_(Xh(r,t,n,e))})));let r=P_(n),i=r[r.length-1],a=i._key,o=$m.get(a),s=o||i;s!==n&&qm(t,s,!1),qm(t,n,!0),n===i?o&&$m.delete(a):$m.set(a,n)}function th(e){e._lexicalHandled=!0}function nh(e){return!0===e._lexicalHandled}function rh(e){let t=e.ownerDocument,n=Im.get(t);if(n===void 0)return;let r=n-1;r>=0||V(164),Im.set(t,r),r===0&&t.removeEventListener(`selectionchange`,eh);let i=d_(e);l_(i)?(function(e){if(e._parentEditor!==null){let t=P_(e),n=t[t.length-1]._key;$m.get(n)===e&&$m.delete(n)}else $m.delete(e._key)}(i),e.__lexicalEditor=null):i&&V(198);let a=Qm(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}function ih(e,t,n){hg();let r=e.__key,i=e.getParent();if(i===null)return;let a=function(e){let t=W();if(!U(t)||!G(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return av(i,e)&&n.set(e.__key,0,`element`),av(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(U(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(eg(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(eg(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Lh(a)&&t&&e.isSelected()&&e.selectPrevious();if(U(a)&&t&&!o){let t=e.getIndexWithinParent();y_(e),Qh(a,i,t,-1)}else y_(e);n||cv(i)||i.canBeEmpty()||!i.isEmpty()||ih(i,t),t&&a&&zg(i)&&i.isEmpty()&&i.selectEnd()}function ah(e){return e}var oh=class{static getType(){let{ownNodeType:e}=Mv(this);return e===void 0&&V(64,this.name),e}static clone(e){V(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,`__state`,{configurable:!0,enumerable:!1,value:void 0,writable:!0}),v_(this,e)}getType(){return this.__type}isInline(){V(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=C_(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||W();if(t==null)return!1;let n=t.getNodes().some((e=>e.__key===this.__key));if(H(this))return n;if(U(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(Lg(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:C_(e)}getParentOrThrow(){let e=this.getParent();return e===null&&V(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(cv(t))return G(e)||e===this&&Lg(e)||V(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&V(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:C_(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:C_(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=G(this)?this:this.getParent(),n=G(e)?e:e.getParent(),r=t&&n?dy(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=dy(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?cy(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&V(279),!1)))}isParentOf(e){let t=dy(this,e);return t!==null&&t.type===`ancestor`}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=G(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&V(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=vg()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){let e=C_(this.__key);return e===null&&V(113),e}getWritable(){hg();let e=_g(),t=vg(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=W();if(o!==null&&o.setCachedNodes(null),a.has(r))return b_(i),i;let s=Ov(i);return a.add(r),b_(s),n.set(r,s),s}getTextContent(){return``}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){V(70)}updateDOM(e,t,n){V(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){V(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of Xf(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&Yf(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){ih(this,!0,e)}replace(e,t){hg();let n=W();n!==null&&(n=n.clone()),uv(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size;y_(o);let l=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,f=r.__next,p=r.__parent;if(ih(r,!1,!0),l===null?s.__first=a:l.getWritable().__next=a,o.__prev=d,u===null?s.__last=a:u.getWritable().__prev=a,o.__next=f,o.__parent=p,s.__size=c,t&&(G(this)&&G(o)||V(139),this.getChildren().forEach((e=>{o.append(e)}))),U(n)){j_(n);let e=n.anchor,t=n.focus;e.key===i&&Ph(e,o),t.key===i&&Ph(t,o)}return S_()===i&&x_(a),o}insertAfter(e,t=!0){hg(),uv(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.getParent(),a=W(),o=!1,s=!1;if(i!==null){let t=e.getIndexWithinParent();if(y_(r),U(a)){let e=i.__key,n=a.anchor,r=a.focus;o=n.type===`element`&&n.key===e&&n.offset===t+1,s=r.type===`element`&&r.key===e&&r.offset===t+1}}let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&U(a)){let e=this.getIndexWithinParent();Qh(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){hg(),uv(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;y_(r);let a=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),s=n.__prev,c=this.getIndexWithinParent();a===null?o.__first=i:a.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=s,r.__next=n.__key,r.__parent=n.__parent;let l=W();return t&&U(l)&&Qh(l,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Yg()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){hg();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(n===null)return r.select(0,0);if(G(n))return n.select();if(!H(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){hg();let n=this.getNextSibling(),r=this.getParentOrThrow();if(n===null)return r.select();if(G(n))return n.select(0,0);if(!H(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}},sh=class e extends oh{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
16
|
+
`}createDOM(){return document.createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){let t=e.parentElement;if(t!==null&&xv(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&uh(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&uh(n))return!0}}return!1}(e)||function(e){let t=e.parentElement;if(t!==null&&xv(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&uh(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&uh(r))return!0}return!1}(e)?null:{conversion:ree,priority:0}}}static importJSON(e){return ch().updateFromJSON(e)}};function ree(e){return{node:ch()}}function ch(){return lv(new sh)}function lh(e){return e instanceof sh}function uh(e){return m_(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function dh(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function fh(e,t){return 1&t?`strong`:2&t?`em`:`span`}function ph(e,t,n,r,i){let a=r.classList,o=J_(i,`base`);o!==void 0&&a.add(...o),o=J_(i,`underlineStrikethrough`);let s=!1,c=t&8&&t&4;o!==void 0&&(n&8&&n&4?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in Of){let r=Of[e];if(o=J_(i,e),o!==void 0)if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}t&r&&(!c||e!==`underline`)&&e!==`strikethrough`||a.add(...o)}else t&r&&a.remove(...o)}}function mh(e,t,n){let r=t.firstChild,i=n.isComposing(),a=e+(i?Tf:``);if(r==null)t.textContent=a;else{let e=r.nodeValue;if(e!==a)if(i||$d){let[t,n,i]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(e,a);n!==0&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=a}}function hh(e,t,n,r,i,a){mh(i,e,t);let o=a.theme.text;o!==void 0&&ph(0,0,r,e,o)}function gh(e,t){let n=document.createElement(t);return n.appendChild(e),n}var _h=class e extends oh{static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return Nf[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===S_()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Of[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return g_(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=dh(0,n),i=fh(0,n),a=r===null?i:r,o=document.createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=document.createElement(i),o.appendChild(s)),hh(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&(o.style.cssText=c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=dh(0,i),s=dh(0,a),c=fh(0,i),l=fh(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??V(48);let i=document.createElement(l);return hh(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??V(49)),mh(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&ph(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:Sh,priority:0}),b:()=>({conversion:yh,priority:0}),code:()=>({conversion:Th,priority:0}),em:()=>({conversion:Th,priority:0}),i:()=>({conversion:Th,priority:0}),mark:()=>({conversion:Th,priority:0}),s:()=>({conversion:Th,priority:0}),span:()=>({conversion:vh,priority:0}),strong:()=>({conversion:Th,priority:0}),sub:()=>({conversion:Th,priority:0}),sup:()=>({conversion:Th,priority:0}),u:()=>({conversion:Th,priority:0})}}static importJSON(e){return Eh().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return _v(t)||V(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=gh(t,`b`)),this.hasFormat(`italic`)&&(t=gh(t,`i`)),this.hasFormat(`strikethrough`)&&(t=gh(t,`s`)),this.hasFormat(`underline`)&&(t=gh(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?Of[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?kf[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=g_(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=Mf[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){hg();let n=e,r=t,i=W(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!U(i))return qh(o,n,o,r,`text`,`text`);{let e=S_();e!==i.anchor.key&&e!==i.focus.key||x_(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=W();if(r&&U(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){hg();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=S_(),a=n.length;e.sort(((e,t)=>e-t)),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=W();if(U(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=Eh(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=ep(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=Eh(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=ep(t,n);let a=n.__key;i===r&&x_(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&b_(t),n!==null&&b_(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),U(v)&&Qh(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||V(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;S_()===r&&x_(n);let o=W();if(U(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&tg(i,t,n,e,a),s!==null&&s.key===r&&tg(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function vh(e){return{forChild:Dh(e.style),node:null}}function yh(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Dh(t.style,n?void 0:`bold`),node:null}}var bh=new WeakMap;function xh(e){if(!_v(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Sh(e){let t=e;e.parentElement===null&&V(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=bh.get(n))===void 0&&!xh(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)bh.set(r[e],i);return i}(t)!==null){let e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){let r=e[n];r===`
|
|
17
|
+
`||r===`\r
|
|
18
|
+
`?t.push(ch()):r===` `?t.push(kh()):r!==``&&t.push(Eh(r))}return{node:t}}if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=Ch(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Ch(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:Eh(n)}}function Ch(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,_v(n)){let e=n.style.display;if(e===``&&!bv(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(m_(n))return n;if(n.nodeName===`BR`)return null}}var wh={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Th(e){let t=wh[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Dh(e.style,t),node:null}}function Eh(e=``){return lv(new _h(e))}function H(e){return e instanceof _h}function Dh(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>H(e)?(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}var Oh=class e extends _h{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=J_(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return kh().updateFromJSON(e)}setTextContent(e){return e!==` `&&e!==``&&V(126),super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||V(286),this}setDetail(e){return e!==2&&V(127),this}setMode(e){return e!==`normal`&&V(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function kh(){return lv(new Oh)}function Ah(e){return e instanceof Oh}var jh=class{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:sy(by(fy(this,`next`)),by(fy(e,`next`)))<0}getNode(){let e=C_(this.key);return e===null&&V(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,mg()||(S_()===a&&x_(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}};function Mh(e,t,n){return new jh(e,t,n)}function Nh(e,t){let n=t.__key,r=e.offset,i=`element`;if(H(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!G(t)){let e=t.getNextSibling();if(H(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Ph(e,t){if(G(t)){let n=t.getLastDescendant();G(n)||H(n)?Nh(e,n):Nh(e,t)}else Nh(e,t)}var Fh=class e{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Lh(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),n=t.length,r=t[n-1],i;if(H(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=C_(e);t!==null&&n.push(t)}return mg()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((W()||Zh())===this&&e[0]){let t=Jv(e[0],`next`);my(ay(t,t))}for(let t of e)t.remove()}};function U(e){return e instanceof Ih}var Ih=class e{constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!U(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(Wv(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;G(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),Uv(e.focus)&&G(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=Qv(e.focus.origin,`previous`);Wv(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=ey(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!G(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=by(e.anchor),r=by(e.anchor.getFlipped()),i=e=>Hv(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Cy(gy(this),`next`));return mg()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`)}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=zh(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if(G(d)&&!d.isInline())l||(c+=`
|
|
19
|
+
`),l=!d.isEmpty();else if(l=!1,H(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else !Lg(d)&&!lh(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=vg(),n=t.getEditorState()._selection,r=Gh(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),ip(this)}clone(){let t=this.anchor,n=this.focus;return new e(Mh(t.key,t.offset,t.type),Mh(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=g_(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=Of[e];return!!(this.format&t)}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];r===`
|
|
20
|
+
`||r===`\r
|
|
21
|
+
`?n.push(ch()):r===` `?n.push(kh()):n.push(Eh(r))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=Eh();if(o.setFormat(n),o.setStyle(r),Xg(a))a.splice(0,0,[o]);else{let e=zg(i)?Yg().append(o):o;a===null?i.append(e):a.insertBefore(e)}e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&py(o,by(fy(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];H(d)||V(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(p_(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling();if(H(t)&&t.canInsertTextBefore()&&!p_(t)||(t=Eh(),t.setFormat(r),t.setStyle(i),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(p_(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling();if(H(t)&&!p_(t)||(t=Eh(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f){let e=Eh(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||G(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),Wh(this.anchor,this.focus,null),void this.insertText(e)}if(u===1){if(f_(d)){let t=Eh(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(Ah(d)){let t=Eh(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=Eh(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=G(d)?d:d.getParentOrThrow(),r=G(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c)if(H(m)&&!f_(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=Eh(m.getTextContent());m.replace(e),m=e}zg(o.getNode())||o.type!==`text`||(m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||G(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(f_(d))if(s===f)d.select();else{let t=Eh(e);t.select(),d.replace(t)}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():d.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length);for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=W()===this;hy(this,cee(gy(this))),e&&W()!==this&&j_(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void x_(null);let n=this.getNodes(),r=[];for(let e of n)H(e)&&r.push(e);let i=t=>{n.forEach((n=>{if(G(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}}))},a=r.length;if(a===0)return this.toggleFormat(e),x_(null),void i(t);let o=this.anchor,s=this.focus,c=this.isBackward(),l=c?s:o,u=c?o:s,d=0,f=r[0],p=l.type===`element`?0:l.offset;if(l.type===`text`&&p===f.getTextContentSize()&&(d=1,f=r[1],p=0),f==null)return;let m=f.getFormatFlags(e,t);i(m);let h=a-1,g=r[h],_=u.type===`text`?u.offset:g.getTextContentSize();if(f.is(g)){if(p===_)return;if(p_(f)||p===0&&_===f.getTextContentSize())f.setFormat(m);else{let e=f.splitText(p,_),t=p===0?e[0]:e[1];t.setFormat(m),l.type===`text`&&l.set(t.__key,0,`text`),u.type===`text`&&u.set(t.__key,_-p,`text`)}this.format=m;return}p===0||p_(f)||([,f]=f.splitText(p),p=0),f.setFormat(m);let v=g.getFormatFlags(e,m);_>0&&(_===g.getTextContentSize()||p_(g)||([g]=g.splitText(_)),g.setFormat(v));for(let t=d+1;t<h;t++){let n=r[t],i=n.getFormatFlags(e,v);n.setFormat(i)}l.type===`text`&&l.set(f.__key,p,`text`),u.type===`text`&&u.set(g.__key,_,`text`),this.format=m|v}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key===`root`){this.insertParagraph();let t=W();return U(t)||V(134),t.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),n=Cv(t,Sv),r=e[e.length-1];if(G(n)&&`__language`in n){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=ag(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some((e=>(G(e)||Lg(e))&&!e.isInline()))){G(n)||V(211,t.constructor.name,t.getType());let i=ag(this);n.splice(i,0,e),r.selectEnd();return}let i=function(e){let t=Yg(),n=null;for(let r=0;r<e.length;r++){let i=e[r],a=lh(i);if(a||Lg(i)&&i.isInline()||G(i)&&i.isInline()||H(i)||i.isParentRequired()){if(n===null&&(n=i.createParentElementNode(),t.append(n),a))continue;n!==null&&n.append(i)}else t.append(i),n=null}return t}(e),a=i.getLastDescendant(),o=i.getChildren(),s=!G(n)||!n.isEmpty()?this.insertParagraph():null,c=o[o.length-1],l=o[0];var u;G(u=l)&&Sv(u)&&!u.isEmpty()&&G(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(G(n)||V(211,t.constructor.name,t.getType()),n.append(...l.getChildren()),l=o[1]),l&&(n===null&&V(212,t.constructor.name,t.getType()),function(e,t,n){let r=t.getParentOrThrow().getLastChild(),i=t,a=[t];for(;i!==r;)i.getNextSibling()||V(140),i=i.getNextSibling(),a.push(i);let o=e;for(let e of a)o=o.insertAfter(e)}(n,l));let d=Cv(a,Sv);s&&G(d)&&(s.canMergeWhenEmpty()||Sv(c))&&(d.append(...s.getChildren()),s.remove()),G(n)&&n.isEmpty()&&n.remove(),a.selectEnd();let f=G(n)?n.getLastChild():null;lh(f)&&d!==n&&f.remove()}insertParagraph(){if(this.anchor.key===`root`){let e=Yg();return k_().splice(this.anchor.offset,0,[e]),e.select(),e}let e=ag(this),t=Cv(this.anchor.getNode(),Sv);G(t)||V(213);let n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){let t=ch();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,i=this.focus,a=e[0],o=e[n],[s,c]=zh(this);if(t===0)return[];if(t===1){if(H(a)&&!this.isCollapsed()){let e=s>c?c:s,t=s>c?s:c,n=a.splitText(e,t),r=e===0?n[0]:n[1];return r==null?[]:[r]}return[a]}let l=r.isBefore(i);if(H(a)){let t=l?s:c;t===a.getTextContentSize()?e.shift():t!==0&&([,a]=a.splitText(t),e[0]=a)}if(H(o)){let t=o.getTextContent().length,r=l?c:s;r===0?e.pop():r!==t&&([o]=o.splitText(r),e[n]=o)}return e}modify(e,t,n){if(sg(this,e,t,n))return;let r=e===`move`,i=vg(),a=mv(sv(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();if(s===null||o===null||!G(c)||c.isInline()||c.canBeEmpty()||pv(o,i,s),this.dirty){let e=ev(i,this.anchor.key),t=ev(i,this.focus.key);this.anchor.type===`text`&&(e=h_(e)),this.focus.type===`text`&&(t=h_(t)),e&&t&&ng(a,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=a.getRangeAt(0),n=this.anchor.getNode(),i=zg(n)?n:oee(n);if(this.applyDOMRange(e),this.dirty=!0,!r){let n=this.getNodes(),r=[],o=!1;for(let e=0;e<n.length;e++){let t=n[e];av(t,i)?r.push(t):o=!0}if(o&&r.length>0)if(t){let e=r[0];G(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=r[r.length-1];G(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}a.anchorNode===e.startContainer&&a.anchorOffset===e.startOffset||function(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}(this)}}n===`lineboundary`&&sg(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&G(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(G(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=ry(fy(t,e?`previous`:`next`));if(r.getTextSlices().every((e=>e===null||e.distance===0))){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(Wv(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(G(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=by(t);hy(this,ay(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(Uv(t)){if(G(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(Lg(t.origin)){if(!t.origin.isIsolated())if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&G(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=Yh();e.add(t.origin.getKey()),j_(e)}else t.origin.remove();return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return hy(this,ay(!t.origin.isEmpty()&&n.isEmpty()?_y(Jv(n,t.direction)):r.anchor,t)),this.removeText()}}let i=this.focus;if(this.modify(`extend`,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&Bh(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void Vh(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void Vh(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!(N_(e)||iee(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&zg(e.getParent())&&e.getPreviousSibling()===null&&Bh(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify(`extend`,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify(`extend`,e,`word`)}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Lh(e){return e instanceof Fh}function Rh(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function zh(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[Rh(n),Rh(r)]}function Bh(e,t){for(let n=t;n;n=n.getParent()){if(G(n)){if(n.collapseAtStart(e))return!0;if(cv(n))break}if(n.getPreviousSibling())break}return!1}var iee=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function Vh(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Hh(e,t,n,r){let i,a=t;if(_v(e)){let o=!1,s=e.childNodes,c=s.length,l=r._blockCursorElement;a===c&&(o=!0,a=c-1);let u=s[a],d=!1;if(u===l)u=s[a+1],d=!0;else if(l!==null){let n=l.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,l)&&a--}if(i=M_(u),H(i))a=Xv(i,o?`next`:`previous`);else{let s=M_(e);if(s===null)return null;if(G(s)){let c=r.getElementByKey(s.getKey());c===null&&V(214);let l=s.getDOMSlot(c);[s,a]=l.resolveChildIndex(s,c,e,t),G(s)||V(215),o&&a>=s.getChildrenSize()&&(a=Math.max(0,s.getChildrenSize()-1));let u=s.getChildAtIndex(a);if(G(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=o?u.getLastDescendant():u.getFirstDescendant();e===null?s=u:(u=e,s=G(u)?u:u.getParentOrThrow()),a=0}H(u)?(i=u,s=null,a=Xv(u,o?`next`:`previous`)):u!==s&&o&&!d&&(G(s)||V(216),a=Math.min(s.getChildrenSize(),a+1))}else{let n=s.getIndexWithinParent();a=t===0&&Lg(s)&&M_(e)===s?n:n+1,s=s.getParentOrThrow()}if(G(s))return Mh(s.__key,a,`element`)}}else i=M_(e);return H(i)?Mh(i.__key,Xv(i,a,`clamp`),`text`):null}function Uh(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&G(a)&&a.isInline()){let t=a.getPreviousSibling();H(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else G(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):H(r)&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&G(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&G(a)&&a.isInline()&&!a.canInsertTextAfter()){let t=a.getNextSibling();H(t)&&e.set(t.__key,0,`text`)}}}function Wh(e,t,n){if(e.type===`text`&&t.type===`text`){let r=e.isBefore(t),i=e.is(t);Uh(e,r,i),Uh(t,!r,i),i&&t.set(e.key,e.offset,e.type);let a=vg();if(a.isComposing()&&a._compositionKey!==e.key&&U(n)){let r=n.anchor,i=n.focus;e.set(r.key,r.offset,r.type,!0),t.set(i.key,i.offset,i.type,!0)}}}function Gh(e,t,n,r,i,a){if(e===null||n===null||!c_(i,e,n))return null;let o=Hh(e,t,U(a)?a.anchor:null,i);if(o===null)return null;let s=Hh(n,r,U(a)?a.focus:null,i);if(s===null)return null;if(o.type===`element`&&s.type===`element`){let t=M_(e),r=M_(n);if(Lg(t)&&Lg(r))return null}return Wh(o,s,a),[o,s]}function Kh(e){return G(e)&&!e.isInline()}function qh(e,t,n,r,i,a){let o=_g(),s=new Ih(Mh(e,t,i),Mh(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Jh(){return new Ih(Mh(`root`,0,`element`),Mh(`root`,0,`element`),0,``)}function Yh(){return new Fh(new Set)}function Xh(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!Lf&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(U(e)&&!c)return e.clone();if(t===null)return null;if(l=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,s&&U(e)&&!c_(n,l,u))return e.clone();let p=Gh(l,d,u,f,n,e);if(p===null)return null;let[m,h]=p;return new Ih(m,h,U(e)?e.format:0,U(e)?e.style:``)}function W(){return _g()._selection}function Zh(){return vg()._editorState._selection}function Qh(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),$h(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}$h(e)}function $h(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!G(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(H(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}}else{if(G(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(H(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if(G(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(H(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}}function eg(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,H(i)?s=`text`:G(i)&&(s=`element`)):(a=r.__key,H(r)?(o=r.getTextContentSize(),s=`text`):G(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function tg(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function ng(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function rg(e,t,n,r,i,a,o){let s=r.anchorNode,c=r.focusNode,l=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(`collaboration`)&&d!==a||d!==null&&s_(d))return;if(!U(t))return void(e!==null&&c_(n,s,c)&&r.removeAllRanges());let f=t.anchor,p=t.focus,m=f.key,h=p.key,g=ev(n,m),_=ev(n,h),v=f.offset,y=p.offset,b=t.format,x=t.style,S=t.isCollapsed(),C=g,w=_,T=!1;if(f.type===`text`){C=h_(g);let e=f.getNode();T=e.getFormat()!==b||e.getStyle()!==x}else U(e)&&e.anchor.type===`text`&&(T=!0);var E,D,O,k,A;if((p.type===`text`&&(w=h_(_)),C!==null&&w!==null)&&(S&&(e===null||T||U(e)&&(e.format!==b||e.style!==x))&&(E=b,D=x,O=v,k=m,A=performance.now(),Wm=[E,D,O,k,A]),l!==v||u!==y||s!==C||c!==w||r.type===`Range`&&S||(d!==null&&a.contains(d)||a.focus({preventScroll:!0}),f.type===`element`))){if(ng(r,C,v,w,y),!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let e=U(t)&&t.anchor.type===`element`?C.childNodes[v]||null:r.rangeCount>0?r.getRangeAt(0):null;if(e!==null){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=nv(n),i=ov(r);if(r===null||i===null)return;let{top:a,bottom:o}=t,s=0,c=0,l=n;for(;l!==null;){let t=l===r.body;if(t)s=0,c=sv(e).innerHeight;else{let e=l.getBoundingClientRect();s=e.top,c=e.bottom}let n=0;if(a<s?n=-(s-a):o>c&&(n=o-c),n!==0)if(t)i.scrollBy(0,n);else{let e=l.scrollTop;l.scrollTop+=n;let t=l.scrollTop-e;a-=t,o-=t}if(t)break;l=tv(l)}})(n,t,a)}}Lm=!0}}function ig(e){let t=W()||Zh();t===null&&(t=k_().selectEnd()),t.insertNodes(e)}function ag(e){let t=e;e.isCollapsed()||t.removeText();let n=W();U(n)&&(t=n),U(t)||V(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!Sv(i);){let e=i;if([i,a]=og(i,a),e.is(i))break}return a}function og(e,t){let n=e.getParent();if(!n){let e=Yg();return k_().append(e),e.select(),[k_(),0]}if(H(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!G(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new Ih(Mh(e.__key,t,`element`),Mh(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function sg(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=fy(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!xy(c)){for(let e of c){l=!1;let{origin:t}=e;if(!Lg(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of ry(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(Wv(e))e.origin.isInline()||(c=e);else{if(G(e.origin))continue;Lg(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&Lg(c.origin)&&c.origin.isKeyboardSelectable()){let e=Yh();return e.add(c.origin.getKey()),j_(e),!0}return c=by(c),s&&py(e.anchor,c),py(e.focus,c),l||!o}var cg=null,lg=null,ug=!1,dg=!1,fg=0,pg={characterData:!0,childList:!0,subtree:!0};function mg(){return ug||cg!==null&&cg._readOnly}function hg(){ug&&V(13)}function gg(){fg>99&&V(14)}function _g(){return cg===null&&V(195,yg()),cg}function vg(){return lg===null&&V(196,yg()),lg}function yg(){let e=0,t=new Set,n=$g.version;if(typeof window<`u`)for(let r of document.querySelectorAll(`[contenteditable]`)){let i=d_(r);if(l_(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function bg(){return lg}function xg(e,t,n){let r=t.__type,i=r_(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function Sg(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Cg(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function wg(e){return Tg(e,vg()._nodes)}function Tg(e,t){let n=e.type,r=t.get(n);r===void 0&&V(17,n);let i=r.klass;e.type!==i.getType()&&V(18,i.name);let a=i.importJSON(e),o=e.children;if(G(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Tg(o[e],t);a.append(n)}return a}function Eg(e,t,n){let r=cg,i=ug,a=lg;cg=t,ug=!0,lg=e;try{return n()}finally{cg=r,ug=i,lg=a}}function Dg(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return;let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==pf,l=cg,u=ug,d=lg,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){lg=e,cg=n,ug=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=Rp(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),dg)throw t;Zg(e,null,r,n),Kf(e),e._dirtyType=hf,dg=!0,Dg(e,a),dg=!1;return}finally{p.observe(r,pg),e._updating=f,cg=l,ug=u,lg=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags,y=e._deferred;c&&(e._dirtyType=pf,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=D_(e)),delete r[a])}(e,n);let b=i?null:mv(sv(e));if(e._editable&&b!==null&&(c||s===null||s.dirty)&&r!==null&&!v.has(`skip-dom-selection`)){lg=e,cg=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&pv(t,e,r),rg(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(U(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(document.activeElement)){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())fv(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&fv(t)){let n=t.getPreviousSibling();(n===null||fv(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=e.getElementByKey(a.__key);r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=document.createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=cf(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&pv(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,pg),lg=d,cg=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),U(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(Vp,void 0);let x=e._pendingDecorators;x!==null&&(e._decorators=x,e._pendingDecorators=null,Og(`decorator`,e,!0,x)),function(e,t,n){let r=O_(t),i=O_(n);r!==i&&Og(`textcontent`,e,!0,i)}(e,t||a,n),Og(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),function(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){let t=e._updates;if(t.length!==0){let n=t.shift();if(n){let[t,r]=n;Ag(e,t,r)}}}(e)}function Og(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=i}}function kg(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&V(191),a._flushSync=!0),o&&e._deferred.push(o),Cg(e,i.tag)),a==null?Ag(e,n,i):n()}}return r}function Ag(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,Cg(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=Bg(c||s),l=!0),c._flushSync=o;let u=cg,d=ug,f=lg,p=e._updating;cg=c,ug=!1,e._updating=!0,lg=e;let m=e._headless||e.getRootElement()===null;t_(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=mv(sv(e));return U(n)||n==null?Xh(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=kg(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(U(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==pf&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);H(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&rp(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=S_(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);H(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&rp(r),r!==void 0&&Sg(r,a)&&xg(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){fg++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&Sg(c,a)&&xg(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,fg++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),kg(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(G(t)&&Ff(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of o)a.delete(e);for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(i.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(U(i)){let e=c._nodeMap,t=i.anchor.key,n=i.focus.key;e.get(t)!==void 0&&e.get(n)!==void 0||V(19)}else Lh(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=hf,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),Dg(e);return}finally{cg=u,ug=d,lg=f,e._updating=p,fg=0}e._dirtyType!==pf||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,Dg(e)):l&&a_((()=>{Dg(e)})):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function jg(e,t,n){lg===e&&n===void 0?t():Ag(e,t,n)}var Mg=class e{constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&V(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&V(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&V(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(nf||tf);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=document.createElement(`br`);if(n.insertBefore(i,r),e){let e=document.createElement(`img`);e.setAttribute(`data-lexical-linebreak`,`true`),e.style.cssText=`display: inline !important; border: 0px !important; margin: 0px !important;`,e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let i=Ng(t,n);i.push(r);let a=Ng(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function Ng(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&V(225),n.reverse()}var Pg=class extends oh{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return jf[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=vg()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(H(t)&&e.push(t),G(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;G(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;G(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return G(e)&&e.getLastDescendant()||e||null}let r=t[e];return G(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:C_(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&V(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:C_(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&V(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=``,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),G(i)&&r!==n-1&&!i.isInline()&&(e+=Ef)}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),G(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=Af[e];return!!(this.getFormat()&t)}return!1}hasTextFormat(e){let t=Of[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return g_(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){hg();let n=W(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(H(e)||G(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(H(e)||G(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return U(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):qh(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e===``?0:Af[e],this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){let r=n.length,i=this.getChildrenSize(),a=this.getWritable();e+t<=i||V(226,String(e),String(t),String(i));let o=a.__key,s=[],c=[],l=this.getChildAtIndex(e+t),u=null,d=i-t+r;if(e!==0)if(e===i)u=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(u=t.getPreviousSibling())}if(t>0){let e=u===null?this.getFirstChild():u.getNextSibling();for(let n=0;n<t;n++){e===null&&V(100);let t=e.getNextSibling(),n=e.__key;y_(e.getWritable()),c.push(n),e=t}}let f=u;for(let e=0;e<r;e++){let t=n[e];f!==null&&t.is(f)&&(u=f=f.getPreviousSibling());let r=t.getWritable();r.__parent===o&&d--,y_(r);let i=t.__key;if(f===null)a.__first=i,r.__prev=null;else{let e=f.getWritable();e.__next=i,r.__prev=e.__key}t.__key===o&&V(76),r.__parent=o,s.push(i),f=t}if(e+t===i)f!==null&&(f.getWritable().__next=null,a.__last=f.__key);else if(l!==null){let e=l.getWritable();if(f!==null){let t=f.getWritable();e.__prev=f.__key,t.__next=l.__key}else e.__prev=null}if(a.__size=d,c.length){let e=W();if(U(e)){let t=new Set(c),n=new Set(s),{anchor:r,focus:i}=e;Fg(r,t,n)&&eg(r,r.getNode(),this,u,l),Fg(i,t,n)&&eg(i,i.getNode(),this,u,l),d!==0||this.canBeEmpty()||cv(this)||this.remove()}}return a}getDOMSlot(e){return new Mg(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(_v(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function G(e){return e instanceof Pg}function Fg(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var Ig=class extends oh{decorate(e,t){V(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Lg(e){return e instanceof Ig}var Rg=class e extends Pg{static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){V(51)}getTextContent(){let e=this.__cachedText;return!mg()&&vg()._dirtyType!==pf||e===null?super.getTextContent():e}remove(){V(52)}replace(e){V(53)}insertBefore(e){V(54)}insertAfter(e){V(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)G(e)||Lg(e)||V(282);return super.splice(e,t,n)}static importJSON(e){return k_().updateFromJSON(e)}collapseAtStart(){return!0}};function zg(e){return e instanceof Rg}function Bg(e){return new Ug(new Map(e._nodeMap))}function Vg(){return new Ug(new Map([[`root`,new Rg]]))}function Hg(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&V(130,n.name),G(e)){let r=t.children;Array.isArray(r)||V(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=Hg(i[e]);r.push(t)}}return t}var Ug=class e{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Eg(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Eg(null,this,(()=>({root:Hg(k_())})))}},Wg=`history-push`,Gg=`history-merge`,Kg=class extends Pg{static getType(){return`artificial`}createDOM(e){return document.createElement(`div`)}},qg=class e extends Pg{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`p`),n=J_(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Jg,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(_v(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return Yg().updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(e,t){let n=Yg();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||H(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function Jg(e){let t=Yg();return e.style&&(t.setFormat(e.style.textAlign),kv(e,t)),{node:t}}function Yg(){return lv(new qg)}function Xg(e){return e instanceof qg}function Zg(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=Vg(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=pf,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=``),n!==null&&(n.textContent=``,i.set(`root`,n))}function Qg(e){let t=e||{},n=bg(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=Vg(),s=t.namespace||(i===null?F_():i._config.namespace),c=t.editorState,l=[Rg,_h,sh,Oh,qg,Kg,...t.nodes||[]],{onError:u,html:d}=t,f=t.editable===void 0||t.editable,p;if(e===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let e=0;e<l.length;e++){let t=l[e],n=null,r=null;if(typeof t!=`function`){let e=t;t=e.replace,n=e.with,r=e.withKlass||null}let{ownNodeConfig:i}=Mv(t),a=t.getType(),o=t.transform(),s=new Set;i&&i.$transform&&s.add(i.$transform),o!==null&&s.add(o),p.set(a,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:qf(l[e]),transforms:s})}}let m=new $g(o,i,p,{disableEvents:a,namespace:s,theme:r},u||console.error,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)})),t&&i(t),n}(p,d?d.import:void 0),f,e);return c!==void 0&&(m._pendingEditorState=c,m._dirtyType=hf),m}var $g=class{constructor(e,t,n,r,i,a,o,s){this._createEditorArgs=s,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=pf,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=F_(),this._onError=i,this._htmlConversions=a,this._editable=o,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){n===void 0&&V(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let i=r.get(e);i===void 0&&V(36,String(e));let a=i[n];return a.add(t),()=>{a.delete(t),i.every((e=>e.size===0))&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&V(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=Dv(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=Dv(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update((()=>{for(let e of r)for(let t of e.keys()){let e=C_(t);e&&e.markDirty()}}),e._pendingEditorState===null?{tag:Gg}:void 0)}(this,r.map((e=>e.klass.getType()))),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return K(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=J_(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Zg(this,t,e,r),t!==null&&(this._config.disableEvents||rh(t),n!=null&&t.classList.remove(...n)),e!==null){let t=ov(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=hf,Kf(this),this._updateTags.add(Gg),Dg(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument,r=Im.get(n);(r===void 0||r<1)&&n.addEventListener(`selectionchange`,eh),Im.set(n,(r||0)+1),e.__lexicalEditor=t;let i=Qm(e);for(let n=0;n<jm.length;n++){let[r,a]=jm[n],o=typeof a==`function`?e=>{nh(e)||(th(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(nh(e))return;th(e);let n=t.isEditable();switch(r){case`cut`:return n&&K(t,xm,e);case`copy`:return K(t,bm,e);case`paste`:return n&&K(t,Jp,e);case`dragstart`:return n&&K(t,_m,e);case`dragover`:return n&&K(t,vm,e);case`dragend`:return n&&K(t,ym,e);case`focus`:return n&&K(t,Dm,e);case`blur`:return n&&K(t,Om,e);case`drop`:return n&&K(t,gm,e)}};e.addEventListener(r,o),i.push((()=>{e.removeEventListener(r,o)}))}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Gg),Dg(this);Og(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&V(38);let n=e;n._readOnly&&(n=Bg(e),n._selection=e._selection?e._selection.clone():null),Gf(this);let r=this._pendingEditorState,i=this._updateTags,a=t===void 0?null:t.tag;r===null||r.isEmpty()||(a!=null&&i.add(a),Dg(this)),this._pendingEditorState=n,this._dirtyType=hf,this._dirtyElements.set(`root`,!1),this._compositionKey=null,a!=null&&i.add(a),this._updating||Dg(this)}parseEditorState(e,t){return function(e,t,n){let r=Vg(),i=cg,a=ug,o=lg,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,cg=r,ug=!1,lg=t,t_(null);try{let i=t._nodes;Tg(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,cg=i,ug=a,lg=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(e){return Dg(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):Ag(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),jg(this,(()=>{let r=W(),i=k_();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||j_(r.clone()),rv(`focus`),iv((()=>{n.removeAttribute(`autocapitalize`),e&&e()}))})),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=mv(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Og(`editable`,this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};$g.version=`0.35.0+prod.esm`;var e_=null;function t_(e){e_=e}var n_=1;function r_(e,t){let n=i_(e,t);return n===void 0&&V(30,t),n}function i_(e,t){return e._nodes.get(t)}var a_=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function o_(e){return Lg(E_(e))}function s_(e){let t=document.activeElement;if(!_v(t))return!1;let n=t.nodeName;return Lg(E_(e))&&(n===`INPUT`||n===`TEXTAREA`||t.contentEditable===`true`&&d_(t)==null)}function c_(e,t,n){let r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!s_(t)&&u_(t)===e}catch{return!1}}function l_(e){return e instanceof $g}function u_(e){let t=e;for(;t!=null;){let e=d_(t);if(l_(e))return e;t=tv(t)}return null}function d_(e){return e?e.__lexicalEditor:null}function f_(e){return Ah(e)||e.isToken()}function p_(e){return f_(e)||e.isSegmented()}function m_(e){return vv(e)&&e.nodeType===uf}function aee(e){return vv(e)&&e.nodeType===df}function h_(e){let t=e;for(;t!=null;){if(m_(t))return t;t=t.firstChild}return null}function g_(e,t,n){let r=Of[t];if(n!==null&&(e&r)==(n&r))return e;let i=e^r;return t===`subscript`?i&=~Of.superscript:t===`superscript`?i&=~Of.subscript:t===`lowercase`?(i&=~Of.uppercase,i&=~Of.capitalize):t===`uppercase`?(i&=~Of.lowercase,i&=~Of.capitalize):t===`capitalize`&&(i&=~Of.lowercase,i&=~Of.uppercase),i}function __(e){return H(e)||lh(e)||Lg(e)}function v_(e,t){let n=function(){let e=e_;return e_=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);hg(),gg();let r=vg(),i=_g(),a=``+ n_++;i._nodeMap.set(a,e),G(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType=mf,e.__key=a}function y_(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function b_(e){gg();let t=e.getLatest(),n=t.__parent,r=_g(),i=vg(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent}}(n,a,o);let s=t.__key;i._dirtyType=mf,G(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function x_(e){hg();let t=vg(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=C_(n);e!==null&&e.getWritable()}if(e!==null){let t=C_(e);t!==null&&t.getWritable()}}}function S_(){return mg()?null:vg()._compositionKey}function C_(e,t){let n=(t||_g())._nodeMap.get(e);return n===void 0?null:n}function w_(e,t){let n=T_(e,vg());return n===void 0?null:C_(n,t)}function T_(e,t){return e[`__lexicalKey_${t._key}`]}function E_(e,t){let n=e;for(;n!=null;){let e=w_(n,t);if(e!==null)return e;n=tv(n)}return null}function D_(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function O_(e){return e.read((()=>k_().getTextContent()))}function k_(){return A_(_g())}function A_(e){return e._nodeMap.get(`root`)}function j_(e){hg();let t=_g();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function M_(e){let t=vg(),n=function(e,t){let n=e;for(;n!=null;){let e=T_(n,t);if(e!==void 0)return e;n=tv(n)}return null}(e,t);return n===null?e===t.getRootElement()?C_(`root`):null:C_(n)}function N_(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function P_(e){let t=[],n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function F_(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function I_(e){return m_(e)?e.nodeValue:null}function L_(e,t,n){let r=mv(sv(t));if(r===null)return;let i=r.anchorNode,{anchorOffset:a,focusOffset:o}=r;if(i!==null){let t=I_(i),r=E_(i);if(t!==null&&H(r)){if(t===Tf&&n){let e=n.length;t=n,a=e,o=e}t!==null&&R_(r,t,a,o,e)}}}function R_(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=t;(o||i)&&t[t.length-1]===Tf&&(s=t.slice(0,-1));let c=a.getTextContent();if(i||s!==c){if(s===``){if(x_(null),tf||nf||sf)a.remove();else{let e=vg();setTimeout((()=>{e.update((()=>{a.isAttached()&&a.remove()}))}),20)}return}let t=a.getParent(),i=Zh(),c=a.getTextContentSize(),l=S_(),u=a.getKey();if(a.isToken()||l!==null&&u===l&&!o||U(i)&&(t!==null&&!t.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===e.__key&&i.anchor.offset===0&&!a.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===c&&!a.canInsertTextAfter()&&!o))return void a.markDirty();let d=W();if(!U(d)||n===null||r===null)return void z_(a,s,d);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=Eh(a.getTextContent());a.replace(e),a=e}z_(a,s,d)}}}function z_(e,t,n){if(e.setTextContent(t),U(n)){let t=e.getKey();for(let r of[`anchor`,`focus`]){let i=n[r];i.type===`text`&&i.key===t&&(i.offset=Xv(e,i.offset,`clamp`))}}}function B_(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function V_(e,t){return B_(e,t,`altKey`)&&B_(e,t,`ctrlKey`)&&B_(e,t,`shiftKey`)&&B_(e,t,`metaKey`)}function H_(e,t,n){return V_(e,n)&&e.key.toLowerCase()===t.toLowerCase()}var U_={ctrlKey:!Qd,metaKey:Qd},W_={altKey:Qd,ctrlKey:!Qd};function G_(e){return e.key===`Backspace`}function K_(e){return H_(e,`a`,U_)}function q_(e){let t=k_();if(U(e)){let t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),ip(e),e}{let e=t.select(0,t.getChildrenSize());return j_(ip(e)),e}}function J_(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=cf(i);return n[t]=e,e}return i}function Y_(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&V(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function X_(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function Z_(e,t){let n=e.offset;if(e.type===`element`)return X_(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?X_(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function Q_(e){let t=sv(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function K(e,t,n){return function(e,t,n){let r=P_(e);for(let i=4;i>=0;i--)for(let a=0;a<r.length;a++){let o=r[a],s=o._commands.get(t);if(s!==void 0){let t=s[i];if(t!==void 0){let r=Array.from(t),i=r.length,a=!1;if(jg(o,(()=>{for(let t=0;t<i;t++)if(r[t](n,e))return void(a=!0)})),a)return a}}}return!1}(e,t,n)}function $_(e){return!zg(e)&&!e.isLastChild()&&!e.isInline()}function ev(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&V(75,t),n}function tv(e){let t=e.assignedSlot||e.parentElement;return yv(t)?t.host:t}function nv(e){return aee(e)?e:_v(e)?e.ownerDocument:null}function rv(e){hg(),vg()._updateTags.add(e)}function iv(e){hg(),vg()._deferred.push(e)}function av(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function ov(e){let t=nv(e);return t?t.defaultView:null}function sv(e){let t=e._window;return t===null&&V(78),t}function oee(e){let t=e.getParentOrThrow();for(;t!==null;){if(cv(t))return t;t=t.getParentOrThrow()}return t}function cv(e){return zg(e)||G(e)&&e.isShadowRoot()}function see(e){let t=e.constructor.clone(e);return v_(t,null),t.afterCloneFrom(e),t}function lv(e){let t=vg(),n=e.getType(),r=i_(t,n);r===void 0&&V(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||V(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||V(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&V(203,e.constructor.name,n,r.name,r.getType()),t}return e}function uv(e,t){!zg(e.getParent())||G(t)||Lg(t)||V(99)}function dv(e){let t=C_(e);return t===null&&V(63,e),t}function fv(e){return(Lg(e)||G(e)&&!e.canBeEmpty())&&!e.isInline()}function pv(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function mv(e){return Xd?(e||window).getSelection():null}function hv(e){let t=ov(e);return t?t.getSelection():null}function gv(e){return _v(e)&&e.tagName===`A`}function _v(e){return vv(e)&&e.nodeType===lf}function vv(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function yv(e){return vv(e)&&e.nodeType===ff}function bv(e){let t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,`i`);return e.nodeName.match(t)!==null}function xv(e){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,`i`);return e.nodeName.match(t)!==null}function Sv(e){if(Lg(e)&&!e.isInline())return!0;if(!G(e)||cv(e))return!1;let t=e.getFirstChild(),n=t===null||lh(t)||H(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Cv(e,t){let n=e;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function wv(){return vg()}var Tv=new WeakMap,Ev=new Map;function Dv(e){if(!e._readOnly&&e.isEmpty())return Ev;e._readOnly||V(192);let t=Tv.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),Tv.set(e,t)),t}function Ov(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function kv(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Av(e){return!0===e.__lexicalUnmanaged}function jv(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==oh[t]}function Mv(e){let t=Pf in e.prototype?e.prototype[Pf]():void 0,n=function(e){return e===Ig||e===Pg||e===oh}(e),r=!n&&jv(e,`getType`)?e.getType():void 0,i,a=r;if(t)if(r)i=t[r];else for(let[e,n]of Object.entries(t))a=e,i=n;if(!n&&a&&(jv(e,`getType`)||(e.getType=()=>a),jv(e,`clone`)||(e.clone=t=>(t_(t),new e)),jv(e,`importJSON`)||(e.importJSON=i&&i.$importJSON||(t=>new e().updateFromJSON(t))),!jv(e,`importDOM`)&&i)){let{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:a}}function Nv(e){let t=wv();return hg(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var Pv={next:`previous`,previous:`next`},Fv=class{constructor(e){this.origin=e}[Symbol.iterator](){return oy({hasNext:Uv,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Jv(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Jv(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&V(263,Array.from(o).join(` `))}else i.insert(e);i=Jv(e,this.direction)}for(let e of o.values())e.remove();return this}},Iv=class e extends Fv{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Qv(e,this.direction)}getParentCaret(e=`root`){return Jv(zv(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Rv(this.direction);return Jv(this.getNodeAtCaret(),e)||Qv(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Lv={root:zg,shadowRoot:cv};function Rv(e){return Pv[e]}function zv(e,t=`root`){return Lv[t](e)?null:e}var Bv=class e extends Fv{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Jv(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return G(this.origin)?Qv(this.origin,this.direction):null}getParentCaret(e=`root`){return Jv(zv(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Rv(this.direction);return Jv(this.getNodeAtCaret(),e)||Qv(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Vv)&&this.direction===t.direction&&this.origin.is(t.origin)}},Vv=class e extends Fv{type=`text`;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Yv(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return Jv(zv(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Yv(this.origin,Rv(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Bv||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Jv(this.origin,this.direction)}};function Hv(e){return e instanceof Vv}function Uv(e){return e instanceof Bv}function Wv(e){return e instanceof Iv}var Gv={next:class extends Vv{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Vv{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Kv={next:class extends Bv{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Bv{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},qv={next:class extends Iv{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Iv{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Jv(e,t){return e?new Kv[t](e):null}function Yv(e,t,n){return e?new Gv[t](e,Xv(e,n)):null}function Xv(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function Zv(e,t){return new ny(e,t)}function Qv(e,t){return G(e)?new qv[t](e):null}function $v(e){return e&&e.getChildCaret()||e}function ey(e){return e&&$v(e.getAdjacentCaret())}var ty=class e{type=`node-caret-range`;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return Hv(t)?function(e,t){let{direction:n,origin:r}=e;return Zv(e,Xv(r,t===`focus`?Rv(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[Zv(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=Hv(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Hv(n),i=t=>t.isSameNodeCaret(n)?null:ey(t)||t.getParentCaret(e);return oy({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},ny=class{type=`slice`;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return Yv(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function ry(e){return ay(e,Jv(k_(),e.direction))}function iy(e){return ay(e,e)}function ay(e,t){return e.direction!==t.direction&&V(265),new ty(e,t,e.direction)}function oy(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function sy(e,t){let n=dy(e.origin,t.origin);switch(n===null&&V(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return cy(n)}}function cy(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function ly(e,t){return t.is(e)}function uy(e){return G(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function dy(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=uy(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=uy(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(ly(e,r)||V(276),{commonAncestor:r,type:`ancestor`}):i===null?(ly(t,r)||V(277),{commonAncestor:r,type:`descendant`}):((G(a)||ly(e,a))&&(G(i)||ly(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||V(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function fy(e,t){let{type:n,key:r,offset:i}=e,a=dv(e.key);return n===`text`?(H(a)||V(266,a.getType(),r),Yv(a,t,i)):(G(a)||V(267,a.getType(),r),lee(a,e.offset,t))}function py(e,t){let{origin:n,direction:r}=t,i=r===`next`;Hv(t)?e.set(n.getKey(),t.offset,`text`):Uv(t)?H(n)?e.set(n.getKey(),Xv(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(Wv(t)&&G(n)||V(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function my(e){let t=W(),n=U(t)?t:Jh();return hy(n,e),j_(n),n}function hy(e,t){py(e.anchor,t.anchor),py(e.focus,t.focus)}function gy(e){let{anchor:t,focus:n}=e,r=fy(t,`next`),i=fy(n,`next`),a=sy(r,i)<=0?`next`:`previous`;return ay(Sy(r,a),Sy(i,a))}function _y(e){let{direction:t,origin:n}=e,r=Jv(n,Rv(t)).getNodeAtCaret();return r?Jv(r,t):Qv(n.getParentOrThrow(),t)}function vy(e,t=`root`){let n=[e];for(let r=Wv(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(_y(r));return n}function yy(e){return!!e&&e.origin.isAttached()}function cee(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Cy(e,r),o=vy(a.anchor,n),s=vy(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(Wv(e))c.add(e.origin.getKey());else if(Uv(e)){let{origin:t}=e;G(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=_y(Jv(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=Eh(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=Yv(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(yy(e)){u=by(e);break}for(let e of s)if(yy(e)){d=by(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c;for(c=0;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(cv(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,Sv),d=u&&l(o,(e=>n.has(e.getKey())&&Sv(e)));return u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;Qv(e,`previous`).splice(0,t.getChildren()),t.remove()}let p=[u,d,...o,...s].find(yy);if(p)return iy(Sy(by(p),e.direction));V(269,JSON.stringify(o.map((e=>e.origin.__key))))}function by(e){let t=function(e){let t=e;for(;Wv(t);){let e=ey(t);if(!Wv(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(H(t.origin))return Hv(t)?t:Yv(t.origin,n,n);let r=t.getAdjacentCaret();return Uv(r)&&H(r.origin)?Yv(r.origin,n,Rv(n)):t}function xy(e){return Hv(e)&&e.offset!==Xv(e.origin,e.direction)}function Sy(e,t){return e.direction===t?e:e.getFlipped()}function Cy(e,t){return e.direction===t?e:ay(Sy(e.focus,t),Sy(e.anchor,t))}function lee(e,t,n){let r=Qv(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return Sy(r,n)}function uee(e){let{origin:t,offset:n,direction:r}=e;if(n===Xv(t,r))return e.getSiblingCaret();if(n===Xv(t,Rv(r)))return _y(e.getSiblingCaret());let[i]=t.splitText(n);return H(i)||V(281),Sy(Jv(i,`next`),r)}function wy(e,t){return!0}function Ty(e,{$copyElementNode:t=see,$splitTextPointCaretNext:n=uee,rootMode:r=`shadowRoot`,$shouldSplit:i=wy}={}){if(Hv(e))return n(e);let a=e.getParentCaret(r);if(a){let{origin:n}=a;if(Wv(e)&&(!n.canBeEmpty()||!i(n,`first`)))return _y(a);let r=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||n.canBeEmpty()&&i(n,`last`))&&a.insert(t(n).splice(0,0,r))}return a}function Ey(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Dy=new Map;function Oy(e){let t={};if(!e)return t;let n=e.split(`;`);for(let e of n)if(e!==``){let[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function ky(e){let t=Dy.get(e);return t===void 0&&(t=Oy(e),Dy.set(e,t)),t}function Ay(e){let t=wv().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function jy(e){return Ay(zg(e)?e:e.getParentOrThrow())}function My(e){let t=jy(e);return t!==null&&t.direction===`rtl`}function Ny(e,t){let n=e.getStartEndPoints();if(t.isSelected(e)&&!p_(t)&&n!==null){let[r,i]=n,a=e.isBackward(),o=r.getNode(),s=i.getNode(),c=t.is(o),l=t.is(s);if(c||l){let[n,r]=zh(e),i=o.is(s),c=t.is(a?s:o),l=t.is(a?o:s),u,d=0;i?(d=n>r?r:n,u=n>r?n:r):c?(d=a?r:n,u=void 0):l&&(d=0,u=a?n:r),t.__text=t.__text.slice(d,u)}}return t}function Py(e){if(e.type===`text`)return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return G(t)||Ey(177),e.offset===t.getChildrenSize()}function Fy(e){let t=e.getStyle(),n=Oy(t);Dy.set(t,n)}function Iy(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function Ly(e,t,n=Iy){if(e===null)return;let r=e.getStartEndPoints(),i=new Map,a=null;if(r){let[e,t]=r;a=Jh(),a.anchor.set(e.key,e.offset,e.type),a.focus.set(t.key,t.offset,t.type);let n=Wy(e.getNode(),Sv),o=Wy(t.getNode(),Sv);G(n)&&i.set(n.getKey(),n),G(o)&&i.set(o.getKey(),o)}for(let t of e.getNodes())if(G(t)&&Sv(t))i.set(t.getKey(),t);else if(r===null){let e=Wy(t,Sv);G(e)&&i.set(e.getKey(),e)}for(let[e,r]of i){let i=t();n(r,i),r.replace(i,!0),a&&(e===a.anchor.key&&a.anchor.set(i.getKey(),a.anchor.offset,a.anchor.type),e===a.focus.key&&a.focus.set(i.getKey(),a.focus.offset,a.focus.type))}a&&e.is(W())&&j_(a)}function Ry(e){let t=zy(e);return t!==null&&t.writingMode===`vertical-rl`}function zy(e){let t=e.anchor.getNode();return G(t)?Ay(t):jy(t)}function By(e,t){let n=Ry(e)?!t:t;Hy(e)&&(n=!n);let r=fy(e.focus,n?`previous`:`next`);if(xy(r))return!1;for(let e of ry(r)){if(Wv(e))return!e.origin.isInline();if(!G(e.origin)){if(Lg(e.origin))return!0;break}}return!1}function Vy(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function Hy(e){let t=zy(e);return t!==null&&t.direction===`rtl`}function Uy(e,t,n){let r=Hy(e),i;i=Ry(e)||r?!n:n,Vy(e,t,i,`character`)}function Wy(e,t){let n=e;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function Gy(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Ky=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,qy=Ky&&`documentMode`in document?document.documentMode:null;Ky&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);var Jy=Ky&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!Ky||!(`InputEvent`in window)||qy)&&`getTargetRanges`in new window.InputEvent(`input`),Ky&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Ky&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,Ky&&/Android/.test(navigator.userAgent),Ky&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ky&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function Yy(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function Xy(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}var Zy=Ky,Qy=Jy;function $y(e,...t){let n=Yy(...t);n.length>0&&e.classList.add(...n)}function eb(e,...t){let n=Yy(...t);n.length>0&&e.classList.remove(...n)}function dee(e){return e?e.getAdjacentCaret():null}function tb(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function nb(e){let t=rb(e,(e=>G(e)&&!e.isInline()));return G(t)||Gy(4,e.__key),t}var rb=(e,t)=>{let n=e;for(;n!==k_()&&n!=null;){if(t(n))return n;n=n.getParent()}return null};function ib(e){let t=W()||Zh(),n;if(U(t))n=fy(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=Jv(r,`next`))}n||=Qv(k_(),`previous`).getFlipped().insert(Yg())}let r=ab(e,n),i=ey(r);return my(iy(Wv(i)?by(i):r)),e.getLatest()}function ab(e,t,n){let r=Sy(t,`next`);for(let e=r;e;e=Ty(e,n))r=e;return Hv(r)&&Gy(283),r.insert(e.isInline()?Yg().append(e):e),Sy(Jv(e.getLatest(),`next`),t.direction)}function ob(e,t){let n=t();return e.replace(n),n.append(e),n}function sb(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function cb(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r]);i!==null&&n.push(i)}return n}var lb=!(Qy||!Zy)&&void 0;function ub(e){let t=1;if(function(){if(lb===void 0){let e=document.createElement(`div`);e.style.cssText=`position: absolute; opacity: 0; width: 100px; left: -1000px;`,document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty(`zoom`,`2`),lb=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return lb}())for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue(`zoom`)),e=e.parentElement;return t}var db=0,fb=1,pb=2,mb=0,hb=1,gb=2,_b=3,vb=4;function yb(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return mb;let a=t._selection,o=e._selection;if(i)return hb;if(!(U(a)&&U(o)&&o.isCollapsed()&&a.isCollapsed()))return mb;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||zg(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return mb;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&H(r)&&r.__text.length===1&&a.anchor.offset===1?gb:mb}let c=s[0],l=e._nodeMap.get(c.__key);if(!H(l)||!H(c)||l.__mode!==c.__mode)return mb;let u=l.__text,d=c.__text;if(u===d)return mb;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return mb;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?gb:g===-1&&h===m+1?_b:g===-1&&h===m?vb:mb}function bb(e,t){let n=Date.now(),r=mb;return(i,a,o,s,c,l)=>{let u=Date.now();if(l.has(`historic`))return r=mb,n=u,pb;let d=yb(i,a,s,c,e.isComposing()),f=(()=>{let f=o===null||o.editor===e,p=l.has(Wg);if(!p&&f&&l.has(`history-merge`))return db;if(i===null)return fb;let m=a._selection;return s.size>0||c.size>0?!1===p&&d!==mb&&d===r&&u<n+t&&f||s.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(U(a)&&U(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!H(r)||!H(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(s)[0],i,a)?db:fb:m===null?pb:db})();return n=u,r=d,f}}function xb(e){e.undoStack=[],e.redoStack=[],e.current=null}function Sb(e,t,n){let r=bb(e,n);return Xy(e.registerCommand($p,(()=>(function(e,t){let n=t.redoStack,r=t.undoStack;if(r.length!==0){let i=t.current,a=r.pop();i!==null&&(n.push(i),e.dispatchCommand(Tm,!0)),r.length===0&&e.dispatchCommand(Em,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:`historic`})}}(e,t),!0)),0),e.registerCommand(em,(()=>(function(e,t){let n=t.redoStack,r=t.undoStack;if(n.length!==0){let i=t.current;i!==null&&(r.push(i),e.dispatchCommand(Em,!0));let a=n.pop();n.length===0&&e.dispatchCommand(Tm,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:`historic`})}}(e,t),!0)),0),e.registerCommand(Cm,(()=>(xb(t),!1)),0),e.registerCommand(wm,(()=>(xb(t),e.dispatchCommand(Tm,!1),e.dispatchCommand(Em,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:a,dirtyElements:o,tags:s})=>{let c=t.current,l=t.redoStack,u=t.undoStack,d=c===null?null:c.editorState;if(c!==null&&n===d)return;let f=r(i,n,c,a,o,s);if(f===fb)l.length!==0&&(t.redoStack=[],e.dispatchCommand(Tm,!1)),c!==null&&(u.push({...c}),e.dispatchCommand(Em,!0));else if(f===pb)return;t.current={editor:e,editorState:n}})))}function Cb(){return{current:null,redoStack:[],undoStack:[]}}function wb({delay:e,externalHistoryState:t}){let[n]=Yd();return function(e,t,n=1e3){let r=(0,L.useMemo)((()=>t||Cb()),[t]);(0,L.useEffect)((()=>Sb(e,r,n)),[n,e,r])}(n,t,e),null}function Tb(e,t){let n=t.body?t.body.childNodes:[],r=[],i=[];for(let t=0;t<n.length;t++){let a=n[t];if(!Ob.has(a.nodeName)){let t=kb(a,e,i,!1);t!==null&&(r=r.concat(t))}}return function(e){for(let t of e)t.getNextSibling()instanceof Kg&&t.insertAfter(ch());for(let t of e){let e=t.getChildren();for(let n of e)t.insertBefore(n);t.remove()}}(i),r}function Eb(e,t){if(typeof document>`u`||typeof window>`u`&&global.window===void 0)throw Error(`To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.`);let n=document.createElement(`div`),r=k_().getChildren();for(let i=0;i<r.length;i++)Db(e,r[i],n,t);return n.innerHTML}function Db(e,t,n,r=null){let i=r===null||t.isSelected(r),a=G(t)&&t.excludeFromCopy(`html`),o=t;if(r!==null){let e=Ov(t);e=H(e)&&r!==null?Ny(r,e):e,o=e}let s=G(o)?o.getChildren():[],c=i_(e,o.getType()),l;l=c&&c.exportDOM!==void 0?c.exportDOM(e,o):o.exportDOM(e);let{element:u,after:d}=l;if(!u)return!1;let f=document.createDocumentFragment();for(let n=0;n<s.length;n++){let a=s[n],o=Db(e,a,f,r);!i&&G(t)&&o&&t.extractWithChild(a,r,`html`)&&(i=!0)}if(i&&!a){if((_v(u)||yv(u))&&u.append(f),n.append(u),d){let e=d.call(o,u);e&&(yv(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(f);return i}var Ob=new Set([`STYLE`,`SCRIPT`]);function kb(e,t,n,r,i=new Map,a){let o=[];if(Ob.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!cv(s))&&(s!=null&&Kh(s)||r);for(let e=0;e<d.length;e++)f.push(...kb(d[e],t,n,p,new Map(i),s));return u!=null&&(f=u(f)),xv(e)&&(f=Ab(e,f,p?()=>{let e=new Kg;return n.push(e),e}:Yg)),s==null?f.length>0?o=o.concat(f):xv(e)&&function(e){return e.nextSibling==null||e.previousSibling==null?!1:bv(e.nextSibling)&&bv(e.previousSibling)}(e)&&(o=o.concat(ch())):G(s)&&s.append(...f),o}function Ab(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(Kh(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&Kh(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}function jb(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Mb(e,t=W()){return t??jb(166),U(t)&&t.isCollapsed()||t.getNodes().length===0?``:Eb(e,t)}function Nb(e,t=W()){return t??jb(166),U(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(Lb(e,t))}function Pb(e,t,n){let r=e.getData(`application/x-lexical-editor`);if(r)try{let e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return Fb(n,Rb(e.nodes),t)}catch{}let i=e.getData(`text/html`),a=e.getData(`text/plain`);if(i&&a!==i)try{return Fb(n,Tb(n,new DOMParser().parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}(i),`text/html`)),t)}catch{}let o=a||e.getData(`text/uri-list`);if(o!=null)if(U(t)){let e=o.split(/(\r?\n|\t)/);e[e.length-1]===``&&e.pop();for(let t=0;t<e.length;t++){let n=W();if(U(n)){let r=e[t];r===`
|
|
22
|
+
`||r===`\r
|
|
23
|
+
`?n.insertParagraph():r===` `?n.insertNodes([kh()]):n.insertText(r)}}}else t.insertRawText(o)}function Fb(e,t,n){e.dispatchCommand(Hp,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(U(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=fy(t,`previous`);if(r)if(Hv(r))n=r.origin;else{let e=ay(r,Qv(k_(),`next`).getFlipped());for(let t of e){if(H(t.origin)){n=t.origin;break}if(G(t.origin)&&!t.origin.isInline())break}}if(n&&H(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function Ib(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=G(n)&&n.excludeFromCopy(`html`),o=n;if(t!==null){let e=Ov(n);e=H(e)&&t!==null?Ny(t,e):e,o=e}let s=G(o)?o.getChildren():[],c=function(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&jb(58,n.name),G(e)){let e=t.children;Array.isArray(e)||jb(59,n.name)}return t}(o);if(H(o)){let e=o.__text;e.length>0?c.text=e:i=!1}for(let r=0;r<s.length;r++){let a=s[r],o=Ib(e,t,a,c.children);!i&&G(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a)r.push(c);else if(Array.isArray(c.children))for(let e=0;e<c.children.length;e++){let t=c.children[e];r.push(t)}return i}function Lb(e,t){let n=[],r=k_().getChildren();for(let i=0;i<r.length;i++)Ib(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}function Rb(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=wg(r);H(i)&&Fy(i),t.push(i)}return t}var zb=null;async function Bb(e,t,n){if(zb!==null)return!1;if(t!==null)return new Promise(((r,i)=>{e.update((()=>{r(Vb(e,t,n))}))}));let r=e.getRootElement(),i=e._window||window,a=window.document,o=mv(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.cssText=`position: fixed; top: -1000px;`,s.append(a.createTextNode(`#`)),r.append(s);let c=new Range;return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise(((t,r)=>{let i=e.registerCommand(bm,(r=>(sb(r,ClipboardEvent)&&(i(),zb!==null&&(window.clearTimeout(zb),zb=null),t(Vb(e,r,n))),!0)),4);zb=window.setTimeout((()=>{i(),zb=null,t(!1)}),50),a.execCommand(`copy`),s.remove()}))}function Vb(e,t,n){if(n===void 0){let t=mv(e._window);if(!t)return!1;let r=t.anchorNode,i=t.focusNode;if(r!==null&&i!==null&&!c_(e,r,i))return!1;let a=W();if(a===null)return!1;n=Ub(a)}t.preventDefault();let r=t.clipboardData;return r!==null&&(Wb(r,n),!0)}var Hb=[[`text/html`,Mb],[`application/x-lexical-editor`,Nb]];function Ub(e=W()){let t={"text/plain":e?e.getTextContent():``};if(e){let n=wv();for(let[r,i]of Hb){let a=i(n,e);a!==null&&(t[r]=a)}}return t}function Wb(e,t){for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function Gb(e,t){if(document.caretRangeFromPoint!==void 0){let n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!==`undefined`){let n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}var Kb=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,qb=Kb&&`documentMode`in document?document.documentMode:null,Jb=!(!Kb||!(`InputEvent`in window)||qb)&&`getTargetRanges`in new window.InputEvent(`input`),Yb=Kb&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Xb=Kb&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Zb=Kb&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Qb=Kb&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Zb,$b=Bp(`DRAG_DROP_PASTE_FILE`),ex=class e extends Pg{static getType(){return`quote`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`blockquote`);return $y(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:ox,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(_v(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return tx().updateFromJSON(e)}insertNewAfter(e,t){let n=Yg(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){let e=Yg();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function tx(){return lv(new ex)}function nx(e){return e instanceof ex}var rx=class e extends Pg{static getType(){return`heading`}static clone(t){return new e(t.__tag,t.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){let t=this.getWritable();return this.__tag=e,t}createDOM(e){let t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];$y(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:ax,priority:0}),h2:e=>({conversion:ax,priority:0}),h3:e=>({conversion:ax,priority:0}),h4:e=>({conversion:ax,priority:0}),h5:e=>({conversion:ax,priority:0}),h6:e=>({conversion:ax,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&ix(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>ix(e)?{conversion:e=>({node:sx(`h1`)}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(_v(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return sx(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?Yg():sx(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),n===0&&!this.isEmpty()&&e){let e=Yg();e.select(),this.replace(e,!0)}return i}collapseAtStart(){let e=this.isEmpty()?Yg():sx(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}};function ix(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function ax(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=sx(t),e.style!==null&&(kv(e,n),n.setFormat(e.style.textAlign))),{node:n}}function ox(e){let t=tx();return e.style!==null&&(t.setFormat(e.style.textAlign),kv(e,t)),{node:t}}function sx(e=`h1`){return lv(new rx(e))}function cx(e){return e instanceof rx}function lx(e){let t=null;if(sb(e,DragEvent)?t=e.dataTransfer:sb(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function ux(e){let t=W();if(!U(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=rb(i,(e=>G(e)&&!e.isInline()));if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}function dx(e){return Lg(E_(e))}function fx(e){for(let t of[`lowercase`,`uppercase`,`capitalize`])e.hasFormat(t)&&e.toggleFormat(t)}function px(e){return Xy(e.registerCommand(Up,(e=>{let t=W();return!!Lh(t)&&(t.clear(),!0)}),0),e.registerCommand(Wp,(e=>{let t=W();return U(t)?(t.deleteCharacter(e),!0):!!Lh(t)&&(t.deleteNodes(),!0)}),0),e.registerCommand(Xp,(e=>{let t=W();return!!U(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(Zp,(e=>{let t=W();return!!U(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(qp,(t=>{let n=W();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)Pb(r,n,e);else if(U(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0}),0),e.registerCommand(Yp,(()=>{let e=W();return!!U(e)&&(e.removeText(),!0)}),0),e.registerCommand(Qp,(e=>{let t=W();return!!U(t)&&(t.formatText(e),!0)}),0),e.registerCommand(tee,(e=>{let t=W();if(!U(t)&&!Lh(t))return!1;let n=t.getNodes();for(let t of n){let n=rb(t,(e=>G(e)&&!e.isInline()));n!==null&&n.setFormat(e)}return!0}),0),e.registerCommand(Gp,(e=>{let t=W();return!!U(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(Kp,(()=>{let e=W();return!!U(e)&&(e.insertParagraph(),!0)}),0),e.registerCommand(pm,(()=>(ig([kh()]),!0)),0),e.registerCommand(mm,(()=>ux((e=>{let t=e.getIndent();e.setIndent(t+1)}))),0),e.registerCommand(hm,(()=>ux((e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}))),0),e.registerCommand(am,(e=>{let t=W();if(Lh(t)){let e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(U(t)){let n=Z_(t.focus,!0);if(!e.shiftKey&&Lg(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),0),e.registerCommand(om,(e=>{let t=W();if(Lh(t)){let e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(U(t)){if(function(e){let t=e.focus;return t.key===`root`&&t.offset===k_().getChildrenSize()}(t))return e.preventDefault(),!0;let n=Z_(t.focus,!1);if(!e.shiftKey&&Lg(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),0),e.registerCommand(rm,(e=>{let t=W();if(Lh(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),My(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!U(t))return!1;if(By(t,!0)){let n=e.shiftKey;return e.preventDefault(),Uy(t,n,!0),!0}return!1}),0),e.registerCommand(nm,(e=>{let t=W();if(Lh(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),My(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!U(t))return!1;let n=e.shiftKey;return!!By(t,!1)&&(e.preventDefault(),Uy(t,n,!1),!0)}),0),e.registerCommand(lm,(t=>{if(dx(t.target))return!1;let n=W();if(U(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(zg(n))return!1;let r=nb(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(hm,void 0);if(Xb&&navigator.language===`ko-KR`)return!1}else if(!Lh(n))return!1;return t.preventDefault(),e.dispatchCommand(Wp,!0)}),0),e.registerCommand(dm,(t=>{if(dx(t.target))return!1;let n=W();return!(!U(n)&&!Lh(n))&&(t.preventDefault(),e.dispatchCommand(Wp,!1))}),0),e.registerCommand(sm,(t=>{let n=W();if(!U(n))return!1;if(fx(n),t!==null){if((Xb||Yb||Qb)&&Jb)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(Gp,!1)}return e.dispatchCommand(Kp,void 0)}),0),e.registerCommand(um,(()=>!!U(W())&&(e.blur(),!0)),0),e.registerCommand(gm,(t=>{let[,n]=lx(t);if(n.length>0){let r=Gb(t.clientX,t.clientY);if(r!==null){let{offset:t,node:i}=r,a=E_(i);if(a!==null){let e=Jh();if(H(a))e.anchor.set(a.getKey(),t,`text`),e.focus.set(a.getKey(),t,`text`);else{let t=a.getParentOrThrow().getKey(),n=a.getIndexWithinParent()+1;e.anchor.set(t,n,`element`),e.focus.set(t,n,`element`)}j_(ip(e))}e.dispatchCommand($b,n)}return t.preventDefault(),!0}return!!U(W())}),0),e.registerCommand(_m,(e=>{let[t]=lx(e),n=W();return!(t&&!U(n))}),0),e.registerCommand(vm,(e=>{let[t]=lx(e),n=W();if(t&&!U(n))return!1;let r=Gb(e.clientX,e.clientY);return r!==null&&Lg(E_(r.node))&&e.preventDefault(),!0}),0),e.registerCommand(Sm,(()=>(q_(),!0)),0),e.registerCommand(bm,(t=>(Bb(e,sb(t,ClipboardEvent)?t:null),!0)),0),e.registerCommand(xm,(t=>(async function(e,t){await Bb(t,sb(e,ClipboardEvent)?e:null),t.update((()=>{let e=W();U(e)?e.removeText():Lh(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),0),e.registerCommand(Jp,(t=>{let[,n,r]=lx(t);return n.length>0&&!r?(e.dispatchCommand($b,n),!0):vv(t.target)&&s_(t.target)?!1:W()!==null&&(function(e,t){e.preventDefault(),t.update((()=>{let n=W(),r=sb(e,InputEvent)||sb(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&Pb(r,n,t)}),{tag:`paste`})}(t,e),!0)}),0),e.registerCommand(cm,(e=>{let t=W();return U(t)&&fx(t),!1}),0),e.registerCommand(fm,(e=>{let t=W();return U(t)&&fx(t),!1}),0))}function mx(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function hx(e,t){return e.length>0?(mx(e,e.length,0,t),e):t}var gx=Dx(/[A-Za-z]/),_x=Dx(/[\dA-Za-z]/),vx=Dx(/[#-'*+\--9=?A-Z^-~]/);function yx(e){return e!==null&&(e<32||e===127)}var bx=Dx(/\d/),xx=Dx(/[\dA-Fa-f]/),Sx=Dx(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function Cx(e){return e!==null&&(e<0||e===32)}function wx(e){return e===-2||e===-1||e===32}var Tx=Dx(/\p{P}|\p{S}/u),Ex=Dx(/\s/);function Dx(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ox(e){if(e===null||Cx(e)||Ex(e))return 1;if(Tx(e))return 2}function kx(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}function Ax(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&mx(o,o.length,0,kx(s,e.slice(r+1,n),t)),mx(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),mx(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Ox(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Ox(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var jx=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Ix.peek=Lx;function Mx(){return{canContainEols:[`delete`],enter:{strikethrough:Px},exit:{strikethrough:Fx}}}function Nx(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:jx}],handlers:{delete:Ix}}}function Px(e){this.enter({type:`delete`,children:[]},e)}function Fx(e){this.exit(e)}function Ix(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Lx(){return`~`}Ux.peek=Wx;var Rx=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],zx={canContainEols:[`highlight`],enter:{highlight:Bx},exit:{highlight:Vx}};function Bx(e){this.enter({type:`highlight`,children:[]},e)}function Vx(e){this.exit(e)}var Hx={unsafe:[{character:`=`,inConstruct:`phrasing`,notInConstruct:Rx}],handlers:{highlight:Ux}};function Ux(e,t,n,r){let i=n.createTracker(r),a=n.enter(`highlight`),o=i.move(`==`);return o+=i.move(n.containerPhrasing(e,{before:o,after:`=`,...i.current()})),o+=i.move(`==`),a(),o}function Wx(){return`=`}function Gx(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var Kx=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),qx={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function Jx(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Yx(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Xx(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Zx(e){return Xx(e)||Jx(e)}var Qx=document.createElement(`i`);function $x(e){let t=`&`+e+`;`;Qx.innerHTML=t;let n=Qx.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}var eS=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function tS(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?Zx:u===`decimal`?Jx:Yx;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Kx.includes(y)&&(_=y,v=$x(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?$x(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):Zx(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(nS(e))h(7,S),C=`�`;else if(e in qx)h(6,S),C=qx[e];else{let t=``;rS(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,eS[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function nS(e){return e>=55296&&e<=57343||e>1114111}function rS(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var iS=/["&'<>`]/g,fee=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,pee=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,mee=/[|\\{}()[\]^$+*?.]/g,aS=new WeakMap;function hee(e,t){if(e=e.replace(t.subset?gee(t.subset):iS,r),t.subset||t.escapeOnly)return e;return e.replace(fee,n).replace(pee,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function gee(e){let t=aS.get(e);return t||(t=_ee(e),aS.set(e,t)),t}function _ee(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(mee,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function vee(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function yee(e,t){return hee(e,Object.assign({format:vee},t))}function oS(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?cS(e.position):`start`in e||`end`in e?cS(e):`line`in e||`column`in e?sS(e):``}function sS(e){return lS(e&&e.line)+`:`+lS(e&&e.column)}function cS(e){return sS(e&&e.start)+`-`+sS(e&&e.end)}function lS(e){return e&&typeof e==`number`?e:1}var uS=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=oS(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};uS.prototype.file=``,uS.prototype.name=``,uS.prototype.reason=``,uS.prototype.message=``,uS.prototype.stack=``,uS.prototype.column=void 0,uS.prototype.line=void 0,uS.prototype.ancestors=void 0,uS.prototype.cause=void 0,uS.prototype.fatal=void 0,uS.prototype.place=void 0,uS.prototype.ruleId=void 0,uS.prototype.source=void 0;var dS=` `;function bee(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new uS("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new uS(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new uS("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=tS(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new uS("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+oS(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new uS("Expected a closing tag for `"+S(r)+"` ("+oS({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new uS("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+oS(t.end)+") or another opening tag after the start of `"+t.type+"` ("+oS(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function xee(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=Cee,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=pS(fS(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&Gx(e,n)>Gx(e,o)?o:n;s=t+yee(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+dS+m[e];b+=y.move(`
|
|
24
|
+
`+m.join(`
|
|
25
|
+
`)+`
|
|
26
|
+
`+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
|
|
27
|
+
`),b+=y.move(See(e,s,y.current())),b+=y.move(`
|
|
28
|
+
`))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function See(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=pS(fS(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
|
|
29
|
+
`,after:`
|
|
30
|
+
`,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
|
|
31
|
+
|
|
32
|
+
`))}return r.pop(),s.join(``)}function fS(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function pS(e){return dS.repeat(e)}function Cee(){return`<`}var mS=Object.prototype.hasOwnProperty;function hS(e,t,n){for(n of e.keys())if(gS(n,t))return n}function gS(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&gS(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i==`object`&&(i=hS(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i==`object`&&(i=hS(t,i),!i)||!gS(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(mS.call(e,n)&&++r&&!mS.call(t,n)||!(n in t)||!gS(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var _S,vS,yS,bS,xS=!0;typeof process<`u`&&({FORCE_COLOR:_S,NODE_DISABLE_COLORS:vS,NO_COLOR:yS,TERM:bS}={},xS=process.stdout&&process.stdout.isTTY);var SS={enabled:!vS&&yS==null&&bS!==`dumb`&&(_S!=null&&_S!==`0`||xS),reset:TS(0,0),bold:TS(1,22),dim:TS(2,22),italic:TS(3,23),underline:TS(4,24),inverse:TS(7,27),hidden:TS(8,28),strikethrough:TS(9,29),black:TS(30,39),red:TS(31,39),green:TS(32,39),yellow:TS(33,39),blue:TS(34,39),magenta:TS(35,39),cyan:TS(36,39),white:TS(37,39),gray:TS(90,39),grey:TS(90,39),bgBlack:TS(40,49),bgRed:TS(41,49),bgGreen:TS(42,49),bgYellow:TS(43,49),bgBlue:TS(44,49),bgMagenta:TS(45,49),bgCyan:TS(46,49),bgWhite:TS(47,49)};function CS(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function wS(e,t){let n={has:e,keys:t};return n.reset=SS.reset.bind(n),n.bold=SS.bold.bind(n),n.dim=SS.dim.bind(n),n.italic=SS.italic.bind(n),n.underline=SS.underline.bind(n),n.inverse=SS.inverse.bind(n),n.hidden=SS.hidden.bind(n),n.strikethrough=SS.strikethrough.bind(n),n.black=SS.black.bind(n),n.red=SS.red.bind(n),n.green=SS.green.bind(n),n.yellow=SS.yellow.bind(n),n.blue=SS.blue.bind(n),n.magenta=SS.magenta.bind(n),n.cyan=SS.cyan.bind(n),n.white=SS.white.bind(n),n.gray=SS.gray.bind(n),n.grey=SS.grey.bind(n),n.bgBlack=SS.bgBlack.bind(n),n.bgRed=SS.bgRed.bind(n),n.bgGreen=SS.bgGreen.bind(n),n.bgYellow=SS.bgYellow.bind(n),n.bgBlue=SS.bgBlue.bind(n),n.bgMagenta=SS.bgMagenta.bind(n),n.bgCyan=SS.bgCyan.bind(n),n.bgWhite=SS.bgWhite.bind(n),n}function TS(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:SS.enabled?CS(this.keys,t+``):t+``):t===void 0?wS([e],[n]):SS.enabled?CS([n],t+``):t+``}}function ES(){}ES.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(DS(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function DS(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var OS=new ES;function kS(e,t,n){return OS.diff(e,t,n)}var AS=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,jS=/\S/,MS=new ES;MS.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!jS.test(e)&&!jS.test(t)},MS.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&AS.test(t[n])&&AS.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var NS=new ES;NS.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
33
|
+
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};function PS(e,t,n){return NS.diff(e,t,n)}var FS=new ES;FS.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var IS=new ES;IS.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function LS(e){"@babel/helpers - typeof";return LS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},LS(e)}var RS=Object.prototype.toString,zS=new ES;zS.useLongestToken=!0,zS.tokenize=NS.tokenize,zS.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(BS(e,null,null,i),i,` `)},zS.equals=function(e,t){return ES.prototype.equals.call(zS,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function BS(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(RS.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=BS(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),LS(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=BS(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var VS=new ES;VS.tokenize=function(e){return e.slice()},VS.join=VS.removeEmpty=function(e){return e};function HS(e,t,n){return VS.diff(e,t,n)}var US={"--":SS.red,"··":SS.grey,"++":SS.green},WS=SS.dim().italic,GS=SS.dim(`→`),KS=SS.dim(`·`),qS=SS.dim(`↵`),JS=(e,t)=>US[e](e+XS(t))+`
|
|
34
|
+
`,YS=(e,t)=>SS.dim(`L`+String(e).padStart(t,`0`)+` `),XS=e=>e.replace(/[ ]/g,KS).replace(/\t/g,GS).replace(/(\r?\n)/g,qS);function ZS(e,t,n){let r=e.removed?`--`:e.added?`++`:`··`,i=e.value.replace(/\r?\n$/,``).split(`
|
|
35
|
+
`),a=0,o,s=``;for(e.added?s+=US[r]().underline(WS(`Expected:`))+`
|
|
36
|
+
`:e.removed&&(s+=US[r]().underline(WS(`Actual:`))+`
|
|
37
|
+
`);a<i.length;a++)o=i[a],o!=null&&(t&&(s+=YS(t+a,n)),s+=JS(r,o||`
|
|
38
|
+
`));return s}function QS(e,t){let n=HS(e,t),r=0,i=0,a=0,o,s,c,l,u,d=JS(`··`,`[`);for(;r<n.length;r++)for(c=(o=n[r]).removed?`--`:o.added?`++`:`··`,o.added?d+=US[c]().underline(WS(`Expected:`))+`
|
|
39
|
+
`:o.removed&&(d+=US[c]().underline(WS(`Actual:`))+`
|
|
40
|
+
`),i=0;i<o.value.length;i++)for(l=o.value[i]&&typeof o.value[i]==`object`,s=iC(o.value[i]).split(/\r?\n/g),a=0;a<s.length;)u=` `+s[a++]+(l?``:`,`),l&&a===s.length&&i+1<o.value.length&&(u+=`,`),d+=JS(c,u);return d+JS(`··`,`]`)}function $S(e,t,n=0){let r=0,i,a=``,o=PS(e,t),s=String(t.split(/\r?\n/g).length-n).length;for(;r<o.length;r++)a+=ZS(i=o[r],n,s),n&&!i.removed&&(n+=i.count);return a}function eC(e,t){let n=kS(e,t),r=0,i=``,a,o=e.length,s=t.length,c=XS(e),l=XS(t);if(a=n[r],o!==s&&a.removed&&n[r+1]){let i=a.count-n[r+1].count;i==0||(i>0?(t=` `.repeat(i)+t,l=` `.repeat(i)+l,s+=i):i<0&&(e=` `.repeat(-i)+e,c=` `.repeat(-i)+c,o+=-i))}if(i+=tC(c,l,o,s),o===s)for(a=` `;r<o;r++)a+=e[r]===t[r]?` `:`^`;else for(a=` `;r<n.length;r++)a+=(n[r].added||n[r].removed?`^`:` `).repeat(Math.max(n[r].count,0)),r+1<n.length&&(n[r].added&&n[r+1].removed||n[r].removed&&n[r+1].added)&&(n[r+1].count-=n[r].count);return i+SS.red(a)}function tC(e,t,n=String(e).length,r=String(t).length){let i=4,a=Math.max(n,r),o=typeof e,s=typeof t;if(o!==s){i=2;let c=i+a-n,l=i+a-r;e+=` `.repeat(c)+SS.dim(`[${o}]`),t+=` `.repeat(l)+SS.dim(`[${s}]`),n+=c+o.length+2,r+=l+s.length+2,a=Math.max(n,r)}return US[`++`](`++`+t+` `.repeat(i+a-r)+WS(`(Expected)`))+`
|
|
41
|
+
`+US[`--`](`--`+e+` `.repeat(i+a-n)+WS(`(Actual)`))+`
|
|
42
|
+
`}function nC(e,t){var n,r=0,i,a=Array.isArray(e),o=[],s=a?Array(e.length):{};if(a)for(r=0;r<s.length;r++)i=e[r],!i||typeof i!=`object`?s[r]=i:s[r]=nC(i,t[r]);else{for(n in t)o.push(n);for(;r<o.length;r++)Object.prototype.hasOwnProperty.call(e,n=o[r])&&(!(i=e[n])||typeof i!=`object`?s[n]=i:s[n]=nC(i,t[n]));for(n in e)s.hasOwnProperty(n)||(s[n]=e[n])}return s}function rC(){var e=new Set;return function(t,n){return n===void 0?`[__VOID__]`:typeof n==`number`&&n!==n?`[__NAN__]`:typeof n==`bigint`?n.toString():!n||typeof n!=`object`?n:e.has(n)?`[Circular]`:(e.add(n),n)}}function iC(e){return JSON.stringify(e,rC(),2).replace(/"\[__NAN__\]"/g,`NaN`).replace(/"\[__VOID__\]"/g,`undefined`)}function aC(e,t){if(Array.isArray(t)&&Array.isArray(e))return QS(e,t);if(t instanceof RegExp)return eC(``+e,``+t);let n=e&&typeof e==`object`,r=t&&typeof t==`object`;return n&&r&&(e=nC(e,t)),r&&(t=iC(t)),n&&(e=iC(e)),t&&typeof t==`object`&&(e=iC(nC(e,t)),t=iC(t)),n=typeof e==`string`,r=typeof t==`string`,n&&/\r?\n/.test(e)?$S(e,``+t):r&&/\r?\n/.test(t)?$S(``+e,t):n&&r?eC(e,t):tC(e,t)}function oC(e){e=e.replace(/\r?\n/g,`
|
|
43
|
+
`);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,i=(t||[]).length;for(;n<i;n++)r=Math.min(r,t[n].length);return i&&r?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e}var sC=class extends Error{constructor(e={}){super(e.message),this.name=`Assertion`,this.code=`ERR_ASSERTION`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}};function cC(e,t,n,r,i,a,o){if(e)return;let s=o||a;throw o instanceof Error?o:new sC({actual:t,expects:n,operator:r,message:s,details:i&&i(t,n),generated:!o})}function lC(e,t){cC(!!e,!1,!0,`ok`,!1,`Expected value to be truthy`,t)}function uC(e,t,n){cC(e===t,e,t,`is`,aC,`Expected values to be strictly equal:`,n)}function dC(e,t){cC(!e,!0,!1,`not`,!1,`Expected value to be falsey`,t)}dC.ok=dC,uC.not=function(e,t,n){cC(e!==t,e,t,`is.not`,!1,`Expected values not to be strictly equal`,n)},dC.equal=function(e,t,n){cC(!gS(e,t),e,t,`not.equal`,!1,`Expected values not to be deeply equal`,n)},dC.type=function(e,t,n){let r=typeof e;cC(r!==t,r,t,`not.type`,!1,`Expected "${r}" not to be "${t}"`,n)},dC.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";cC(!(e instanceof t),e,t,`not.instance`,!1,`Expected value not to be an instance of ${r}`,n)},dC.snapshot=function(e,t,n){e=oC(e),t=oC(t),cC(e!==t,e,t,`not.snapshot`,!1,`Expected value not to match snapshot`,n)},dC.fixture=function(e,t,n){e=oC(e),t=oC(t),cC(e!==t,e,t,`not.fixture`,!1,`Expected value not to match fixture`,n)},dC.match=function(e,t,n){typeof t==`string`?cC(!e.includes(t),e,t,`not.match`,!1,`Expected value not to include "${t}" substring`,n):cC(!t.test(e),e,t,`not.match`,!1,`Expected value not to match \`${String(t)}\` pattern`,n)},dC.throws=function(e,t,n){!n&&typeof t==`string`&&(n=t,t=null);try{e()}catch(e){typeof t==`function`?cC(!t(e),!0,!1,`not.throws`,!1,`Expected function not to throw matching exception`,n):t instanceof RegExp?cC(!t.test(e.message),!0,!1,`not.throws`,!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||cC(!1,!0,!1,`not.throws`,!1,`Expected function not to throw`,n)}};var fC={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},pC={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},mC={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},hC=`highlightSequenceTemporary`,gC=`highlightSequence`,_C=`highlight`,vC=`highlightText`;function yC(){let e={name:`highlight`,tokenize:n,resolveAll:t};return{text:{[fC.equalsTo]:e},insideSpan:{null:[e]},attentionMarkers:{null:[fC.equalsTo]}};function t(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===hC&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===hC&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=gC,e[r][1].type=gC;let i={type:_C,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:vC,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&mx(o,o.length,0,kx(s,e.slice(r+1,n),t)),mx(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),mx(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===hC&&(e[n][1].type=mC.data);return e}function n(e,t,n){let r=this.previous,i=this.events,a=0;return o;function o(t){return lC(t===fC.equalsTo,"expected `=`"),r===fC.equalsTo&&i[i.length-1][1].type!==mC.characterEscape?n(t):(e.enter(hC),s(t))}function s(i){let o=Ox(r);if(i===fC.equalsTo)return a>1?n(i):(e.consume(i),a++,s);if(a<2)return n(i);let c=e.exit(hC),l=Ox(i);return c._open=!l||l===pC.attentionSideAfter&&!!o,c._close=!o||o===pC.attentionSideAfter&&!!l,t(i)}}}var bC=/[$_\p{ID_Start}]/u,xC=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,SC=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,CC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TC={};function EC(e){return e?bC.test(String.fromCodePoint(e)):!1}function DC(e,t){let n=(t||TC).jsx?SC:xC;return e?n.test(String.fromCodePoint(e)):!1}function OC(e,t){return((t||TC).jsx?wC:CC).test(e)}function kC(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return wx(r)?(e.enter(n),s(r)):t(r)}function s(r){return wx(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function AC(e){return e}var jC={}.hasOwnProperty,MC=Symbol(`continue`),NC=Symbol(`exit`),PC=Symbol(`skip`);function FC(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return LC(e)&&(s.displayName=`node (`+AC(e.type)+`)`),s;function s(){let s=n?IC(n(e,t,a,o)):[];if(s[0]===NC)return s;if(s[0]!==PC){let t;for(t in e)if(jC.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(LC(r)){let e=i(r,t,a,n)();if(e[0]===NC)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(LC(r)){let e=i(r,t,void 0,n)();if(e[0]===NC)return e}}}return r?IC(r(e,t,a,o)):s}}}function IC(e){return Array.isArray(e)?e:typeof e==`number`?[MC,e]:[e]}function LC(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function RC(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=BC(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&zC(m);if(g&&!t.allowEmpty)throw new uS(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(zC(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,FC(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=VC(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function zC(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function BC(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=HC(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function VC(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function HC(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
|
|
44
|
+
`;break;case-3:a=`\r
|
|
45
|
+
`;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function UC(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=WC(n.start,r[0]||t.start),a=WC(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function WC(e,t){if(e&&typeof e==`object`){let n=`line`in e?GC(e.line):void 0,r=`column`in e?GC(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:GC(t)}}}function GC(e){return typeof e==`number`&&e>-1?e:void 0}var KC=2,qC=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,JC=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,YC=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,XC=`#unexpected-type-in-code-expected-an-object-spread-spread`,ZC=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,QC=`#could-not-parse-expression-with-acorn`;function $C(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new uS("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=qC+JC,e}if(q(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?ew.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||q(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new uS("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=qC+YC,e}return wx(t)?kC(e,_,`linePrefix`,KC+1)(t):_(t)}}function ew(e,t,n,r,i,a,o){let s=RC(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=UC(e),n=new uS("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=qC+XC,n}if(e.expression.properties[1]){let t=new uS(`Unexpected extra content in spread: only a single spread is supported`,{place:UC(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=qC+ZC,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=UC(e.expression.properties[0]),n=new uS("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=qC+XC,n}}if(s.error){let e=new uS(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=qC+QC,{type:`nok`,message:e}}return{type:`ok`,estree:c}}var tw=`https://github.com/micromark/micromark-extension-mdx-jsx`;function nw(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j){let M=this,N,P;return F;function F(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),ee}function ee(e){return Cx(e)?n(e):(N=te,Ce(e))}function te(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),N=ne,Ce;if(t===62)return Se(t);if(t!==null&&t>=0&&EC(t))return e.enter(d),e.enter(f),e.consume(t),re;Ee(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function ne(t){if(t===62)return Se(t);if(t!==null&&t>=0&&EC(t))return e.enter(d),e.enter(f),e.consume(t),re;Ee(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function re(t){if(t!==null&&t>=0&&DC(t,{jsx:!0}))return e.consume(t),re;if(t===46||t===47||t===58||t===62||t===123||Cx(t)||Ex(t))return e.exit(f),N=I,Ce(t);Ee(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function I(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=ie,Ce;if(t===58)return e.enter(h),e.consume(t),e.exit(h),N=se,Ce;if(t===47||t===62||t===123||t!==null&&t>=0&&EC(t))return e.exit(d),ue(t);Ee(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ie(t){if(t!==null&&t>=0&&EC(t))return e.enter(m),e.consume(t),ae;Ee(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ae(t){if(t!==null&&t>=0&&DC(t,{jsx:!0}))return e.consume(t),ae;if(t===46||t===47||t===62||t===123||Cx(t)||Ex(t))return e.exit(m),N=oe,Ce(t);Ee(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function oe(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=ie,Ce;if(t===47||t===62||t===123||t!==null&&t>=0&&EC(t))return e.exit(d),ue(t);Ee(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function se(t){if(t!==null&&t>=0&&EC(t))return e.enter(g),e.consume(t),ce;Ee(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function ce(t){if(t!==null&&t>=0&&DC(t,{jsx:!0}))return e.consume(t),ce;if(t===47||t===62||t===123||Cx(t)||Ex(t))return e.exit(g),N=le,Ce(t);Ee(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function le(t){if(t===47||t===62||t===123||t!==null&&t>=0&&EC(t))return e.exit(d),ue(t);Ee(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ue(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),N=xe,Ce;if(t===62)return Se(t);if(t===123)return $C.call(M,e,de,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&EC(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),fe;Ee(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function de(e){return N=ue,Ce(e)}function fe(t){if(t!==null&&t>=0&&DC(t,{jsx:!0}))return e.consume(t),fe;if(t===47||t===58||t===61||t===62||t===123||Cx(t)||Ex(t))return e.exit(S),N=pe,Ce(t);Ee(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function pe(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),N=me,Ce;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),N=_e,Ce;if(t===47||t===62||t===123||Cx(t)||Ex(t)||t!==null&&t>=0&&EC(t))return e.exit(x),e.exit(b),N=ue,Ce(t);Ee(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function me(t){if(t!==null&&t>=0&&EC(t))return e.enter(w),e.consume(t),he;Ee(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function he(t){if(t!==null&&t>=0&&DC(t,{jsx:!0}))return e.consume(t),he;if(t===47||t===61||t===62||t===123||Cx(t)||Ex(t))return e.exit(w),e.exit(x),N=ge,Ce(t);Ee(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function ge(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),N=_e,Ce;if(t===47||t===62||t===123||t!==null&&t>=0&&EC(t))return e.exit(b),ue(t);Ee(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function _e(t){if(t===34||t===39)return e.enter(E),e.enter(D),e.consume(t),e.exit(D),P=t,ye;if(t===123)return $C.call(M,e,ve,k,A,j,r,i,a,!1,!1,o)(t);Ee(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function ve(t){return e.exit(b),N=ue,Ce(t)}function ye(t){return t===null&&Ee(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(P)+"`"),t===P?(e.enter(D),e.consume(t),e.exit(D),e.exit(E),e.exit(b),P=void 0,N=ue,Ce):q(t)?(N=ye,Ce(t)):(e.enter(O),be(t))}function be(t){return t===null||t===P||q(t)?(e.exit(O),ye(t)):(e.consume(t),be)}function xe(e){if(e===62)return Se(e);Ee(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Se(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function Ce(t){return q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Te):wx(t)||Ex(t)?(e.enter(`esWhitespace`),we(t)):N(t)}function we(t){return q(t)?(e.exit(`esWhitespace`),Ce(t)):wx(t)||Ex(t)?(e.consume(t),we):(e.exit(`esWhitespace`),N(t))}function Te(e){if(!o&&M.parser.lazy[M.now().line]){let e=new uS("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",M.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=tw+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return Ce(e)}function Ee(e,t,n){let r=new uS(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+rw(e)+`)`)+` `+t+`, expected `+n,M.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=tw+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function rw(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function iw(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return nw.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function aw(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return nw.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return wx(e)?kC(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||q(e)?r(e):i(e)}}}function ow(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:aw(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:iw(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function sw(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}var cw={}.hasOwnProperty;function lw(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&cw.call(t,e)){let n=String(t[e]);i=cw.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var uw={}.hasOwnProperty;function dw(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)dw(e,t.extensions[n]);for(r in t)if(uw.call(t,r))switch(r){case`extensions`:break;case`unsafe`:fw(e[r],t[r]);break;case`join`:fw(e[r],t[r]);break;case`handlers`:pw(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function fw(e,t){t&&e.push(...t)}function pw(e,t){t&&Object.assign(e,t)}function mw(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),hw);return i(),o}function hw(e,t,n){return`>`+(n?``:` `)+e}function gw(e,t){return _w(e,t.inConstruct,!0)&&!_w(e,t.notInConstruct,!1)}function _w(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function vw(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
46
|
+
`&&gw(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
47
|
+
`}function yw(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function bw(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function xw(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Sw(e,t,n,r){let i=xw(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(bw(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Cw);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(yw(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
48
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
49
|
+
`),a&&(u+=s.move(a+`
|
|
50
|
+
`)),u+=s.move(c),l(),u}function Cw(e,t,n){return(n?``:` `)+e}function ww(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Tw(e,t,n,r){let i=ww(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
51
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Ew(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Dw(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Ow(e,t,n){let r=Ox(e),i=Ox(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kw.peek=Aw;function kw(e,t,n,r){let i=Ew(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Ow(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Dw(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Ow(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Dw(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Aw(e,t,n){return n.options.emphasis||`*`}var jw=(function(e){if(e==null)return Iw;if(typeof e==`function`)return Fw(e);if(typeof e==`object`)return Array.isArray(e)?Mw(e):Nw(e);if(typeof e==`string`)return Pw(e);throw Error(`Expected function, string, or object as test`)});function Mw(e){let t=[],n=-1;for(;++n<e.length;)t[n]=jw(e[n]);return Fw(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Nw(e){let t=e;return Fw(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Pw(e){return Fw(t);function t(t){return t&&t.type===e}}function Fw(e){return t;function t(t,n,r){return!!(Lw(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Iw(){return!0}function Lw(e){return typeof e==`object`&&!!e&&`type`in e}function Rw(e){return e}var zw=[];function Bw(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=jw(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+Rw(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=zw,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Vw(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Vw(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?zw:[e]}function Hw(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Bw(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Uw={};function Ww(e,t){let n=t||Uw;return Gw(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Gw(e,t,n){if(qw(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Kw(e.children,t,n)}return Array.isArray(e)?Kw(e,t,n):``}function Kw(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Gw(e[i],t,n);return r.join(``)}function qw(e){return!!(e&&typeof e==`object`)}function Jw(e,t){let n=!1;return Hw(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ww(e)&&(t.options.setext||n))}function Yw(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Jw(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
52
|
+
`,after:`
|
|
53
|
+
`});return r(),t(),o+`
|
|
54
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
55
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
56
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=Dw(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Xw.peek=Zw;function Xw(e){return e.value||``}function Zw(){return`<`}Qw.peek=$w;function Qw(e,t,n,r){let i=ww(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function $w(){return`!`}eT.peek=tT;function eT(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function tT(){return`!`}nT.peek=rT;function nT(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function rT(){return"`"}function iT(e,t){let n=Ww(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}aT.peek=oT;function aT(e,t,n,r){let i=ww(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(iT(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function oT(e,t,n){return iT(e,n)?`<`:`[`}sT.peek=cT;function sT(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function cT(){return`[`}function lT(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function uT(e){let t=lT(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function dT(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function fT(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function pT(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?dT(n):lT(n),s=e.ordered?o===`.`?`)`:`.`:uT(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),fT(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function mT(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function hT(e,t,n,r){let i=mT(n),a=n.bulletCurrent||lT(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function gT(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var _T=jw([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function vT(e,t,n,r){return(e.children.some(function(e){return _T(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function yT(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}bT.peek=xT;function bT(e,t,n,r){let i=yT(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Ow(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Dw(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Ow(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Dw(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function xT(e,t,n){return n.options.strong||`*`}function ST(e,t,n,r){return n.safe(e.value,r)}function CT(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function wT(e,t,n){let r=(fT(n)+(n.options.ruleSpaces?` `:``)).repeat(CT(n));return n.options.ruleSpaces?r.slice(0,-1):r}var TT={blockquote:mw,break:vw,code:Sw,definition:Tw,emphasis:kw,hardBreak:vw,heading:Yw,html:Xw,image:Qw,imageReference:eT,inlineCode:nT,link:aT,linkReference:sT,list:pT,listItem:hT,paragraph:gT,root:vT,strong:bT,text:ST,thematicBreak:wT},ET=[DT];function DT(e,t,n,r){if(t.type===`code`&&bw(t,r)&&(e.type===`list`||e.type===t.type&&bw(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&Jw(t,r))?void 0:+!!n.spread}var OT=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],kT=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
|
|
57
|
+
`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:OT},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
|
|
58
|
+
]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:OT},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
|
|
59
|
+
*])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:OT},{atBreak:!0,character:`+`,after:`(?:[ \r
|
|
60
|
+
])`},{atBreak:!0,character:`-`,after:`(?:[ \r
|
|
61
|
+
-])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
|
|
62
|
+
]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:OT},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:OT},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:OT},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:OT},{atBreak:!0,character:`~`}];function AT(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var jT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function MT(e){return e.replace(jT,NT)}function NT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return AT(n.slice(t?2:1),t?16:10)}return $x(n)||e}function PT(e){return e.label||!e.identifier?e.label||``:MT(e.identifier)}function FT(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function IT(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
|
|
63
|
+
`)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=Dw(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+Dw(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function LT(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
|
|
64
|
+
`,after:`
|
|
65
|
+
`,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(RT(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function RT(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
|
|
66
|
+
`.repeat(1+a);if(a===!1)return`
|
|
67
|
+
|
|
68
|
+
<!---->
|
|
69
|
+
|
|
70
|
+
`}return`
|
|
71
|
+
|
|
72
|
+
`}var zT=/\r?\n|\r/g;function BT(e,t){let n=[],r=0,i=0,a;for(;a=zT.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function VT(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!gw(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(HT);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(UT(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(Dw(r.charCodeAt(e))),c++))}return a.push(UT(r.slice(c,l),n.after)),a.join(``)}function HT(e,t){return e-t}function UT(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function WT(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function GT(e,t){let n=t||{},r={associationId:PT,containerPhrasing:YT,containerFlow:XT,createTracker:WT,compilePattern:FT,enter:a,handlers:{...TT},handle:void 0,indentLines:BT,indexStack:[],join:[...ET],options:{},safe:ZT,stack:[],unsafe:[...kT]};dw(r,n),r.options.tightDefinitions&&r.join.push(JT),r.handle=lw(`type`,{invalid:KT,unknown:qT,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
|
|
73
|
+
`,after:`
|
|
74
|
+
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
75
|
+
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function KT(e){throw Error("Cannot handle value `"+e+"`, expected node")}function qT(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function JT(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function YT(e,t){return IT(e,this,t)}function XT(e,t){return LT(e,this,t)}function ZT(e,t){return VT(this,e,t)}var QT=[`mdxJsxTextElement`,`mdxJsxFlowElement`];function $T(e){return QT.includes(e.type)&&eE.includes(e.name)}var eE=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.input.ins.kbd.label.legend.li.link.main.map.mark.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`);function tE(e,t){let n=nE(e),r=nE(t);return rE({...n,...r})}function nE(e){let t={};return e.split(`;`).filter(e=>e.trim()!==``).forEach(e=>{let[n,r]=e.split(`:`).map(e=>e.trim());t[n]=r}),t}function rE(e){return Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `)}function iE(e){return e.children instanceof Array}function aE({root:e,visitors:t,jsxComponentDescriptors:n,jsxIsAvailable:r,addImportStatements:i=!0}){let a=null,o=new Set,s=new Map;t=t.sort((e,t)=>(t.priority??0)-(e.priority??0)),d(e,null);function c(e,t){o.add(e),t&&s.set(e,{...t})}function l(e,n){if(a===null)return a=n,a;if(!iE(e))throw Error(`Attempting to append children to a non-parent`);let r=e.children,i=r.at(-1);if(i){let e=t.find(e=>e.shouldJoin?.call(e,i,n));if(e){let t=e.join(i,n);return r.splice(r.length-1,1,t),t}}return r.push(n),n}function u(e,t){e.getChildren().forEach(e=>{d(e,t)})}function d(e,n,r=null){var i;let a=t.find((t,n)=>r?.has(n)?!1:t.testLexicalNode?.call(t,e));if(!a)throw Error(`no lexical visitor found for ${e.getType()}`,{cause:e});(i=a.visitLexicalNode)==null||i.call(a,{lexicalNode:e,mdastParent:n,actions:{addAndStepInto(t,r={},i=!0){let a={type:t,...r,...i?{children:[]}:{}};l(n,a),G(e)&&i&&u(e,a)},appendToParent:l,visitChildren:u,visit:d,registerReferredComponent:c,nextVisitor(){d(e,n,(r??new Set).add(t.indexOf(a)))}}})}if(a===null)throw Error(`traversal ended with no root element`);let f=new Map,p=new Map;for(let e of o){let t=n.find(t=>t.name===e)??s.get(e)??n.find(e=>e.name===`*`);if(!t)throw Error(`Component ${e} is used but not imported`);if(t.source)if(t.defaultExport)p.set(e,t.source);else{let{source:n}=t,r=f.get(n);r?r.push(e):f.set(n,[e])}}if(!i){for(let[e,t]of f.entries()){let n=t.filter(e=>s.has(e));n.length>0?f.set(e,n):f.delete(e)}for(let e of p.keys())s.has(e)||p.delete(e)}let m=Array.from(f).map(([e,t])=>({type:`mdxjsEsm`,value:`import { ${t.join(`, `)} } from '${e}'`}));m.push(...Array.from(p).map(([e,t])=>({type:`mdxjsEsm`,value:`import ${e} from '${t}'`})));let h=a,g=h.children.find(e=>e.type===`yaml`);return g?h.children.splice(h.children.indexOf(g)+1,0,...m):h.children.unshift(...m),uE(h,[]),oE(h),r||sE(h),h}function oE(e){if(`children`in e&&e.children.length>0){if($T(e)&&e.children.length===1){let t=e.children[0];t.type===`mdxJsxTextElement`&&t.name===`span`&&(t.attributes.forEach(t=>{if(t.type===`mdxJsxAttribute`){let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t.name);if(n)if(t.name===`className`){let e=new Set([...n.value.split(` `),...t.value.split(` `)]);n.value=Array.from(e).join(` `)}else t.name===`style`&&(n.value=tE(n.value,t.value));else e.attributes.push(t)}}),e.children=t.children)}e.children.forEach(e=>{oE(e)})}}function sE(e){if(Object.hasOwn(e,`children`)){let t=e,n=[];t.children.forEach(e=>{e.type===`mdxJsxTextElement`&&e.name===`u`?n.push({type:`html`,value:`<u>`},...e.children,{type:`html`,value:`</u>`}):(n.push(e),sE(e))}),t.children=n}}var cE=/\s+$/,lE=/^\s+/;function uE(e,t){if(e.type===`strong`||e.type===`emphasis`){let n=e.children.at(-1);if(n?.type===`text`){let r=cE.exec(n.value);if(r){n.value=n.value.replace(cE,``);let i=t.at(-1);i&&(i.children.splice(i.children.indexOf(e)+1,0,{type:`text`,value:r[0]}),uE(i,t.slice(0,-1)))}}let r=e.children.at(0);if(r?.type===`text`){let n=lE.exec(r.value);if(n){r.value=r.value.replace(lE,``);let i=t.at(-1);i&&(i.children.splice(i.children.indexOf(e),0,{type:`text`,value:n[0]}),uE(i,t.slice(0,-1)))}}}if(`children`in e&&e.children.length>0){let n=e;n.children.forEach(e=>{uE(e,[...t,n])})}}function dE({root:e,toMarkdownOptions:t,toMarkdownExtensions:n,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:a}){return GT(aE({root:e,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:a}),{extensions:n,...t})+`
|
|
76
|
+
`}var fE={}.hasOwnProperty;function pE(e){let t={},n=-1;for(;++n<e.length;)mE(t,e[n]);return t}function mE(e,t){let n;for(n in t){let r=(fE.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){fE.call(r,a)||(r[a]=[]);let e=i[a];hE(r[a],Array.isArray(e)?e:e?[e]:[])}}}function hE(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);mx(e,0,0,r)}function gE(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}function _E(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&_x(e.charCodeAt(n+1))&&_x(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}var vE={tokenize:yE};function yE(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),kC(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var bE={tokenize:SE},xE={tokenize:CE};function SE(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return mx(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(xE,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(xE,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;mx(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function CE(e,t,n){return kC(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var wE={name:`attention`,resolveAll:TE,tokenize:EE};function TE(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};DE(d,-c),DE(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=hx(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=hx(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=hx(l,kx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=hx(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=hx(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,mx(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function EE(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ox(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Ox(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function DE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var OE={name:`autolink`,tokenize:kE};function kE(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return gx(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||_x(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||_x(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||yx(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):vx(t)?(e.consume(t),l):n(t)}function u(e){return _x(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||_x(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var AE={partial:!0,tokenize:jE};function jE(e,t,n){return r;function r(t){return wx(t)?kC(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||q(e)?t(e):n(e)}}var ME={continuation:{tokenize:PE},exit:FE,name:`blockQuote`,tokenize:NE};function NE(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return wx(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function PE(e,t,n){let r=this;return i;function i(t){return wx(t)?kC(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ME,t,n)(r)}}function FE(e){e.exit(`blockQuote`)}var IE={name:`characterEscape`,tokenize:LE};function LE(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Sx(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var RE={name:`characterReference`,tokenize:zE};function zE(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=_x,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=xx,u):(e.enter(`characterReferenceValue`),a=7,o=bx,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===_x&&!$x(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var BE={partial:!0,tokenize:UE},VE={concrete:!0,name:`codeFenced`,tokenize:HE};function HE(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),wx(t)?kC(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(BE,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):wx(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),kC(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&wx(t)?kC(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||q(t)?e.check(BE,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),wx(t)?kC(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),wx(t)?kC(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function UE(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var WE={name:`codeIndented`,tokenize:KE},GE={partial:!0,tokenize:qE};function KE(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),kC(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):q(t)?e.attempt(GE,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||q(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function qE(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):kC(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):q(e)?i(e):n(e)}}var JE={name:`codeText`,previous:XE,resolve:YE,tokenize:ZE};function YE(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function XE(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function ZE(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var QE=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&$E(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),$E(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),$E(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);$E(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);$E(this.left,t.reverse())}}};function $E(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function eD(e){let t={},n=-1,r,i,a,o,s,c,l,u=new QE(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,tD(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return mx(e,0,1/0,u.slice(0)),!l}function tD(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var nD={resolve:iD,tokenize:aD},rD={partial:!0,tokenize:oD};function iD(e){return eD(e),e}function aD(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):q(t)?e.check(rD,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function oD(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),kC(e,a,`linePrefix`)}function a(i){if(i===null||q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function sD(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||yx(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Cx(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||yx(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function cD(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!wx(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function lD(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),kC(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function uD(e,t){let n;return r;function r(i){return q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):wx(i)?kC(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var dD={name:`definition`,tokenize:pD},fD={partial:!0,tokenize:mD};function pD(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return cD.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=gE(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Cx(t)?uD(e,l)(t):l(t)}function l(t){return sD(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(fD,d,d)(t)}function d(t){return wx(t)?kC(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function mD(e,t,n){return r;function r(t){return Cx(t)?uD(e,i)(t):n(t)}function i(t){return lD(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return wx(t)?kC(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||q(e)?t(e):n(e)}}var hD={name:`hardBreakEscape`,tokenize:gD};function gD(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var _D={name:`headingAtx`,resolve:vD,tokenize:yD};function vD(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},mx(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function yD(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Cx(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||q(n)?(e.exit(`atxHeading`),t(n)):wx(n)?kC(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Cx(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var bD=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),xD=[`pre`,`script`,`style`,`textarea`],SD={concrete:!0,name:`htmlFlow`,resolveTo:TD,tokenize:wee},CD={partial:!0,tokenize:Eee},wD={partial:!0,tokenize:Tee};function TD(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function wee(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ee):gx(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):gx(a)?(e.consume(a),i=4,r.interrupt?t:ee):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ee):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return gx(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Cx(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&xD.includes(l)?(i=1,r.interrupt?t(s):O(s)):bD.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||_x(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return wx(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||gx(t)?(e.consume(t),b):wx(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||_x(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):wx(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):wx(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Cx(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||wx(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||q(t)?O(t):wx(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),ee):t===93&&i===5?(e.consume(t),F):q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(CD,ne,k)(t)):t===null||q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(wD,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),ee):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return xD.includes(n)?(e.consume(t),te):O(t)}return gx(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),ee):O(t)}function ee(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),ee):O(t)}function te(t){return t===null||q(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function Tee(e,t,n){let r=this;return i;function i(t){return q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Eee(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(AE,t,n)}}var Dee={name:`htmlText`,tokenize:Oee};function Oee(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):gx(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):gx(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):q(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):q(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):q(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):q(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return gx(t)?(e.consume(t),S):n(t)}function S(t){return t===45||_x(t)?(e.consume(t),S):C(t)}function C(t){return q(t)?(o=C,N(t)):wx(t)?(e.consume(t),C):M(t)}function w(t){return t===45||_x(t)?(e.consume(t),w):t===47||t===62||Cx(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||gx(t)?(e.consume(t),E):q(t)?(o=T,N(t)):wx(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||_x(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):q(t)?(o=D,N(t)):wx(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):q(t)?(o=O,N(t)):wx(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):q(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Cx(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Cx(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return wx(t)?kC(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var ED={name:`labelEnd`,resolveAll:Mee,resolveTo:Nee,tokenize:Pee},kee={tokenize:Fee},Aee={tokenize:Iee},jee={tokenize:Lee};function Mee(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&mx(e,0,e.length,n),e}function Nee(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=hx(s,e.slice(a+1,a+r+3)),s=hx(s,[[`enter`,u,t]]),s=hx(s,kx(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=hx(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=hx(s,e.slice(o+1)),s=hx(s,[[`exit`,c,t]]),mx(e,a,e.length,s),e}function Pee(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(gE(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(kee,u,o?u:d)(t):t===91?e.attempt(Aee,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(jee,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Fee(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Cx(t)?uD(e,a)(t):a(t)}function a(t){return t===41?u(t):sD(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Cx(t)?uD(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?lD(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Cx(t)?uD(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Iee(e,t,n){let r=this;return i;function i(t){return cD.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(gE(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Lee(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Ree={name:`labelStartImage`,resolveAll:ED.resolveAll,tokenize:zee};function zee(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Bee={name:`labelStartLink`,resolveAll:ED.resolveAll,tokenize:Vee};function Vee(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var DD={name:`lineEnding`,tokenize:Hee};function Hee(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),kC(e,t,`linePrefix`)}}var OD={name:`thematicBreak`,tokenize:Uee};function Uee(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),wx(t)?kC(e,s,`whitespace`)(t):s(t))}}var kD={continuation:{tokenize:qee},exit:Yee,name:`list`,tokenize:Kee},Wee={partial:!0,tokenize:Xee},Gee={partial:!0,tokenize:Jee};function Kee(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:bx(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(OD,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return bx(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(AE,r.interrupt?n:u,e.attempt(Wee,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return wx(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function qee(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(AE,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,kC(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!wx(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Gee,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,kC(e,e.attempt(kD,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Jee(e,t,n){let r=this;return kC(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Yee(e){e.exit(this.containerState.type)}function Xee(e,t,n){let r=this;return kC(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!wx(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var AD={name:`setextUnderline`,resolveTo:Zee,tokenize:Qee};function Zee(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Qee(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),wx(t)?kC(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var $ee={tokenize:ete};function ete(e){let t=this,n=e.attempt(AE,r,e.attempt(this.parser.constructs.flowInitial,i,kC(e,e.attempt(this.parser.constructs.flow,i,e.attempt(nD,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var tte={resolveAll:MD()},nte=jD(`string`),rte=jD(`text`);function jD(e){return{resolveAll:MD(e===`text`?ite:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function MD(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function ite(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var ate=e({attentionMarkers:()=>pte,contentInitial:()=>ste,disable:()=>mte,document:()=>ote,flow:()=>lte,flowInitial:()=>cte,insideSpan:()=>fte,string:()=>ute,text:()=>dte}),ote={42:kD,43:kD,45:kD,48:kD,49:kD,50:kD,51:kD,52:kD,53:kD,54:kD,55:kD,56:kD,57:kD,62:ME},ste={91:dD},cte={[-2]:WE,[-1]:WE,32:WE},lte={35:_D,42:OD,45:[AD,OD],60:SD,61:AD,95:OD,96:VE,126:VE},ute={38:RE,92:IE},dte={[-5]:DD,[-4]:DD,[-3]:DD,33:Ree,38:RE,42:wE,60:[OE,Dee],91:Bee,92:[hD,IE],93:ED,95:wE,96:JE},fte={null:[wE,tte]},pte={null:[42,95]},mte={null:[]};function hte(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=hx(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=kx(a,l.events,l),l.events):[]}function f(e,t){return _te(p(e),t)}function p(e){return gte(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&mx(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function gte(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function _te(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
77
|
+
`;break;case-3:o=`\r
|
|
78
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function vte(e){let t={constructs:pE([ate,...(e||{}).extensions||[]]),content:n(vE),defined:[],document:n(bE),flow:n($ee),lazy:{},string:n(nte),text:n(rte)};return t;function n(e){return n;function n(n){return hte(t,e,n)}}}function yte(e){for(;!eD(e););return e}var ND=/[\0\t\n\r]/g;function PD(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(ND.lastIndex=u,c=ND.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var FD={}.hasOwnProperty;function ID(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),LD(n)(yte(vte(n).document().write(PD()(e,t,!0))))}function LD(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(xe),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(Se),thematicBreak:a(we)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ae,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:I,resourceDestinationString:ee,resourceTitleString:te,resource:ne,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};zD(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];FD.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||BD).call(a,void 0,e[0])}for(r.position={start:RD(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:RD(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:RD(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||BD).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+oS({start:e.start,end:e.end})+`): it’s not open`);n.position.end=RD(e.end)}function u(){return Ww(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=gE(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ce(),n.position={start:RD(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=RD(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=RD(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=MT(t),n.identifier=gE(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function I(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=gE(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ie(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=AT(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=$x(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=RD(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function xe(){return{type:`paragraph`,children:[]}}function Se(){return{type:`strong`,children:[]}}function Ce(){return{type:`text`,value:``}}function we(){return{type:`thematicBreak`}}}function RD(e){return{line:e.line,column:e.column,offset:e.offset}}function zD(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?zD(e,r):bte(e,r)}}function bte(e,t){let n;for(n in t)if(FD.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function BD(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+oS({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oS({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+oS({start:t.start,end:t.end})+`) is still open`)}function VD(e){return e.children instanceof Array}var HD=class extends Error{constructor(e,t){super(e),this.name=`MarkdownParseError`,this.cause=t}},UD=class extends Error{constructor(e){super(e),this.name=`UnrecognizedMarkdownConstructError`}};function WD(e){let t=new Map;return e.type===`root`?(e.children.filter(e=>e.type===`mdxjsEsm`).filter(e=>e.value.startsWith(`import `)).forEach(e=>{(e.data?.estree?.body??[]).forEach(e=>{e.type===`ImportDeclaration`&&e.specifiers.forEach(n=>{t.set(n.local.name,{source:`${e.source.value}`,defaultExport:n.type===`ImportDefaultSpecifier`})})})}),{importDeclarations:Object.fromEntries(t.entries())}):{importDeclarations:{}}}function GD({root:e,markdown:t,visitors:n,syntaxExtensions:r,mdastExtensions:i,...a}){let o;try{o=ID(t,{extensions:r,mdastExtensions:i})}catch(e){throw e instanceof Error?new HD(`Error parsing markdown: ${e.message}`,e):new HD(`Error parsing markdown: ${e}`,e)}o.children.length===0&&o.children.push({type:`paragraph`,children:[]}),o.children.at(-1)?.type!==`paragraph`&&o.children.push({type:`paragraph`,children:[]}),KD({root:e,mdastRoot:o,visitors:n,...a})}function KD({root:e,mdastRoot:t,visitors:n,...r}){let i=new WeakMap,a=new WeakMap,o=WD(t);n=n.sort((e,t)=>(t.priority??0)-(e.priority??0));function s(e,t){if(!VD(e))throw Error(`Attempting to visit children of a non-parent`);e.children.forEach(n=>{c(n,t,e)})}function c(e,t,l,u=null){let d=n.find((t,n)=>u?.has(n)?!1:typeof t.testNode==`string`?t.testNode===e.type:t.testNode(e,r));if(!d)try{throw new UD(`Unsupported markdown syntax: ${GT(e)}`)}catch{throw new UD(`Parsing of the following markdown structure failed: ${JSON.stringify({type:e.type,name:`name`in e?e.name:`N/A`})}`)}d.visitNode({mdastNode:e,lexicalParent:t,mdastParent:l,descriptors:r,metaData:o,actions:{visitChildren:s,nextVisitor(){c(e,t,l,(u??new Set).add(n.indexOf(d)))},addAndStepInto(n){t.append(n),VD(e)&&s(e,n)},addFormatting(t,n){n||VD(e)&&(n=e),n&&i.set(n,t|(i.get(l)??0))},removeFormatting(t,n){n||VD(e)&&(n=e),n&&i.set(n,t^(i.get(l)??0))},getParentFormatting(){return i.get(l)??0},addStyle(t,n){n||VD(e)&&(n=e),n&&a.set(n,t)},getParentStyle(){return a.get(l)??``}}})}c(t,e,null)}var xte=Object.defineProperty,Ste=(e,t,n)=>t in e?xte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qD=(e,t,n)=>(Ste(e,typeof t==`symbol`?t:t+``,n),n),JD=`generic-html`,YD=class e extends Pg{constructor(e,t,n,r){super(r),qD(this,`__tag`),qD(this,`__nodeType`),qD(this,`__attributes`),this.__tag=e,this.__nodeType=t,this.__attributes=n}static getType(){return JD}static clone(t){return new e(t.__tag,t.__nodeType,t.__attributes,t.__key)}getTag(){return this.__tag}getNodeType(){return this.__nodeType}getAttributes(){return this.__attributes}updateAttributes(e){let t=this.getWritable();t.__attributes=e}getStyle(){return this.__attributes.find(e=>e.name===`style`)?.value}createDOM(){let e=this.__tag,t=document.createElement(e);return this.__attributes.forEach(e=>{t.setAttribute(e.name,e.value)}),t}updateDOM(){return!1}static importDOM(){return{}}exportDOM(e){let{element:t}=super.exportDOM(e);return{element:t}}static importJSON(e){let t=XD(e.tag,e.mdxType,e.attributes);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),attributes:this.__attributes,mdxType:this.__nodeType,type:JD,version:1}}extractWithChild(){return!0}isInline(){return this.__nodeType===`mdxJsxTextElement`}};function XD(e,t,n){return lv(new YD(e,t,n))}function ZD(e){return e instanceof YD}var QD={testLexicalNode:ZD,visitLexicalNode({actions:e,lexicalNode:t}){e.addAndStepInto(`mdxJsxTextElement`,{name:t.getTag(),type:t.getNodeType(),attributes:t.getAttributes()})},priority:-100},$D={testLexicalNode:lh,visitLexicalNode:({mdastParent:e,actions:t})=>{t.appendToParent(e,{type:`text`,value:`
|
|
79
|
+
`})}},eO={testLexicalNode:Xg,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`paragraph`)}},tO={testLexicalNode:zg,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`root`)}};function nO(e){return e.type===`text`}var rO=[`u`,`span`,`sub`,`sup`],iO={shouldJoin:(e,t)=>{if([`text`,`emphasis`,`strong`,`highlight`].includes(e.type))return e.type===t.type;if(e.type===`mdxJsxTextElement`&&t.type===`mdxJsxTextElement`&&rO.includes(t.name)){let n=t;return e.name===n.name&&JSON.stringify(e.attributes)===JSON.stringify(n.attributes)}return!1},join(e,t){return nO(e)&&nO(t)?{type:`text`,value:e.value+t.value}:{...e,children:[...e.children,...t.children]}},testLexicalNode:H,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{let r=e.getPreviousSibling(),i=H(r)?r.getFormat():0,a=e.getTextContent(),o=e.getFormat(),s=e.getStyle(),c=t;if(s&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`span`,children:[],attributes:[{type:`mdxJsxAttribute`,name:`style`,value:s}]})),i&o&8&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`u`,children:[],attributes:[]})),i&o&64&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sup`,children:[],attributes:[]})),i&o&32&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sub`,children:[],attributes:[]})),i&o&2&&(c=n.appendToParent(c,{type:`emphasis`,children:[]})),i&o&1&&(c=n.appendToParent(c,{type:`strong`,children:[]})),i&o&4&&(c=n.appendToParent(c,{type:`delete`,children:[]})),i&o&128&&(c=n.appendToParent(c,{type:`highlight`,children:[]})),o&8&&!(i&8)&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`u`,children:[],attributes:[]})),o&64&&!(i&64)&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sup`,children:[],attributes:[]})),o&32&&!(i&32)&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sub`,children:[],attributes:[]})),o&2&&!(i&2)&&(c=n.appendToParent(c,{type:`emphasis`,children:[]})),o&1&&!(i&1)&&(c=n.appendToParent(c,{type:`strong`,children:[]})),o&4&&!(i&4)&&(c=n.appendToParent(c,{type:`delete`,children:[]})),o&128&&!(i&128)&&(c=n.appendToParent(c,{type:`highlight`,children:[]})),o&16){n.appendToParent(c,{type:`inlineCode`,value:a});return}n.appendToParent(c,{type:`text`,value:a})}},aO={testNode:`break`,visitNode:function({lexicalParent:e}){e.append(ch())}};function oO(e,t){return[{testNode:t=>t.type===`mdxJsxTextElement`&&t.name===e,visitNode({actions:e,mdastNode:n,lexicalParent:r}){e.addFormatting(t),e.visitChildren(n,r)}},{testNode:t=>t.type===`html`&&t.value===`<${e}>`,visitNode({actions:e,mdastParent:n}){e.addFormatting(t,n)}},{testNode:t=>t.type===`html`&&t.value===`</${e}>`,visitNode({actions:e,mdastParent:n}){e.removeFormatting(t,n)}}]}var sO={testNode:`delete`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(4),t.visitChildren(e,n)}},cO={testNode:`highlight`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(128),t.visitChildren(e,n)}},lO={testNode:`inlineCode`,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(Eh(e.value).setFormat(t.getParentFormatting()|16))}},uO=[{testNode:`emphasis`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(2),t.visitChildren(e,n)}},{testNode:`strong`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(1),t.visitChildren(e,n)}},...oO(`u`,8),...oO(`code`,16),lO,sO,cO,...oO(`sup`,64),...oO(`sub`,32)],dO={testNode:$T,visitNode:function({mdastNode:e,actions:t,lexicalParent:n}){e.name===`span`&&e.attributes.length===1&&e.attributes[0].type===`mdxJsxAttribute`&&e.attributes[0].name===`style`?(t.addStyle(e.attributes[0].value,e),t.visitChildren(e,n)):t.addAndStepInto(XD(e.name,e.type,e.attributes))},priority:-100},fO=[`listitem`,`admonition`],pO={testNode:`paragraph`,visitNode:function({mdastNode:e,lexicalParent:t,actions:n}){fO.includes(t.getType())?n.visitChildren(e,t):n.addAndStepInto(Yg())}},mO={testNode:`root`,visitNode({actions:e,mdastNode:t,lexicalParent:n}){e.visitChildren(t,n)}},hO={testNode:`text`,visitNode({mdastNode:e,actions:t}){let n=Eh(e.value);n.setFormat(t.getParentFormatting());let r=t.getParentStyle();r!==``&&n.setStyle(r),t.addAndStepInto(n)}},Cte=()=>L.createElement(wb,{externalHistoryState:Id(kk)});function wte(e){return{canContainEols:[`comment`],enter:{comment(e){this.buffer()}},exit:{comment(e){this.resume()}}}}var gO=(e,t,n)=>{return r;function r(t){return e.enter(`comment`),e.consume(t),i}function i(t){return t===fC.exclamationMark?(e.consume(t),a):n(t)}function a(t){return t===fC.dash?(e.consume(t),o):n(t)}function o(t){return t===fC.dash?(e.consume(t),s):n(t)}function s(t){return t===fC.greaterThan?n(t):q(t)?u(t):(e.enter(mC.data),t===fC.dash?(e.consume(t),c):l(t))}function c(e){return e===fC.greaterThan?n(e):l(e)}function l(t){return t===fC.eof?n(t):t===fC.dash?(e.consume(t),f):q(t)?(e.exit(mC.data),u(t)):(e.consume(t),l)}function u(t){return e.enter(mC.lineEnding),e.consume(t),e.exit(mC.lineEnding),kC(e,d,mC.linePrefix)}function d(t){return q(t)?u(t):(e.enter(mC.data),l(t))}function f(t){return t===fC.dash?(e.consume(t),p):l(t)}function p(n){return n===fC.greaterThan?(e.exit(mC.data),e.enter(`commentEnd`),e.consume(n),e.exit(`commentEnd`),e.exit(`comment`),t(n)):n===fC.dash?(e.consume(n),p):l(n)}},Tte={flow:{60:{tokenize:gO,concrete:!0}},text:{60:{tokenize:gO}}},_O={bold:`_bold_1tncs_10`,italic:`_italic_1tncs_14`,underline:`_underline_1tncs_18`,strikethrough:`_strikethrough_1tncs_34`,underlineStrikethrough:`_underlineStrikethrough_1tncs_38`,subscript:`_subscript_1tncs_42`,superscript:`_superscript_1tncs_47`,code:`_code_1tncs_52`,nestedListItem:`_nestedListItem_1tncs_59`,listitem:`_listitem_1tncs_69`,listItemChecked:`_listItemChecked_1tncs_73`,listItemUnchecked:`_listItemUnchecked_1tncs_74`,admonitionDanger:`_admonitionDanger_1tncs_151`,admonitionInfo:`_admonitionInfo_1tncs_152`,admonitionNote:`_admonitionNote_1tncs_153`,admonitionTip:`_admonitionTip_1tncs_154`,admonitionCaution:`_admonitionCaution_1tncs_155`,mdxExpression:`_mdxExpression_1tncs_188`},vO={text:{bold:_O.bold,italic:_O.italic,underline:_O.underline,code:_O.code,strikethrough:_O.strikethrough,subscript:_O.subscript,superscript:_O.superscript,underlineStrikethrough:_O.underlineStrikethrough},list:{listitem:_O.listitem,listitemChecked:_O.listItemChecked,listitemUnchecked:_O.listItemUnchecked,nested:{listitem:_O.nestedListItem}},admonition:{danger:_O.admonitionDanger,info:_O.admonitionInfo,note:_O.admonitionNote,tip:_O.admonitionTip,caution:_O.admonitionCaution}},yO=Bp(`NESTED_EDITOR_UPDATED_COMMAND`),bO=B(null),xO=B(null),SO=B(``),CO=B(!0),wO=B(!1,e=>{e.sub(e.pipe(wO,Bd(bO)),([e,t])=>{t?.setEditable(!e)})}),TO=B(``),EO=B(!1),DO=B(!1),OO=B(0),kO=B(null),AO=Md(e=>{e.link(e.pipe(kO,Vd(e=>e!==null)),AO)}),jO=Md(e=>{e.sub(e.pipe(jO,Bd(xO)),([e,t])=>{t?.dispatchCommand(Qp,e)})}),MO=B(null,e=>{e.sub(e.pipe(MO,Bd(xO)),([t,n])=>{if(!t||!n)return;let r=t.anchor.getNode(),i=r.getKey()===`root`?r:rb(r,e=>{let t=e.getParent();return t!==null&&cv(t)});i??=r.getTopLevelElementOrThrow();let a=i.getKey();if(n.getElementByKey(a)!==null){let t=cx(i)?i.getTag():i.getType();e.pub(Ak,t)}})}),NO=B(``),PO=B(``),FO=B(!1),IO=Md(e=>{e.link(PO,IO),e.sub(NO,t=>{e.pubIn({[FO]:!0,[PO]:t})})}),LO=Md(e=>{e.link(e.pipe(IO,Bd(ik),Vd(([,e])=>!e),zd(([e])=>e)),LO)},!0),RO=B([]),zO=B([]),BO=B([]),VO=B([]),HO=B([]),UO=B([]),WO=B({}),GO=B(!1),KO=B([]),qO=B([]),JO=B([]),YO=B(null),XO=B(null),ZO=B(null),QO=pk(zO),$O=pk(RO),ek=pk(BO),tk=pk(VO),nk=pk(HO),rk=pk(UO),ik=B(!1),ak=Md(e=>{e.sub(e.pipe(ak,Bd(PO,bO,DO),Vd(([e,t])=>e.trim()!==t.trim())),([t,,n,r])=>{e.pub(ik,!0),n?.update(()=>{k_().clear(),_k(e,k_(),t),r?n.focus():j_(null)},{onUpdate:()=>{e.pub(ik,!1)}})})}),ok=Md(e=>{e.sub(e.pipe(ok,Bd(xO,DO)),([t,n,r])=>{n?.update(()=>{let i=W();if(i!==null){let n={children:[],append(e){this.children.push(e)},getType(){return i.getNodes()[0].getType()}};_k(e,n,t),ig(n.children)}r?n.focus():j_(null)})})});function sk(){return Hd((e,[t,n])=>(e.forEach(e=>{if(!e)throw Error(`You have a subscription that does not return a teardown`);e()}),n?t.map(e=>e(n)):[]),[])}var Ete=B(null),ck=B([],e=>{e.pipe(e.combine(ck,xO),sk())}),lk=B([],e=>{e.pipe(e.combine(lk,bO),sk())}),uk=B(null,Wd,(e,t)=>!!(e&&t&&e.editorRef===t.editorRef)),dk=Md(),fk=B(e=>{throw Error(`No icon component for ${e}`)});function pk(e,t){return Md((n,r)=>{n.changeWith(e,r,(e,t)=>{Array.isArray(t)||(t=[t]);let n=e;for(let r of t)e.includes(r)||(n=[...n,r]);return n}),t?.(n,r)})}function mk(e){let t=W();U(t)&&e.pubIn({[MO]:t,[OO]:t.format})}var hk=pk(lk,(e,t)=>{e.pub(t,[t=>t.registerCommand(Vp,(t,n)=>(e.pubIn({[xO]:n,[DO]:!0}),n._parentEditor===null&&n.getEditorState().read(()=>{e.pub(uk,{rootNode:k_(),editorType:`lexical`,editorRef:n})}),mk(e),!1),4),t=>t.registerUpdateListener(({dirtyElements:n,dirtyLeaves:r,editorState:i})=>{if(e.getValue(kO)!==null||n.size===0&&r.size===0)return;let a;i.read(()=>{k_().getLastChild()instanceof Ig&&t.update(()=>{k_().append(Yg())},{discrete:!0}),a=dE({root:k_(),visitors:e.getValue(HO),jsxComponentDescriptors:e.getValue(KO),toMarkdownExtensions:e.getValue(UO),toMarkdownOptions:e.getValue(WO),jsxIsAvailable:e.getValue(GO)})}),e.pub(PO,a.trim()),e.pub(FO,!1)}),t=>t.registerCommand(Dm,()=>(e.pub(DO,!0),!1),4)])}),gk=pk(ck,(e,t)=>{e.pub(t,[t=>t.registerUpdateListener(({editorState:t})=>{t.read(()=>{mk(e)})}),t=>t.registerCommand(Om,t=>{let n=e.getValue(bO);return n&&(n.getRootElement()?.contains(t.relatedTarget)||e.pubIn({[DO]:!1,[dk]:t})),!1},4)])});function _k(e,t,n){try{GD({root:t,visitors:e.getValue(RO),mdastExtensions:e.getValue(VO),markdown:n,syntaxExtensions:e.getValue(BO),jsxComponentDescriptors:e.getValue(KO),directiveDescriptors:e.getValue(qO),codeBlockEditorDescriptors:e.getValue(JO)}),e.pub(kO,null)}catch(t){if(t instanceof HD||t instanceof UD)e.pubIn({[PO]:n,[kO]:{error:t.message,source:n}});else throw t}}var vk=B([]),yk=pk(vk),bk=B([]),xk=pk(bk),Sk=B([]),Ck=pk(Sk),wk=B([]);pk(wk);var Tk=pk(B([])),Ek=B([]),Dk=pk(Ek),Ok=B(!1,e=>{e.link(e.pipe(xO,zd(e=>[`td`,`th`].includes((e?.getRootElement()?.parentNode)?.nodeName.toLowerCase()??``))),Ok)}),kk=B(Cb()),Ak=B(``);Md();var jk=Md(e=>{e.sub(e.pipe(jk,Bd(xO)),([e,t])=>{t?.update(()=>{let n=W();U(n)&&(Ly(n,e),setTimeout(()=>{t.focus()}))})})}),Mk=Md(e=>{e.sub(e.pipe(Mk,Bd(xO)),([e,t])=>{t?.focus(()=>{t.getEditorState().read(()=>{U(W())&&(t.update(()=>{let t=e();t.isInline()?(ig([t]),cv(t.getParentOrThrow())&&ob(t,Yg).selectEnd()):ib(t),setTimeout(()=>{`select`in t&&typeof t.select==`function`&&t.select()})}),setTimeout(()=>{t.dispatchCommand(yO,void 0)}))})},{defaultSelection:`rootEnd`})})}),Nk=B(`rich-text`,e=>{function t(){return Hd((e,t)=>({current:e.next,next:t}),{current:`rich-text`,next:`rich-text`})}e.sub(e.pipe(Nk,t(),Bd(Pk)),([{current:t},n])=>{(t===`source`||t===`diff`)&&e.pub(ak,n)}),e.sub(e.pipe(Nk,t(),Vd(e=>e.current===`rich-text`),Bd(xO)),([,e])=>{e?.dispatchCommand(yO,void 0)})}),Pk=B(``,e=>{e.link(PO,Pk),e.link(Pk,IO)},!0),Fk=B([]),Ik=pk(Fk),Lk=B(()=>{throw Error(`No translation function provided`)}),Rk=B(vO),zk=Gd({init(e,t){let n=t?.initialMarkdown??``;e.register(hk),e.register(gk),e.register(IO),e.register(Pk),e.pubIn({[NO]:t?.trim?n.trim():n,[fk]:t?.iconComponentFor,[$O]:[mO,pO,hO,aO,...uO],[QO]:[qg,_h,YD],[nk]:[tO,eO,iO,$D,QD],[SO]:t?.contentEditableClassName,[CO]:t?.spellCheck,[WO]:t?.toMarkdownOptions,[EO]:t?.autoFocus,[TO]:t?.placeholder,[wO]:t?.readOnly,[Lk]:t?.translation,[tk]:[Mx(),zx],[ek]:[Ax(),yC()],[rk]:[xee(),Nx(),Hx],[Rk]:t?.lexicalTheme??vO}),e.singletonSub(AO,t?.onError),e.singletonSub(LO,n=>{t?.onChange(n,e.getValue(FO))}),e.singletonSub(dk,t?.onBlur),t?.suppressHtmlProcessing||e.pubIn({[tk]:[bee(),wte()],[ek]:[ow(),sw(),Tte],[$O]:dO}),t?.suppressSharedHistory||e.pub(yk,Cte)},postInit(e,t){let n=Qg({editable:t?.readOnly!==!0,namespace:t?.lexicalEditorNamespace??`MDXEditor`,nodes:[...e.getValue(zO),...t?.additionalLexicalNodes??[]],onError:e=>{throw e},theme:e.getValue(Rk)});t?.editorState!==null&&n.update(()=>{let r=t?.initialMarkdown.trim()??``;_k(e,k_(),r);let i=t?.autoFocus;if(i){if(i===!0){setTimeout(()=>{n.focus(Wd,{defaultSelection:`rootStart`})});return}setTimeout(()=>{n.focus(Wd,{defaultSelection:i.defaultSelection??`rootStart`})})}}),e.pub(bO,n),e.pub(xO,n)},update(e,t){e.pubIn({[SO]:t?.contentEditableClassName,[CO]:t?.spellCheck,[WO]:t?.toMarkdownOptions,[EO]:t?.autoFocus,[TO]:t?.placeholder,[wO]:t?.readOnly}),e.singletonSub(LO,n=>{t?.onChange(n,e.getValue(FO))}),e.singletonSub(dk,t?.onBlur),e.singletonSub(AO,t?.onError)}});function Bk(){return Id(Lk)}function Vk(){return k_().getTextContent()}function Hk(e,t=!0){if(e)return!1;let n=Vk();return t&&(n=n.trim()),n===``}function Uk(e){if(!Hk(e,!1))return!1;let t=k_().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(Lg(n))return!1;if(G(n)){if(!Xg(n)||n.__indent!==0)return!1;let t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){let n=t[e];if(!H(n))return!1}}}return!0}function Wk(e){return()=>Uk(e)}var Gk=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function Kk({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:m,id:h,role:g=`textbox`,spellCheck:_=!0,style:v,tabIndex:y,"data-testid":b,...x},S){let[C,w]=(0,L.useState)(e.isEditable()),T=(0,L.useCallback)((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),E=(0,L.useMemo)((()=>function(...e){return t=>{e.forEach((e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)}))}}(S,T)),[T,S]);return Gk((()=>(w(e.isEditable()),e.registerEditableListener((e=>{w(e)})))),[e]),(0,R.jsx)(`div`,{"aria-activedescendant":C?t:void 0,"aria-autocomplete":C?n:`none`,"aria-controls":C?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":C&&g===`combobox`?!!o:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":C?d:void 0,"aria-readonly":!C||void 0,"aria-required":f,autoCapitalize:p,className:m,contentEditable:C,"data-testid":b,id:h,ref:E,role:g,spellCheck:_,style:v,tabIndex:y,...x})}var qk=(0,L.forwardRef)(Kk);function Jk(e){return e.getEditorState().read(Wk(e.isComposing()))}var Yk=(0,L.forwardRef)(Xk);function Xk(e,t){let{placeholder:n,...r}=e,[i]=Yd();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(qk,{editor:i,...r,ref:t}),n!=null&&(0,R.jsx)(Zk,{editor:i,content:n})]})}function Zk({content:e,editor:t}){let n=function(e){let[t,n]=(0,L.useState)((()=>Jk(e)));return Gk((()=>{function t(){n(Jk(e))}return t(),Xy(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,i]=(0,L.useState)(t.isEditable());if((0,L.useLayoutEffect)((()=>(i(t.isEditable()),t.registerEditableListener((e=>{i(e)})))),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:(0,R.jsx)(`div`,{"aria-hidden":!0,children:a})}function Qk(e,t){return Qk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qk(e,t)}var $k={error:null},eA=function(e){var t,n;function r(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).state=$k,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];t.props.onReset==null||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Qk(t,n),r.getDerivedStateFromError=function(e){return{error:e}};var i=r.prototype;return i.reset=function(){this.setState($k)},i.componentDidCatch=function(e,t){var n,r;(n=(r=this.props).onError)==null||n.call(r,e,t)},i.componentDidUpdate=function(e,t){var n,r,i,a,o=this.state.error,s=this.props.resetKeys;o!==null&&t.error!==null&&((i=e.resetKeys)===void 0&&(i=[]),(a=s)===void 0&&(a=[]),i.length!==a.length||i.some((function(e,t){return!Object.is(e,a[t])})))&&((n=(r=this.props).onResetKeysChange)==null||n.call(r,e.resetKeys,s),this.reset())},i.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,i=t.fallback;if(e!==null){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(L.isValidElement(i))return i;if(typeof n==`function`)return n(a);if(r)return L.createElement(r,a);throw Error(`react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop`)}return this.props.children},r}(L.Component);function tA({children:e,onError:t}){return(0,R.jsx)(eA,{fallback:(0,R.jsx)(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}),onError:t,children:e})}var nA=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function rA(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function Dte(){return function(e){let[t]=Yd(),n=(0,L.useMemo)((()=>e(t)),[t,e]),[r,i]=(0,L.useState)((()=>n.initialValueFn())),a=(0,L.useRef)(r);return nA((()=>{let{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,i(r)),t((e=>{a.current=e,i(e)}))}),[n,e]),r}(rA)}function iA(e){let t=window.location.origin,n=n=>{if(n.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let i=n.data;if(typeof i==`string`){let t;try{t=JSON.parse(i)}catch{return}if(t&&t.protocol===`nuanria_messaging`&&t.type===`request`){let r=t.payload;if(r&&r.functionId===`makeChanges`){let t=r.args;if(t){let[r,i,a,o,s,c]=t;e.update((()=>{let e=W();if(U(e)){let t=e.anchor,c=t.getNode(),l=0,u=0;if(H(c)&&r>=0&&i>=0&&(l=r,u=r+i,e.setTextNodeRange(c,l,c,u)),l===u&&a===``||(e.insertRawText(a),c=t.getNode()),H(c)){l=o,u=o+s;let t=c.getTextContentSize();l=l>t?t:l,u=u>t?t:u,e.setTextNodeRange(c,l,c,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener(`message`,n,!0),()=>{window.removeEventListener(`message`,n,!0)}}var aA=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function oA(e){return e.getEditorState().read(Wk(e.isComposing()))}function sA({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[r]=Yd(),i=function(e,t){let[n,r]=(0,L.useState)((()=>e.getDecorators()));return aA((()=>e.registerDecoratorListener((e=>{(0,Ma.flushSync)((()=>{r(e)}))}))),[e]),(0,L.useEffect)((()=>{r(e.getDecorators())}),[e]),(0,L.useMemo)((()=>{let r=[],i=Object.keys(n);for(let a=0;a<i.length;a++){let o=i[a],s=(0,R.jsx)(t,{onError:t=>e._onError(t),children:(0,R.jsx)(L.Suspense,{fallback:null,children:n[o]})}),c=e.getElementByKey(o);c!==null&&r.push((0,Ma.createPortal)(s,c,o))}return r}),[t,n,e])}(r,n);return function(e){aA((()=>Xy(px(e),iA(e))),[e])}(r),(0,R.jsxs)(R.Fragment,{children:[e,(0,R.jsx)(cA,{content:t}),i]})}function cA({content:e}){let[t]=Yd(),n=function(e){let[t,n]=(0,L.useState)((()=>oA(e)));return aA((()=>{function t(){n(oA(e))}return t(),Xy(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=Dte();return n?typeof e==`function`?e(r):e:null}var lA=n(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),uA={undo:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M7.202 18.5V17H14.3788C15.4224 17 16.3205 16.6554 17.073 15.9663C17.8257 15.2773 18.202 14.4263 18.202 13.4135C18.202 12.4007 17.8257 11.5512 17.073 10.8652C16.3205 10.1794 15.4224 9.8365 14.3788 9.8365H7.35775L10.1402 12.6193L9.0865 13.673L4.5 9.0865L9.0865 4.5L10.1402 5.55375L7.35775 8.3365H14.3788C15.8416 8.3365 17.0945 8.82467 18.1375 9.801C19.1805 10.7773 19.702 11.9815 19.702 13.4135C19.702 14.8455 19.1805 16.0513 18.1375 17.0308C17.0945 18.0103 15.8416 18.5 14.3788 18.5H7.202Z`,fill:`currentColor`})),redo:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M9.6211 18.5C8.15827 18.5 6.90535 18.0103 5.86235 17.0308C4.81935 16.0513 4.29785 14.8455 4.29785 13.4135C4.29785 11.9815 4.81935 10.7773 5.86235 9.801C6.90535 8.82467 8.15827 8.3365 9.6211 8.3365H16.6421L13.8596 5.55375L14.9134 4.5L19.4999 9.0865L14.9134 13.673L13.8596 12.6193L16.6421 9.8365H9.6211C8.57744 9.8365 7.67935 10.1794 6.92685 10.8652C6.17418 11.5512 5.79785 12.4007 5.79785 13.4135C5.79785 14.4263 6.17418 15.2773 6.92685 15.9663C7.67935 16.6554 8.57744 17 9.6211 17H16.7979V18.5H9.6211Z`,fill:`currentColor`})),format_bold:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M7.33838 18.625V5.375H12.1999C13.219 5.375 14.1405 5.69233 14.9644 6.327C15.788 6.9615 16.1999 7.816 16.1999 8.8905C16.1999 9.63783 16.0194 10.2471 15.6584 10.7182C15.2975 11.1894 14.9088 11.5314 14.4921 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3158 16.6614 14.0193 16.6614 14.9038C16.6614 16.1819 16.1902 17.1217 15.2479 17.723C14.3055 18.3243 13.3562 18.625 12.3999 18.625H7.33838ZM9.48838 16.6328H12.3191C13.1063 16.6328 13.6627 16.4142 13.9884 15.977C14.314 15.5398 14.4769 15.1206 14.4769 14.7192C14.4769 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8058 12.2729 12.8058H9.48838V16.6328ZM9.48838 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5279 10.3538C13.8835 10.0064 14.0614 9.59042 14.0614 9.10575C14.0614 8.59042 13.8733 8.16925 13.4971 7.84225C13.1208 7.51542 12.6595 7.352 12.1134 7.352H9.48838V10.875Z`,fill:`currentColor`})),format_italic:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M5.39404 18.625V16.8173H9.21129L12.4518 7.18275H8.63454V5.375H17.7883V7.18275H14.2785L11.0383 16.8173H14.5478V18.625H5.39404Z`,fill:`currentColor`})),format_underlined:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M5.34619 22.125V20.625H18.6537V22.125H5.34619ZM11.9999 18.5287C10.4448 18.5287 9.23102 18.0566 8.35869 17.1125C7.48619 16.1683 7.04994 14.9032 7.04994 13.3172V5.41345H8.90369V13.4095C8.90369 14.4198 9.17228 15.2295 9.70944 15.8385C10.2466 16.4475 11.0101 16.752 11.9999 16.752C12.9898 16.752 13.7533 16.4475 14.2904 15.8385C14.8276 15.2295 15.0962 14.4198 15.0962 13.4095V5.41345H16.9499V13.3172C16.9499 14.9032 16.5137 16.1683 15.6412 17.1125C14.7689 18.0566 13.5551 18.5287 11.9999 18.5287Z`,fill:`currentColor`})),format_highlight:L.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`},L.createElement(`path`,{d:`m9 11-6 6v3h9l3-3`}),L.createElement(`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`})),code:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M7.99994 17.6537L2.34619 11.9999L7.99994 6.34619L9.06919 7.41544L4.46919 12.0154L9.05369 16.5999L7.99994 17.6537ZM15.9999 17.6537L14.9307 16.5844L19.5307 11.9844L14.9462 7.39994L15.9999 6.34619L21.6537 11.9999L15.9999 17.6537Z`,fill:`currentColor`})),strikeThrough:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M12.15 19.6923C10.9732 19.6923 9.9315 19.359 9.025 18.6923C8.11867 18.0256 7.45525 17.1128 7.03475 15.9538L8.6385 15.2635C8.91667 16.0444 9.3545 16.6867 9.952 17.1905C10.5493 17.6944 11.2923 17.9463 12.1808 17.9463C12.9578 17.9463 13.6744 17.7508 14.3307 17.3598C14.9872 16.9686 15.3155 16.3487 15.3155 15.5C15.3155 15.123 15.2555 14.7968 15.1355 14.5213C15.0157 14.2456 14.8462 13.9885 14.627 13.75H16.677C16.7987 13.9705 16.8932 14.2256 16.9605 14.5153C17.0278 14.8051 17.0615 15.1334 17.0615 15.5C17.0615 16.8372 16.5747 17.8702 15.601 18.599C14.6272 19.3279 13.4768 19.6923 12.15 19.6923ZM2.25 11.75V10.25H21.75V11.75H2.25ZM12.05 4.19629C13.0475 4.19629 13.9123 4.42704 14.6443 4.88854C15.3763 5.35004 15.9673 6.05896 16.4173 7.01529L14.823 7.73079C14.6218 7.26029 14.2978 6.84462 13.851 6.48379C13.4042 6.12279 12.8141 5.94229 12.0808 5.94229C11.2244 5.94229 10.5392 6.16221 10.025 6.60204C9.51083 7.04171 9.264 7.59104 9.2845 8.25004H7.5385C7.50133 7.16421 7.89783 6.21712 8.728 5.40879C9.558 4.60046 10.6653 4.19629 12.05 4.19629Z`,fill:`currentColor`})),superscript:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M16.6924 8V6.2115C16.6924 5.95383 16.7786 5.73875 16.9511 5.56625C17.1235 5.39392 17.3385 5.30775 17.5961 5.30775H19.5001V4.38475H16.6924V3.5H19.4809C19.7385 3.5 19.9536 3.58625 20.1261 3.75875C20.2985 3.93108 20.3846 4.14617 20.3846 4.404V5.2885C20.3846 5.54617 20.2985 5.76125 20.1261 5.93375C19.9536 6.10608 19.7385 6.19225 19.4809 6.19225H17.5771V7.1155H20.3846V8H16.6924ZM4.44238 18.5L8.84638 11.6287L4.77713 5.30775H6.74438L9.95963 10.404H10.0214L13.2501 5.30775H15.2329L11.1194 11.6287L15.5579 18.5H13.5751L10.0214 12.9308H9.95963L6.42513 18.5H4.44238Z`,fill:`currentColor`})),subscript:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M16.6924 20.5V18.7115C16.6924 18.4538 16.7786 18.2387 16.9511 18.0662C17.1235 17.8939 17.3385 17.8077 17.5961 17.8077H19.5001V16.8845H16.6924V16H19.4809C19.7385 16 19.9536 16.0863 20.1261 16.2587C20.2985 16.4311 20.3846 16.6461 20.3846 16.9038V17.7885C20.3846 18.0462 20.2985 18.2612 20.1261 18.4337C19.9536 18.6061 19.7385 18.6923 19.4809 18.6923H17.5771V19.6152H20.3846V20.5H16.6924ZM4.44238 18.6923L8.84638 11.8212L4.77713 5.5H6.74438L9.95963 10.5962H10.0214L13.2501 5.5H15.2329L11.1194 11.8212L15.5579 18.6923H13.5751L10.0214 13.123H9.95963L6.42513 18.6923H4.44238Z`,fill:`currentColor`})),format_list_bulleted:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75005V5.25005H20.5V6.75005H9.30775ZM5.1635 19.6635C4.706 19.6635 4.31442 19.5006 3.98875 19.1748C3.66292 18.8491 3.5 18.4575 3.5 18C3.5 17.5425 3.66292 17.151 3.98875 16.8253C4.31442 16.4995 4.706 16.3365 5.1635 16.3365C5.621 16.3365 6.01258 16.4995 6.33825 16.8253C6.66408 17.151 6.827 17.5425 6.827 18C6.827 18.4575 6.66408 18.8491 6.33825 19.1748C6.01258 19.5006 5.621 19.6635 5.1635 19.6635ZM5.1635 13.6635C4.706 13.6635 4.31442 13.5006 3.98875 13.1748C3.66292 12.8491 3.5 12.4575 3.5 12C3.5 11.5425 3.66292 11.151 3.98875 10.8253C4.31442 10.4995 4.706 10.3365 5.1635 10.3365C5.621 10.3365 6.01258 10.4995 6.33825 10.8253C6.66408 11.151 6.827 11.5425 6.827 12C6.827 12.4575 6.66408 12.8491 6.33825 13.1748C6.01258 13.5006 5.621 13.6635 5.1635 13.6635ZM5.1635 7.66355C4.706 7.66355 4.31442 7.50063 3.98875 7.1748C3.66292 6.84913 3.5 6.45755 3.5 6.00005C3.5 5.54255 3.66292 5.15096 3.98875 4.8253C4.31442 4.49946 4.706 4.33655 5.1635 4.33655C5.621 4.33655 6.01258 4.49946 6.33825 4.8253C6.66408 5.15096 6.827 5.54255 6.827 6.00005C6.827 6.45755 6.66408 6.84913 6.33825 7.1748C6.01258 7.50063 5.621 7.66355 5.1635 7.66355Z`,fill:`currentColor`})),format_list_numbered:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M3.5 21.5V20.3078H6V19.25H4.5V18.0577H6V17H3.5V15.8077H6.34625C6.58592 15.8077 6.78683 15.8888 6.949 16.051C7.11117 16.2132 7.19225 16.4141 7.19225 16.6538V17.8462C7.19225 18.0859 7.11117 18.2868 6.949 18.449C6.78683 18.6112 6.58592 18.6923 6.34625 18.6923C6.58592 18.6923 6.78683 18.7733 6.949 18.9355C7.11117 19.0977 7.19225 19.2987 7.19225 19.5385V20.6538C7.19225 20.8936 7.11117 21.0946 6.949 21.2568C6.78683 21.4189 6.58592 21.5 6.34625 21.5H3.5ZM3.5 14.8463V12.25C3.5 12.0103 3.58108 11.8093 3.74325 11.647C3.90542 11.4848 4.10642 11.4038 4.34625 11.4038H6V10.3462H3.5V9.15375H6.34625C6.58592 9.15375 6.78683 9.23483 6.949 9.397C7.11117 9.55933 7.19225 9.76033 7.19225 10V11.75C7.19225 11.9897 7.11117 12.1907 6.949 12.353C6.78683 12.5152 6.58592 12.5963 6.34625 12.5963H4.69225V13.6538H7.19225V14.8463H3.5ZM5 8.19225V3.69225H3.5V2.5H6.19225V8.19225H5ZM9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75V5.25H20.5V6.75H9.30775Z`,fill:`currentColor`})),format_list_checked:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M5.69425 18.452L2.5 15.2578L3.54425 14.2135L5.66925 16.3385L9.91925 12.0885L10.9635 13.1578L5.69425 18.452ZM5.69425 10.8365L2.5 7.64227L3.54425 6.59802L5.66925 8.72302L9.91925 4.47302L10.9635 5.54227L5.69425 10.8365ZM13.0095 16.5578V15.0578H21.5095V16.5578H13.0095ZM13.0095 8.94227V7.44227H21.5095V8.94227H13.0095Z`,fill:`currentColor`})),link:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M10.8077 16.5385H7.0385C5.78283 16.5385 4.7125 16.096 3.8275 15.211C2.9425 14.3262 2.5 13.256 2.5 12.0005C2.5 10.745 2.9425 9.67471 3.8275 8.78955C4.7125 7.90421 5.78283 7.46155 7.0385 7.46155H10.8077V8.96155H7.0385C6.19867 8.96155 5.48233 9.25805 4.8895 9.85105C4.2965 10.444 4 11.1604 4 12C4 12.8397 4.2965 13.556 4.8895 14.149C5.48233 14.742 6.19867 15.0385 7.0385 15.0385H10.8077V16.5385ZM8.25 12.75V11.25H15.75V12.75H8.25ZM13.1923 16.5385V15.0385H16.9615C17.8013 15.0385 18.5177 14.742 19.1105 14.149C19.7035 13.556 20 12.8397 20 12C20 11.1604 19.7035 10.444 19.1105 9.85105C18.5177 9.25805 17.8013 8.96155 16.9615 8.96155H13.1923V7.46155H16.9615C18.2172 7.46155 19.2875 7.90405 20.1725 8.78905C21.0575 9.67388 21.5 10.744 21.5 11.9995C21.5 13.255 21.0575 14.3254 20.1725 15.2105C19.2875 16.0959 18.2172 16.5385 16.9615 16.5385H13.1923Z`,fill:`currentColor`})),add_photo:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M5.11537 20.5C4.6182 20.5 4.19262 20.323 3.83862 19.969C3.48462 19.615 3.30762 19.1894 3.30762 18.6922V5.30773C3.30762 4.81056 3.48462 4.38498 3.83862 4.03098C4.19262 3.67698 4.6182 3.49998 5.11537 3.49998H13.8076V4.99998H5.11537C5.02553 4.99998 4.95178 5.02881 4.89412 5.08648C4.83645 5.14415 4.80762 5.2179 4.80762 5.30773V18.6922C4.80762 18.7821 4.83645 18.8558 4.89412 18.9135C4.95178 18.9711 5.02553 19 5.11537 19H18.4999C18.5895 19 18.6633 18.9711 18.7211 18.9135C18.7788 18.8558 18.8076 18.7821 18.8076 18.6922V9.99998H20.3076V18.6922C20.3076 19.1894 20.1306 19.615 19.7766 19.969C19.4226 20.323 18.997 20.5 18.4999 20.5H5.11537ZM17.1921 8.61523V6.61523H15.1921V5.11548H17.1921V3.11548H18.6921V5.11548H20.6921V6.61523H18.6921V8.61523H17.1921ZM6.55762 16.75H17.1344L13.8459 12.3655L11.0384 16.0192L9.03837 13.4615L6.55762 16.75Z`,fill:`currentColor`})),table:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M3.5 18.6923V5.30775C3.5 4.81058 3.677 4.385 4.031 4.031C4.385 3.677 4.81058 3.5 5.30775 3.5H18.6923C19.1894 3.5 19.615 3.677 19.969 4.031C20.323 4.385 20.5 4.81058 20.5 5.30775V18.6923C20.5 19.1894 20.323 19.615 19.969 19.969C19.615 20.323 19.1894 20.5 18.6923 20.5H5.30775C4.81058 20.5 4.385 20.323 4.031 19.969C3.677 19.615 3.5 19.1894 3.5 18.6923ZM5 9.077H19V5.30775C19 5.21792 18.9712 5.14417 18.9135 5.0865C18.8558 5.02883 18.7821 5 18.6923 5H5.30775C5.21792 5 5.14417 5.02883 5.0865 5.0865C5.02883 5.14417 5 5.21792 5 5.30775V9.077ZM10.1615 14.0385H13.8385V10.577H10.1615V14.0385ZM10.1615 19H13.8385V15.5385H10.1615V19ZM5 14.0385H8.6615V10.577H5V14.0385ZM15.3385 14.0385H19V10.577H15.3385V14.0385ZM5.30775 19H8.6615V15.5385H5V18.6923C5 18.7821 5.02883 18.8558 5.0865 18.9135C5.14417 18.9712 5.21792 19 5.30775 19ZM15.3385 19H18.6923C18.7821 19 18.8558 18.9712 18.9135 18.9135C18.9712 18.8558 19 18.7821 19 18.6923V15.5385H15.3385V19Z`,fill:`currentColor`})),horizontal_rule:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M4.5 12.75V11.25H19.5V12.75H4.5Z`,fill:`currentColor`})),frontmatter:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M4.5 8.75V7.25H8.5V8.75H4.5Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M4.5 14.75V13.25H8.5V14.75H4.5Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M9.5 8.75V7.25H13.5V8.75H9.5Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M9.5 14.75V13.25H13.5V14.75H9.5Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M14.5 8.75V7.25H18.5V8.75H14.5Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M14.5 14.75V13.25H18.5V14.75H14.5Z`,fill:`currentColor`})),frame_source:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M8.6 15.2443L5.35575 12L8.6 8.75575L9.64425 9.825L7.46925 12L9.64425 14.175L8.6 15.2443ZM15.4 15.2443L14.3558 14.175L16.5307 12L14.3558 9.825L15.4 8.75575L18.6443 12L15.4 15.2443ZM5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V15H5V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H9V20.5H5.30775ZM15 20.5V19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V15H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H15ZM3.5 9V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H9V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V9H3.5ZM19 9V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H15V3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V9H19Z`,fill:`currentColor`})),arrow_drop_down:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M11.9999 14.6537L7.59619 10.25H16.4037L11.9999 14.6537Z`,fill:`currentColor`})),admonition:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M12.0001 21.4C11.7654 21.4 11.5385 21.3548 11.3193 21.2645C11.1002 21.174 10.9002 21.0435 10.7193 20.873L3.1271 13.2807C2.9566 13.0999 2.8261 12.8999 2.7356 12.6807C2.64526 12.4616 2.6001 12.2346 2.6001 12C2.6001 11.7653 2.64526 11.5358 2.7356 11.3115C2.8261 11.0871 2.9566 10.8897 3.1271 10.7192L10.7193 3.12698C10.9002 2.94614 11.1002 2.81314 11.3193 2.72798C11.5385 2.64264 11.7654 2.59998 12.0001 2.59998C12.2348 2.59998 12.4643 2.64264 12.6886 2.72798C12.9129 2.81314 13.1103 2.94614 13.2808 3.12698L20.8731 10.7192C21.0539 10.8897 21.1869 11.0871 21.2721 11.3115C21.3574 11.5358 21.4001 11.7653 21.4001 12C21.4001 12.2346 21.3574 12.4616 21.2721 12.6807C21.1869 12.8999 21.0539 13.0999 20.8731 13.2807L13.2808 20.873C13.1103 21.0435 12.9129 21.174 12.6886 21.2645C12.4643 21.3548 12.2348 21.4 12.0001 21.4ZM12.2213 19.8037L19.8039 12.2212C19.8552 12.1699 19.8808 12.0961 19.8808 12C19.8808 11.9038 19.8552 11.8301 19.8039 11.7787L12.2213 4.19623C12.17 4.14489 12.0963 4.11923 12.0001 4.11923C11.9039 4.11923 11.8302 4.14489 11.7788 4.19623L4.19635 11.7787C4.14501 11.8301 4.11935 11.9038 4.11935 12C4.11935 12.0961 4.14501 12.1699 4.19635 12.2212L11.7788 19.8037C11.8302 19.8551 11.9039 19.8807 12.0001 19.8807C12.0963 19.8807 12.17 19.8551 12.2213 19.8037ZM11.2501 13.0865H12.7501V7.47123H11.2501V13.0865ZM12.0001 15.702C12.2258 15.702 12.4168 15.6237 12.5731 15.4672C12.7296 15.3109 12.8078 15.1199 12.8078 14.8942C12.8078 14.6686 12.7296 14.4776 12.5731 14.3212C12.4168 14.1647 12.2258 14.0865 12.0001 14.0865C11.7744 14.0865 11.5834 14.1647 11.4271 14.3212C11.2706 14.4776 11.1923 14.6686 11.1923 14.8942C11.1923 15.1199 11.2706 15.3109 11.4271 15.4672C11.5834 15.6237 11.7744 15.702 12.0001 15.702Z`,fill:`currentColor`})),sandpack:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M12.9999 22.5C12.4947 22.5 12.0671 22.325 11.7171 21.975C11.3671 21.625 11.1921 21.1974 11.1921 20.6922V7.30775C11.1921 6.80258 11.3671 6.375 11.7171 6.025C12.0671 5.675 12.4947 5.5 12.9999 5.5H16.3844C16.8895 5.5 17.3171 5.675 17.6671 6.025C18.0171 6.375 18.1921 6.80258 18.1921 7.30775V20.6922C18.1921 21.1974 18.0171 21.625 17.6671 21.975C17.3171 22.325 16.8895 22.5 16.3844 22.5H12.9999ZM12.6921 7.30775V20.6922C12.6921 20.7692 12.7242 20.8398 12.7884 20.9038C12.8524 20.9679 12.9229 21 12.9999 21H16.3844C16.4614 21 16.5319 20.9679 16.5959 20.9038C16.66 20.8398 16.6921 20.7692 16.6921 20.6922V7.30775C16.6921 7.23075 16.66 7.16025 16.5959 7.09625C16.5319 7.03208 16.4614 7 16.3844 7H12.9999C12.9229 7 12.8524 7.03208 12.7884 7.09625C12.7242 7.16025 12.6921 7.23075 12.6921 7.30775ZM6.61537 18.5C6.1102 18.5 5.68262 18.325 5.33262 17.975C4.98262 17.625 4.80762 17.1974 4.80762 16.6923V3.30775C4.80762 2.80258 4.98262 2.375 5.33262 2.025C5.68262 1.675 6.1102 1.5 6.61537 1.5H9.99987C10.505 1.5 10.9326 1.675 11.2826 2.025C11.6326 2.375 11.8076 2.80258 11.8076 3.30775V16.6923C11.8076 17.1974 11.6326 17.625 11.2826 17.975C10.9326 18.325 10.505 18.5 9.99987 18.5H6.61537ZM6.30762 3.30775V16.6923C6.30762 16.7692 6.3397 16.8398 6.40387 16.9038C6.46787 16.9679 6.53837 17 6.61537 17H9.99987C10.0769 17 10.1474 16.9679 10.2114 16.9038C10.2755 16.8398 10.3076 16.7692 10.3076 16.6923V3.30775C10.3076 3.23075 10.2755 3.16025 10.2114 3.09625C10.1474 3.03208 10.0769 3 9.99987 3H6.61537C6.53837 3 6.46787 3.03208 6.40387 3.09625C6.3397 3.16025 6.30762 3.23075 6.30762 3.30775Z`,fill:`currentColor`})),rich_text:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19ZM6.75 17H17.3268L14 12.3655L11.2308 16.0192L9 13.4615L6.75 17Z`,fill:`currentColor`}),L.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M6 12V6.5H9.1925C9.5925 6.5 9.9425 6.65 10.2425 6.95C10.5425 7.25 10.6925 7.6 10.6925 8V8.6925C10.6925 9.03733 10.605 9.32675 10.43 9.56075C10.255 9.79458 10.0168 9.97817 9.7155 10.1115L10.6155 12H9.404L8.504 10.1925H7.1925V12H6ZM9.1925 9H7.1925V7.6925H9.1925C9.26933 7.6925 9.33983 7.7245 9.404 7.7885C9.468 7.85267 9.5 7.92317 9.5 8V8.6925C9.5 8.76933 9.468 8.83983 9.404 8.904C9.33983 8.968 9.26933 9 9.1925 9Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M12.5 7H17.5V8.25H12.5V7Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M12.5 9.25H17.5V10.5H12.5V9.25Z`,fill:`currentColor`})),difference:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z`,fill:`currentColor`}),L.createElement(`rect`,{x:`9`,y:`10`,width:`5.5`,height:`1.5`,fill:`currentColor`}),L.createElement(`rect`,{x:`9`,y:`15`,width:`5.5`,height:`1.5`,fill:`currentColor`}),L.createElement(`rect`,{x:`11`,y:`8`,width:`1.5`,height:`5.5`,fill:`currentColor`})),markdown:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M13 15H11.5V11L9.5 14L7.5 11V15H6V8H7.5L9.5 11L11.5 8H13V15Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M15.9921 15.5833L13.2886 12.8797L14.0546 12.1137L15.4504 13.5016V7.99597L16.5336 7.99993V13.5016L17.9296 12.1137L18.6954 12.8797L15.9921 15.5833Z`,fill:`currentColor`})),open_in_new:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H11.6152V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V12.3848H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM9.71925 15.3345L8.6655 14.2808L17.9462 5H14V3.5H20.5V10H19V6.05375L9.71925 15.3345Z`,fill:`currentColor`})),link_off:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M18.8843 16.1038L17.7498 14.9385C18.4228 14.7552 18.9661 14.3946 19.3796 13.8568C19.7931 13.319 19.9998 12.7 19.9998 12C19.9998 11.1604 19.705 10.444 19.1153 9.85105C18.5255 9.25805 17.8139 8.96155 16.9806 8.96155H13.1728V7.46155H16.9806C18.2293 7.46155 19.2947 7.90422 20.1768 8.78955C21.0588 9.67472 21.4998 10.7449 21.4998 12C21.4998 12.8859 21.262 13.6951 20.7863 14.4278C20.3107 15.1606 19.6767 15.7193 18.8843 16.1038ZM15.5806 12.75L14.0806 11.25H15.7306V12.75H15.5806ZM20.1461 22.2538L1.74609 3.8538L2.79984 2.80005L21.1998 21.2L20.1461 22.2538ZM10.8268 16.5386H7.03834C5.78318 16.5386 4.71301 16.0959 3.82784 15.2105C2.94251 14.3254 2.49984 13.2552 2.49984 12C2.49984 10.8885 2.85784 9.91322 3.57384 9.07405C4.28984 8.23505 5.18826 7.72838 6.26909 7.55405H6.49984L7.90759 8.96155H7.03834C6.19851 8.96155 5.48218 9.25805 4.88934 9.85105C4.29634 10.444 3.99984 11.1604 3.99984 12C3.99984 12.8397 4.29634 13.556 4.88934 14.149C5.48218 14.742 6.19851 15.0385 7.03834 15.0385H10.8268V16.5386ZM8.26909 12.75V11.25H10.2113L11.6863 12.75H8.26909Z`,fill:`currentColor`})),edit:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M5 19H6.2615L16.498 8.7635L15.2365 7.502L5 17.7385V19ZM3.5 20.5V17.1155L16.6905 3.93075C16.8417 3.79342 17.0086 3.68733 17.1913 3.6125C17.3741 3.5375 17.5658 3.5 17.7663 3.5C17.9668 3.5 18.1609 3.53558 18.3488 3.60675C18.5367 3.67792 18.7032 3.79108 18.848 3.94625L20.0693 5.18275C20.2244 5.32758 20.335 5.49425 20.401 5.68275C20.467 5.87125 20.5 6.05975 20.5 6.24825C20.5 6.44942 20.4657 6.64133 20.397 6.824C20.3283 7.00683 20.2191 7.17383 20.0693 7.325L6.8845 20.5H3.5ZM15.8562 8.14375L15.2365 7.502L16.498 8.7635L15.8562 8.14375Z`,fill:`currentColor`})),content_copy:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M9.05775 17.5C8.55258 17.5 8.125 17.325 7.775 16.975C7.425 16.625 7.25 16.1974 7.25 15.6923V4.30775C7.25 3.80258 7.425 3.375 7.775 3.025C8.125 2.675 8.55258 2.5 9.05775 2.5H17.4423C17.9474 2.5 18.375 2.675 18.725 3.025C19.075 3.375 19.25 3.80258 19.25 4.30775V15.6923C19.25 16.1974 19.075 16.625 18.725 16.975C18.375 17.325 17.9474 17.5 17.4423 17.5H9.05775ZM9.05775 16H17.4423C17.5192 16 17.5898 15.9679 17.6538 15.9038C17.7179 15.8398 17.75 15.7692 17.75 15.6923V4.30775C17.75 4.23075 17.7179 4.16025 17.6538 4.09625C17.5898 4.03208 17.5192 4 17.4423 4H9.05775C8.98075 4 8.91025 4.03208 8.84625 4.09625C8.78208 4.16025 8.75 4.23075 8.75 4.30775V15.6923C8.75 15.7692 8.78208 15.8398 8.84625 15.9038C8.91025 15.9679 8.98075 16 9.05775 16ZM5.55775 21C5.05258 21 4.625 20.825 4.275 20.475C3.925 20.125 3.75 19.6974 3.75 19.1923V6.30775H5.25V19.1923C5.25 19.2693 5.28208 19.3398 5.34625 19.4038C5.41025 19.4679 5.48075 19.5 5.55775 19.5H15.4423V21H5.55775Z`,fill:`currentColor`})),more_horiz:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M6.23096 13.5C5.81846 13.5 5.46537 13.3531 5.17171 13.0592C4.87787 12.7656 4.73096 12.4125 4.73096 12C4.73096 11.5875 4.87787 11.2344 5.17171 10.9408C5.46537 10.6469 5.81846 10.5 6.23096 10.5C6.64346 10.5 6.99662 10.6469 7.29046 10.9408C7.58412 11.2344 7.73096 11.5875 7.73096 12C7.73096 12.4125 7.58412 12.7656 7.29046 13.0592C6.99662 13.3531 6.64346 13.5 6.23096 13.5ZM12.0002 13.5C11.5877 13.5 11.2346 13.3531 10.941 13.0592C10.6471 12.7656 10.5002 12.4125 10.5002 12C10.5002 11.5875 10.6471 11.2344 10.941 10.9408C11.2346 10.6469 11.5877 10.5 12.0002 10.5C12.4127 10.5 12.7658 10.6469 13.0595 10.9408C13.3533 11.2344 13.5002 11.5875 13.5002 12C13.5002 12.4125 13.3533 12.7656 13.0595 13.0592C12.7658 13.3531 12.4127 13.5 12.0002 13.5ZM17.7695 13.5C17.357 13.5 17.0038 13.3531 16.71 13.0592C16.4163 12.7656 16.2695 12.4125 16.2695 12C16.2695 11.5875 16.4163 11.2344 16.71 10.9408C17.0038 10.6469 17.357 10.5 17.7695 10.5C18.182 10.5 18.535 10.6469 18.8287 10.9408C19.1225 11.2344 19.2695 11.5875 19.2695 12C19.2695 12.4125 19.1225 12.7656 18.8287 13.0592C18.535 13.3531 18.182 13.5 17.7695 13.5Z`,fill:`currentColor`})),more_vert:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M12 19.2692C11.5875 19.2692 11.2344 19.1223 10.9408 18.8285C10.6469 18.5348 10.5 18.1817 10.5 17.7692C10.5 17.3567 10.6469 17.0035 10.9408 16.7097C11.2344 16.416 11.5875 16.2692 12 16.2692C12.4125 16.2692 12.7656 16.416 13.0592 16.7097C13.3531 17.0035 13.5 17.3567 13.5 17.7692C13.5 18.1817 13.3531 18.5348 13.0592 18.8285C12.7656 19.1223 12.4125 19.2692 12 19.2692ZM12 13.5C11.5875 13.5 11.2344 13.353 10.9408 13.0592C10.6469 12.7655 10.5 12.4125 10.5 12C10.5 11.5875 10.6469 11.2344 10.9408 10.9407C11.2344 10.6469 11.5875 10.5 12 10.5C12.4125 10.5 12.7656 10.6469 13.0592 10.9407C13.3531 11.2344 13.5 11.5875 13.5 12C13.5 12.4125 13.3531 12.7655 13.0592 13.0592C12.7656 13.353 12.4125 13.5 12 13.5ZM12 7.73071C11.5875 7.73071 11.2344 7.58388 10.9408 7.29021C10.6469 6.99638 10.5 6.64321 10.5 6.23071C10.5 5.81821 10.6469 5.46513 10.9408 5.17146C11.2344 4.87763 11.5875 4.73071 12 4.73071C12.4125 4.73071 12.7656 4.87763 13.0592 5.17146C13.3531 5.46513 13.5 5.81821 13.5 6.23071C13.5 6.64321 13.3531 6.99638 13.0592 7.29021C12.7656 7.58388 12.4125 7.73071 12 7.73071Z`,fill:`currentColor`})),close:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M6.39994 18.6538L5.34619 17.6L10.9462 12L5.34619 6.4L6.39994 5.34625L11.9999 10.9463L17.5999 5.34625L18.6537 6.4L13.0537 12L18.6537 17.6L17.5999 18.6538L11.9999 13.0538L6.39994 18.6538Z`,fill:`currentColor`})),settings:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M9.69225 21.5L9.3115 18.4538C9.04367 18.3641 8.769 18.2385 8.4875 18.077C8.20617 17.9153 7.95459 17.7422 7.73275 17.5577L4.9115 18.75L2.604 14.75L5.04425 12.9058C5.02125 12.7571 5.00492 12.6077 4.99525 12.4578C4.98559 12.3078 4.98075 12.1583 4.98075 12.0095C4.98075 11.8673 4.98559 11.7228 4.99525 11.576C5.00492 11.4292 5.02125 11.2686 5.04425 11.0943L2.604 9.25L4.9115 5.26925L7.723 6.452C7.96417 6.261 8.22159 6.08633 8.49525 5.928C8.76892 5.76967 9.03784 5.64242 9.302 5.54625L9.69225 2.5H14.3078L14.6885 5.55575C14.9885 5.66475 15.2599 5.792 15.5028 5.9375C15.7458 6.083 15.991 6.2545 16.2385 6.452L19.0885 5.26925L21.396 9.25L18.9173 11.123C18.9531 11.2845 18.9727 11.4355 18.976 11.576C18.9792 11.7163 18.9808 11.8577 18.9808 12C18.9808 12.1358 18.9775 12.274 18.971 12.4145C18.9647 12.5548 18.9417 12.7154 18.902 12.8963L21.3615 14.75L19.0538 18.75L16.2385 17.548C15.991 17.7455 15.7384 17.9202 15.4808 18.072C15.2231 18.224 14.959 18.3481 14.6885 18.4443L14.3078 21.5H9.69225ZM11 20H12.9655L13.325 17.3212C13.8353 17.1879 14.3017 16.9985 14.724 16.753C15.1465 16.5073 15.5539 16.1916 15.9463 15.8057L18.4308 16.85L19.4155 15.15L17.2463 13.5155C17.3296 13.2565 17.3863 13.0026 17.4163 12.7537C17.4464 12.5051 17.4615 12.2538 17.4615 12C17.4615 11.7397 17.4464 11.4884 17.4163 11.2463C17.3863 11.0039 17.3296 10.7564 17.2463 10.5038L19.4345 8.85L18.45 7.15L15.9365 8.2095C15.6018 7.85183 15.2009 7.53583 14.7338 7.2615C14.2664 6.98717 13.7937 6.79292 13.3155 6.67875L13 4H11.0155L10.6845 6.66925C10.1743 6.78975 9.70325 6.97433 9.27125 7.223C8.83909 7.47183 8.42684 7.79233 8.0345 8.1845L5.55 7.15L4.5655 8.85L6.725 10.4595C6.64167 10.6968 6.58334 10.9437 6.55 11.2C6.51667 11.4563 6.5 11.7262 6.5 12.0095C6.5 12.2698 6.51667 12.525 6.55 12.775C6.58334 13.025 6.6385 13.2718 6.7155 13.5155L4.5655 15.15L5.55 16.85L8.025 15.8C8.4045 16.1897 8.81025 16.5089 9.24225 16.7578C9.67442 17.0064 10.152 17.1974 10.675 17.3307L11 20ZM12.0115 15C12.8435 15 13.5515 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.168 14.7195 10.46 14.1355 9.876C13.5515 9.292 12.8435 9 12.0115 9C11.1692 9 10.4586 9.292 9.87975 9.876C9.30092 10.46 9.0115 11.168 9.0115 12C9.0115 12.832 9.30092 13.54 9.87975 14.124C10.4586 14.708 11.1692 15 12.0115 15Z`,fill:`currentColor`})),delete_big:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z`,fill:`currentColor`})),delete_small:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z`,fill:`currentColor`})),format_align_center:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M3.5 20.5V19H20.5V20.5H3.5ZM7.5 16.625V15.125H16.5V16.625H7.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM7.5 8.875V7.375H16.5V8.875H7.5ZM3.5 5V3.5H20.5V5H3.5Z`,fill:`currentColor`})),format_align_left:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M3.5 20.5V19H20.5V20.5H3.5ZM3.5 16.625V15.125H14.5V16.625H3.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM3.5 8.875V7.375H14.5V8.875H3.5ZM3.5 5V3.5H20.5V5H3.5Z`,fill:`currentColor`})),format_align_right:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M3.5 5V3.5H20.5V5H3.5ZM9.5 8.875V7.375H20.5V8.875H9.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM9.5 16.625V15.125H20.5V16.625H9.5ZM3.5 20.5V19H20.5V20.5H3.5Z`,fill:`currentColor`})),add_row:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M4.025 10.2077C4.375 9.85775 4.80258 9.68275 5.30775 9.68275H6.5V11.1827H5.30775C5.21792 11.1827 5.14417 11.2116 5.0865 11.2693C5.02883 11.3269 5 11.4007 5 11.4905V16.1923C5 16.2821 5.02883 16.3558 5.0865 16.4135C5.14417 16.4712 5.21792 16.5 5.30775 16.5H18.6923C18.7821 16.5 18.8558 16.4712 18.9135 16.4135C18.9712 16.3558 19 16.2821 19 16.1923V11.4905C19 11.4007 18.9712 11.3269 18.9135 11.2693C18.8558 11.2116 18.7821 11.1827 18.6923 11.1827H17.6923V9.68275H18.6923C19.1974 9.68275 19.625 9.85775 19.975 10.2077C20.325 10.5577 20.5 10.9853 20.5 11.4905V16.1923C20.5 16.6974 20.325 17.125 19.975 17.475C19.625 17.825 19.1974 18 18.6923 18H5.30775C4.80258 18 4.375 17.825 4.025 17.475C3.675 17.125 3.5 16.6974 3.5 16.1923V11.4905C3.5 10.9853 3.675 10.5577 4.025 10.2077Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M11.3848 9.68275V7.5H12.8848V9.68275H15V11.1827H12.8848V13.2307H11.3848V11.1827H9.26925V9.68275H11.3848Z`,fill:`currentColor`})),add_column:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.70775 4.025C9.35775 4.375 9.18275 4.80258 9.18275 5.30775V6.5H10.6827V5.30775C10.6827 5.21792 10.7116 5.14417 10.7693 5.0865C10.8269 5.02883 10.9007 5 10.9905 5H15.6923C15.7821 5 15.8558 5.02883 15.9135 5.0865C15.9712 5.14417 16 5.21792 16 5.30775V18.6923C16 18.7821 15.9712 18.8558 15.9135 18.9135C15.8558 18.9712 15.7821 19 15.6923 19H10.9905C10.9007 19 10.8269 18.9712 10.7693 18.9135C10.7116 18.8558 10.6827 18.7821 10.6827 18.6923V17.6923H9.18275V18.6923C9.18275 19.1974 9.35775 19.625 9.70775 19.975C10.0577 20.325 10.4853 20.5 10.9905 20.5H15.6923C16.1974 20.5 16.625 20.325 16.975 19.975C17.325 19.625 17.5 19.1974 17.5 18.6923V5.30775C17.5 4.80258 17.325 4.375 16.975 4.025C16.625 3.675 16.1974 3.5 15.6923 3.5H10.9905C10.4853 3.5 10.0577 3.675 9.70775 4.025Z`,fill:`currentColor`}),L.createElement(`path`,{d:`M9.18275 11.3848H7V12.8848H9.18275V15H10.6827V12.8848H12.7307V11.3848H10.6827V9.26925H9.18275V11.3848Z`,fill:`currentColor`})),insert_col_left:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M13.0001 20.1152H8.67713H8.75388H8.69238H13.0001ZM7.19238 19.8075C7.19238 20.3127 7.36738 20.7402 7.71738 21.0902C8.06738 21.4402 8.49497 21.6152 9.00013 21.6152H12.6924C13.1975 21.6152 13.6251 21.4402 13.9751 21.0902C14.3251 20.7402 14.5001 20.3127 14.5001 19.8075V10.423H13.0001V19.8075C13.0001 19.8973 12.9713 19.9711 12.9136 20.0287C12.856 20.0864 12.7822 20.1152 12.6924 20.1152H9.00013C8.9103 20.1152 8.83655 20.0864 8.77888 20.0287C8.72122 19.9711 8.69238 19.8973 8.69238 19.8075V4.69223C8.26422 4.74357 7.90722 4.93299 7.62138 5.26048C7.33538 5.58798 7.19238 5.97548 7.19238 6.42298V19.8075ZM13.0001 2.49998V4.61523H10.8846V6.11523H13.0001V8.23073H14.5001V6.11523H16.6154V4.61523H14.5001V2.49998H13.0001Z`,fill:`currentColor`})),insert_row_above:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M20.1152 9.99987V14.3229V14.2461V14.3076V9.99987ZM19.8075 15.8076C20.3127 15.8076 20.7402 15.6326 21.0902 15.2826C21.4402 14.9326 21.6152 14.505 21.6152 13.9999V10.3076C21.6152 9.80245 21.4402 9.37487 21.0902 9.02487C20.7402 8.67487 20.3127 8.49987 19.8075 8.49987H10.423V9.99987H19.8075C19.8973 9.99987 19.9711 10.0287 20.0287 10.0864C20.0864 10.144 20.1152 10.2178 20.1152 10.3076V13.9999C20.1152 14.0897 20.0864 14.1635 20.0287 14.2211C19.9711 14.2788 19.8973 14.3076 19.8075 14.3076H4.69223C4.74357 14.7358 4.93299 15.0928 5.26048 15.3786C5.58798 15.6646 5.97548 15.8076 6.42298 15.8076H19.8075ZM2.49998 9.99987H4.61523V12.1154H6.11523V9.99987H8.23073V8.49987H6.11523V6.38462H4.61523V8.49987H2.49998V9.99987Z`,fill:`currentColor`})),insert_row_below:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M20.1152 14.1924V9.86939V9.94614V9.88464V14.1924ZM19.8075 8.38464C20.3127 8.38464 20.7402 8.55964 21.0902 8.90964C21.4402 9.25964 21.6152 9.68723 21.6152 10.1924V13.8846C21.6152 14.3898 21.4402 14.8174 21.0902 15.1674C20.7402 15.5174 20.3127 15.6924 19.8075 15.6924H10.423V14.1924H19.8075C19.8973 14.1924 19.9711 14.1636 20.0287 14.1059C20.0864 14.0482 20.1152 13.9745 20.1152 13.8846V10.1924C20.1152 10.1026 20.0864 10.0288 20.0287 9.97114C19.9711 9.91348 19.8973 9.88464 19.8075 9.88464H4.69223C4.74357 9.45648 4.93299 9.09948 5.26048 8.81364C5.58798 8.52764 5.97548 8.38464 6.42298 8.38464H19.8075ZM2.49998 14.1924H4.61523V12.0769H6.11523V14.1924H8.23073V15.6924H6.11523V17.8076H4.61523V15.6924H2.49998V14.1924Z`,fill:`currentColor`})),insert_col_right:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M10.8075 20.1152H15.1305H15.0537H15.1152H10.8075ZM16.6152 19.8075C16.6152 20.3127 16.4402 20.7402 16.0902 21.0902C15.7402 21.4402 15.3127 21.6152 14.8075 21.6152H11.1152C10.6101 21.6152 10.1825 21.4402 9.83248 21.0902C9.48248 20.7402 9.30748 20.3127 9.30748 19.8075V10.423H10.8075V19.8075C10.8075 19.8973 10.8363 19.9711 10.894 20.0287C10.9517 20.0864 11.0254 20.1152 11.1152 20.1152H14.8075C14.8973 20.1152 14.9711 20.0864 15.0287 20.0287C15.0864 19.9711 15.1152 19.8973 15.1152 19.8075V4.69223C15.5434 4.74357 15.9004 4.93299 16.1862 5.26048C16.4722 5.58798 16.6152 5.97548 16.6152 6.42298V19.8075ZM10.8075 2.49998V4.61523H12.923V6.11523H10.8075V8.23073H9.30748V6.11523H7.19223V4.61523H9.30748V2.49998H10.8075Z`,fill:`currentColor`})),check:L.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},L.createElement(`path`,{d:`M9.54983 17.6537L4.21533 12.3192L5.28433 11.25L9.54983 15.5155L18.7153 6.34998L19.7843 7.41923L9.54983 17.6537Z`,fill:`currentColor`}))},J={editorRoot:`_editorRoot_1e2ox_53`,editorWrapper:`_editorWrapper_1e2ox_155`,toolbarRoot:`_toolbarRoot_1e2ox_162`,readOnlyToolbarRoot:`_readOnlyToolbarRoot_1e2ox_189`,toolbarToggleItem:`_toolbarToggleItem_1e2ox_208`,toolbarGroupOfGroups:`_toolbarGroupOfGroups_1e2ox_219`,toolbarToggleSingleGroup:`_toolbarToggleSingleGroup_1e2ox_224`,toolbarButton:`_toolbarButton_1e2ox_239`,activeToolbarButton:`_activeToolbarButton_1e2ox_275`,toolbarButtonDropdownContainer:`_toolbarButtonDropdownContainer_1e2ox_286`,selectContainer:`_selectContainer_1e2ox_288`,selectItem:`_selectItem_1e2ox_301`,toolbarButtonSelectTrigger:`_toolbarButtonSelectTrigger_1e2ox_307`,selectTrigger:`_selectTrigger_1e2ox_308`,selectDropdownArrow:`_selectDropdownArrow_1e2ox_374`,contentEditable:`_contentEditable_1e2ox_380`,codeMirrorWrapper:`_codeMirrorWrapper_1e2ox_392`,sandPackWrapper:`_sandPackWrapper_1e2ox_401`,codeMirrorToolbar:`_codeMirrorToolbar_1e2ox_409`,propertyPanelTitle:`_propertyPanelTitle_1e2ox_431`,propertyEditorTable:`_propertyEditorTable_1e2ox_439`,iconButton:`_iconButton_1e2ox_457`,readOnlyColumnCell:`_readOnlyColumnCell_1e2ox_462`,buttonsFooter:`_buttonsFooter_1e2ox_475`,propertyEditorInput:`_propertyEditorInput_1e2ox_481`,primaryButton:`_primaryButton_1e2ox_507`,secondaryButton:`_secondaryButton_1e2ox_508`,smallButton:`_smallButton_1e2ox_523`,dialogForm:`_dialogForm_1e2ox_535`,linkDialogEditForm:`_linkDialogEditForm_1e2ox_541`,linkDialogInputContainer:`_linkDialogInputContainer_1e2ox_549`,linkDialogInputWrapper:`_linkDialogInputWrapper_1e2ox_555`,linkDialogInput:`_linkDialogInput_1e2ox_549`,linkDialogAnchor:`_linkDialogAnchor_1e2ox_587`,linkDialogPopoverContent:`_linkDialogPopoverContent_1e2ox_601`,tableColumnEditorPopoverContent:`_tableColumnEditorPopoverContent_1e2ox_602`,dialogContent:`_dialogContent_1e2ox_603`,largeDialogContent:`_largeDialogContent_1e2ox_615`,dialogTitle:`_dialogTitle_1e2ox_625`,dialogCloseButton:`_dialogCloseButton_1e2ox_631`,popoverContent:`_popoverContent_1e2ox_638`,popoverArrow:`_popoverArrow_1e2ox_650`,linkDialogPreviewAnchor:`_linkDialogPreviewAnchor_1e2ox_654`,tooltipTrigger:`_tooltipTrigger_1e2ox_677`,tooltipContent:`_tooltipContent_1e2ox_681`,actionButton:`_actionButton_1e2ox_695`,primaryActionButton:`_primaryActionButton_1e2ox_702`,tableEditor:`_tableEditor_1e2ox_714`,toolCell:`_toolCell_1e2ox_725`,tableColumnEditorTrigger:`_tableColumnEditorTrigger_1e2ox_744`,addRowButton:`_addRowButton_1e2ox_746`,addColumnButton:`_addColumnButton_1e2ox_747`,tableColumnEditorToolbar:`_tableColumnEditorToolbar_1e2ox_789`,toggleGroupRoot:`_toggleGroupRoot_1e2ox_802`,tableToolsColumn:`_tableToolsColumn_1e2ox_820`,leftAlignedCell:`_leftAlignedCell_1e2ox_829`,rightAlignedCell:`_rightAlignedCell_1e2ox_833`,centeredCell:`_centeredCell_1e2ox_837`,dialogOverlay:`_dialogOverlay_1e2ox_870`,focusedImage:`_focusedImage_1e2ox_916`,imageWrapper:`_imageWrapper_1e2ox_920`,editImageToolbar:`_editImageToolbar_1e2ox_933`,editImageButton:`_editImageButton_1e2ox_937`,inlineEditor:`_inlineEditor_1e2ox_943`,blockEditor:`_blockEditor_1e2ox_952`,nestedEditor:`_nestedEditor_1e2ox_961`,genericComponentName:`_genericComponentName_1e2ox_980`,diffSourceToggleWrapper:`_diffSourceToggleWrapper_1e2ox_986`,ggDiffSourceToggle:`_ggDiffSourceToggle_1e2ox_994`,diffSourceToggle:`_diffSourceToggle_1e2ox_986`,selectWithLabel:`_selectWithLabel_1e2ox_1012`,toolbarTitleMode:`_toolbarTitleMode_1e2ox_1027`,imageControlWrapperResizing:`_imageControlWrapperResizing_1e2ox_1032`,imageResizer:`_imageResizer_1e2ox_1036`,imageResizerN:`_imageResizerN_1e2ox_1045`,imageResizerNe:`_imageResizerNe_1e2ox_1051`,imageResizerE:`_imageResizerE_1e2ox_1057`,imageResizerSe:`_imageResizerSe_1e2ox_1063`,imageResizerS:`_imageResizerS_1e2ox_1063`,imageResizerSw:`_imageResizerSw_1e2ox_1075`,imageResizerW:`_imageResizerW_1e2ox_1081`,imageResizerNw:`_imageResizerNw_1e2ox_1087`,imagePlaceholder:`_imagePlaceholder_1e2ox_1093`,imageDimensionsContainer:`_imageDimensionsContainer_1e2ox_1101`,placeholder:`_placeholder_1e2ox_1106`,rootContentEditableWrapper:`_rootContentEditableWrapper_1e2ox_1119`,downshiftInputWrapper:`_downshiftInputWrapper_1e2ox_1129`,downshiftInput:`_downshiftInput_1e2ox_1129`,downshiftAutocompleteContainer:`_downshiftAutocompleteContainer_1e2ox_1160`,textInput:`_textInput_1e2ox_1206`,multiFieldForm:`_multiFieldForm_1e2ox_1214`,formField:`_formField_1e2ox_1220`,markdownParseError:`_markdownParseError_1e2ox_1231`,popupContainer:`_popupContainer_1e2ox_1240`,inputSizer:`_inputSizer_1e2ox_1245`},dA=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),fA=class e extends Pg{static getType(){return`link`}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=document.createElement(`a`);return this.updateLinkDOM(null,t,e),$y(t,e.theme.link),t}updateLinkDOM(e,t,n){if(gv(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:pA,priority:1})}}static importJSON(e){return mA().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=CA(e);try{let t=new URL(CA(e));if(!dA.has(t.protocol))return`about:blank`}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=mA(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!U(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith(`mailto:`)}isWebSiteURI(){return this.__url.startsWith(`https://`)||this.__url.startsWith(`http://`)}};function pA(e){let t=null;if(gv(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=mA(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function mA(e=``,t){return lv(new fA(e,t))}function hA(e){return e instanceof fA}var gA=class e extends fA{constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return`autolink`}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return _A().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let n=this.getParentOrThrow().insertNewAfter(e,t);if(G(n)){let e=_A(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}};function _A(e=``,t){return lv(new gA(e,t))}function vA(e){return e instanceof gA}var yA=Bp(`TOGGLE_LINK_COMMAND`);function bA(e,t){if(e.type===`element`){let n=e.getNode();return G(n)||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function xA(e,t={}){let{target:n,title:r}=t,i=t.rel===void 0?`noreferrer`:t.rel,a=W();if(a===null||!U(a)&&!Lh(a))return;if(Lh(a)){let t=a.getNodes();if(t.length===0)return;t.forEach((t=>{if(e===null){let e=rb(t,(e=>!vA(e)&&hA(e)));e&&(e.insertBefore(t),e.getChildren().length===0&&e.remove())}else{let r=rb(t,(e=>!vA(e)&&hA(e)));if(r)r.setURL(e),n!==void 0&&r.setTarget(n),i!==void 0&&r.setRel(i);else{let r=mA(e,{rel:i,target:n});t.insertBefore(r),r.append(t)}}}));return}let o=a.extract();if(e===null)return void o.forEach((e=>{let t=rb(e,(e=>!vA(e)&&hA(e)));if(t){let e=t.getChildren();for(let n=0;n<e.length;n++)t.insertBefore(e[n]);t.remove()}}));let s=new Set,c=t=>{s.has(t.getKey())||(s.add(t.getKey()),t.setURL(e),n!==void 0&&t.setTarget(n),i!==void 0&&t.setRel(i),r!==void 0&&t.setTitle(r))};if(o.length===1){let e=SA(o[0],hA);if(e!==null)return c(e)}(function(e){let t=W();if(!U(t))return e();let n=ip(t),r=n.isBackward(),i=bA(n.anchor,r?-1:0),a=bA(n.focus,r?0:-1);if(e(),i||a){let e=W();if(U(e)){let t=e.clone();if(i){let e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+ +!!r,`element`)}if(a){let e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+ +!r,`element`)}j_(ip(t))}}})((()=>{let t=null;for(let a of o){if(!a.isAttached())continue;let o=SA(a,hA);if(o){c(o);continue}if(G(a)){if(!a.isInline())continue;if(hA(a)){if(!(vA(a)||t!==null&&t.getParentOrThrow().isParentOf(a))){c(a),t=a;continue}for(let e of a.getChildren())a.insertBefore(e);a.remove();continue}}let s=a.getPreviousSibling();hA(s)&&s.is(t)?s.append(a):(t=mA(e,{rel:i,target:n,title:r}),a.insertAfter(t),t.append(a))}}))}function SA(e,t){let n=e;for(;n!==null&&n.getParent()!==null&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}var Ote=/^\+?[0-9\s()-]{5,}$/;function CA(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:Ote.test(e)?`tel:${e}`:`https://${e}`}function wA(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function TA(e){let t=1,n=e.getParent();for(;n!=null;){if(GA(n)){let e=n.getParent();if(QA(e)){t++,n=e.getParent();continue}wA(40)}return t}return t}function EA(e){let t=e.getParent();QA(t)||wA(40);let n=t;for(;n!==null;)n=n.getParent(),QA(n)&&(t=n);return t}function DA(e){let t=[],n=e.getChildren().filter(GA);for(let e=0;e<n.length;e++){let r=n[e],i=r.getFirstChild();QA(i)?t=t.concat(DA(i)):t.push(r)}return t}function OA(e){return GA(e)&&QA(e.getFirstChild())}function kA(e){return WA().append(e)}function AA(e,t){return GA(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function jA(e){let t=W();if(t!==null){let n=t.getNodes();if(U(t)){let r=t.getStartEndPoints();r===null&&wA(143);let[i]=r,a=i.getNode(),o=a.getParent();if(cv(a)){let e=a.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=Yg();a.append(e),n=e.select().getNodes()}}else if(AA(a,n)){let t=ZA(e);if(cv(o)){a.replace(t);let e=WA();G(a)&&(e.setFormat(a.getFormatType()),e.setIndent(a.getIndent())),t.append(e)}else if(GA(a)){let e=a.getParentOrThrow();MA(t,e.getChildren()),e.replace(t)}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if(G(i)&&i.isEmpty()&&!GA(i)&&!r.has(i.getKey())){NA(i,e);continue}let a=__(i)?i.getParent():GA(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(QA(a)){if(!r.has(t)){let n=ZA(e);MA(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(cv(n)&&!r.has(t)){r.add(t),NA(a,e);break}a=n}}}}}function MA(e,t){e.splice(e.getChildrenSize(),0,t)}function NA(e,t){if(QA(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=WA(),a;if(MA(i,e.getChildren()),QA(n)&&t===n.getListType())n.append(i),QA(r)&&t===r.getListType()&&(MA(n,r.getChildren()),r.remove()),a=n;else if(QA(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=ZA(t);n.append(i),e.replace(n),a=n}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),a}function PA(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&OA(n)&&OA(r)&&(PA(n.getFirstChild(),r.getFirstChild()),r.remove());let i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function FA(){let e=W();if(U(e)){let t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(AA(r,n))t.add(EA(r));else for(let e=0;e<n.length;e++){let r=n[e];if(__(r)){let e=tb(r,VA);e!=null&&t.add(EA(e))}}for(let n of t){let t=n,r=DA(n);for(let n of r){let r=Yg().setTextStyle(e.style).setTextFormat(e.format);MA(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&py(e.anchor,by(Qv(r,`next`))),n.__key===e.focus.key&&py(e.focus,by(Qv(r,`next`))),n.remove()}n.remove()}}}function IA(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())GA(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),QA(r.getFirstChild())||n++)}function LA(e){let t=new Set;if(OA(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(OA(r)&&OA(i)){let n=i.getFirstChild();if(QA(n)){n.append(e);let i=r.getFirstChild();QA(i)&&(MA(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(OA(r)){let t=r.getFirstChild();if(QA(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(OA(i)){let t=i.getFirstChild();QA(t)&&t.append(e)}else if(QA(n)){let t=WA().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),a=ZA(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function RA(e){if(OA(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(QA(n?n.getParent():void 0)&&GA(n)&&QA(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=t.getListType(),i=WA(),a=ZA(r);i.append(a),e.getPreviousSiblings().forEach((e=>a.append(e)));let o=WA(),s=ZA(r);o.append(s),MA(s,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function zA(){let e=W();if(!U(e)||!e.isCollapsed())return!1;let t=e.anchor.getNode();if(!GA(t)||t.getChildrenSize()!==0)return!1;let n=EA(t),r=t.getParent();QA(r)||wA(40);let i=r.getParent(),a;if(cv(i))a=Yg(),n.insertAfter(a);else{if(!GA(i))return!1;a=WA(),i.insertAfter(a)}a.setTextStyle(e.style).setTextFormat(e.format).select();let o=t.getNextSiblings();if(o.length>0){let e=ZA(r.getListType());if(GA(a)){let t=WA();t.append(e),a.insertAfter(t)}else a.insertAfter(e);e.append(...o)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!GA(e)&&!QA(e))break;t=e}t.remove()}(t),!0}function BA(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}var VA=class extends Pg{$config(){return this.config(`listitem`,{$transform:e=>{if(e.__checked==null)return;let t=e.getParent();QA(t)&&t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0)},extends:Pg,importDOM:ah({li:()=>({conversion:HA,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=document.createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){let r=this.getParent();QA(r)&&r.getListType()===`check`&&function(e,t,n,r){QA(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),n&&t.__checked===n.__checked||e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))}(t,this,e),t.value=this.__value,function(e,t,n){let r=[],i=[],a=t.list,o=a?a.listitem:void 0,s;if(a&&a.nested&&(s=a.nested.listitem),o!==void 0&&r.push(...BA(o)),a){let e=n.getParent(),t=QA(e)&&e.getListType()===`check`,o=n.getChecked();t&&!o||i.push(a.listitemUnchecked),t&&o||i.push(a.listitemChecked),t&&r.push(o?a.listitemChecked:a.listitemUnchecked)}if(s!==void 0){let e=BA(s);n.getChildren().some((e=>QA(e)))?r.push(...e):i.push(...e)}i.length>0&&eb(e,...i),r.length>0&&$y(e,...r)}(t,n.theme,this);let i=e?e.__style:``,a=this.__style;i!==a&&(a===``?t.removeAttribute(`style`):t.style.cssText=a),function(e,t,n){let r=ky(t.__textStyle);for(let t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(let t in ky(n.__textStyle))t in r||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(G(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(GA(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!QA(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=ZA(n.getListType()),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&(G(e)||wA(139),this.getChildren().forEach((t=>{e.append(t)}))),this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(QA(n)||wA(39),GA(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=ZA(n.getListType());r.forEach((e=>i.append(e))),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&OA(t)&&OA(n)&&(PA(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){let n=WA().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){let t=Yg();this.getChildren().forEach((e=>t.append(e)));let n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=GA(r);if(n.getChildrenSize()===1)if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();let r=e.anchor,i=e.focus,a=t.getKey();r.type===`element`&&r.getNode().is(this)&&r.set(a,r.offset,`element`),i.type===`element`&&i.getNode().is(this)&&i.set(a,i.offset,`element`)}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return QA(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;GA(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&wA(117),(e=Math.floor(e))>=0||wA(199);let t=this.getIndent();for(;t!==e;)t<e?(LA(this),t++):(RA(this),t--);return this}canInsertAfter(e){return GA(e)}canReplaceWith(e){return GA(e)}canMergeWith(e){return GA(e)||Xg(e)}extractWithChild(e,t){if(!U(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return ZA(`bullet`)}canMergeWhenEmpty(){return!0}};function HA(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return UA(t)}let t=e.getAttribute(`aria-checked`);return{node:WA(t===`true`||t!==`false`&&void 0)}}function UA(e){return e.getAttribute(`type`)===`checkbox`?{node:WA(e.hasAttribute(`checked`))}:{node:null}}function WA(e){return lv(new VA(void 0,e))}function GA(e){return e instanceof VA}var KA=class extends Pg{$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.getNextSibling();QA(t)&&e.getListType()===t.getListType()&&PA(e,t)})(e),IA(e)},extends:Pg,importDOM:ah({ol:()=>({conversion:YA,priority:0}),ul:()=>({conversion:YA,priority:0})})})}constructor(e=`number`,t=1,n){super(n);let r=XA[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=document.createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,qA(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(qA(t,n.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return _v(t)&&(this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`)),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];GA(t)||(r===n&&(r=[...n]),r[e]=WA().append(!G(t)||QA(t)||t.isInline()?t:Eh(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return GA(e)}};function qA(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=TA(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...BA(s));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(l!==void 0){let e=BA(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&eb(e,...i),r.length>0&&$y(e,...r)}function JA(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(GA(r)){t.push(r);let e=r.getChildren();e.length>1&&e.forEach((e=>{QA(e)&&t.push(kA(e))}))}else t.push(kA(r))}return t}function YA(e){let t=e.nodeName.toLowerCase(),n=null;return t===`ol`?n=ZA(`number`,e.start):t===`ul`&&(n=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`))return!0;for(let t of e.childNodes)if(_v(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?ZA(`check`):ZA(`bullet`)),{after:JA,node:n}}var XA={ol:`number`,ul:`bullet`};function ZA(e=`number`,t=1){return lv(new KA(e,t))}function QA(e){return e instanceof KA}var $A=Bp(`INSERT_CHECK_LIST_COMMAND`);function ej(e){return Xy(e.registerCommand($A,(()=>(jA(`check`),!0)),1),e.registerCommand(om,(t=>aj(t,e,!1)),1),e.registerCommand(am,(t=>aj(t,e,!0)),1),e.registerCommand(um,(()=>ij()==null?!1:(e.getRootElement()?.focus(),!0)),1),e.registerCommand(cm,(t=>{let n=ij();return!(n==null||!e.isEditable())&&(e.update((()=>{let e=E_(n);GA(e)&&(t.preventDefault(),e.toggleChecked())})),!0)}),1),e.registerCommand(rm,(t=>e.getEditorState().read((()=>{let n=W();if(U(n)&&n.isCollapsed()){let{anchor:r}=n,i=r.type===`element`;if(i||r.offset===0){let n=r.getNode(),a=rb(n,(e=>G(e)&&!e.isInline()));if(GA(a)){let r=a.getParent();if(QA(r)&&r.getListType()===`check`&&(i||a.getFirstDescendant()===n)){let n=e.getElementByKey(a.__key);if(n!=null&&document.activeElement!==n)return n.focus(),t.preventDefault(),!0}}}}return!1}))),1),e.registerRootListener(((e,t)=>{e!==null&&(e.addEventListener(`click`,nj),e.addEventListener(`pointerdown`,rj)),t!==null&&(t.removeEventListener(`click`,nj),t.removeEventListener(`pointerdown`,rj))})))}function tj(e,t){let n=e.target;if(!_v(n))return;let r=n.firstChild;if(_v(r)&&(r.tagName===`UL`||r.tagName===`OL`))return;let i=n.parentNode;if(!i||i.__lexicalListType!==`check`)return;let a=n.getBoundingClientRect(),o=ub(n),s=e.clientX/o,c=window.getComputedStyle?window.getComputedStyle(n,`::before`):{width:`0px`},l=parseFloat(c.width),u=e.pointerType===`touch`?32:0;(n.dir===`rtl`?s<a.right+u&&s>a.right-l-u:s>a.left-u&&s<a.left+l+u)&&t()}function nj(e){tj(e,(()=>{if(_v(e.target)){let t=e.target,n=u_(t);n!=null&&n.isEditable()&&n.update((()=>{let e=E_(t);GA(e)&&(t.focus(),e.toggleChecked())}))}}))}function rj(e){tj(e,(()=>{e.preventDefault()}))}function ij(){let e=document.activeElement;return _v(e)&&e.tagName===`LI`&&e.parentNode!=null&&e.parentNode.__lexicalListType===`check`?e:null}function aj(e,t,n){let r=ij();return r!=null&&t.update((()=>{let i=E_(r);if(!GA(i))return;let a=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),r=e;for(;n==null&&GA(r);)r=r.getParentOrThrow().getParent(),r!=null&&(n=t?r.getPreviousSibling():r.getNextSibling());for(;GA(n);){let e=t?n.getLastChild():n.getFirstChild();if(!QA(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(i,n);if(a!=null){a.selectStart();let n=t.getElementByKey(a.__key);n!=null&&(e.preventDefault(),setTimeout((()=>{n.focus()}),0))}})),!1}var oj=Bp(`UPDATE_LIST_START_COMMAND`),sj=Bp(`INSERT_UNORDERED_LIST_COMMAND`),cj=Bp(`INSERT_ORDERED_LIST_COMMAND`),lj=Bp(`REMOVE_LIST_COMMAND`);function uj(e){return Xy(e.registerCommand(cj,(()=>(jA(`number`),!0)),1),e.registerCommand(oj,(e=>{let{listNodeKey:t,newStart:n}=e,r=C_(t);return!!QA(r)&&(r.getListType()===`number`&&(r.setStart(n),IA(r)),!0)}),1),e.registerCommand(sj,(()=>(jA(`bullet`),!0)),1),e.registerCommand(lj,(()=>(FA(),!0)),1),e.registerCommand(Kp,(()=>zA()),1),e.registerNodeTransform(VA,(e=>{let t=e.getFirstChild();if(t){if(H(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=W();U(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}})),e.registerNodeTransform(_h,(e=>{let t=e.getParent();if(GA(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}})))}function dj(e){let t=e=>{let t=e.getParent();if(QA(e.getFirstChild())||!QA(t))return;let n=rb(e,(e=>GA(e)&&QA(e.getParent())&&GA(e.getPreviousSibling())));if(n===null&&e.getIndent()>0)e.setIndent(0);else if(GA(n)){let r=n.getPreviousSibling();if(GA(r)){let n=function(e){let t=e,n=t.getFirstChild();for(;QA(n);){let e=n.getLastChild();if(!GA(e))break;t=e,n=t.getFirstChild()}return t}(r).getParent();if(QA(n)){let r=TA(n);r+1<TA(t)&&e.setIndent(r)}}}};return e.registerNodeTransform(KA,(e=>{let n=[e];for(;n.length>0;){let e=n.shift();if(QA(e)){for(let r of e.getChildren())if(GA(r)){t(r);let e=r.getFirstChild();QA(e)&&n.push(e)}}}}))}function fj(e){try{let t=e.anchor,n=e.focus,r=e.anchor.getNode(),i=e.focus.getNode();return r===i?r:e.isBackward()?Py(n)?r:i:Py(t)?r:i}catch{return null}}var pj=[`transform`,`perspective`,`filter`,`backdrop-filter`,`contain`,`container-type`],mj=[`layout`,`paint`,`strict`,`content`];function hj(e){let t=e?.parentElement;for(;t;){let e=window.getComputedStyle(t),n=e.willChange.split(`,`).map(e=>e.trim()).some(e=>pj.includes(e));if(e.transform!==`none`||e.perspective!==`none`||e.filter!==`none`||e.backdropFilter!==`none`||mj.includes(e.contain)||e.containerType!==`normal`||e.contentVisibility===`auto`||n)return t;t=t.parentElement}return null}function gj(e){let t=W(),n=window.getSelection(),r=document.activeElement,i=e.getRootElement();if(t!==null&&n!==null&&i!==null&&i.contains(n.anchorNode)&&e.isEditable()){let e=n.getRangeAt(0),t;if(n.isCollapsed){let e=n.anchorNode;e?.nodeType==3&&(e=e.parentNode),t=e.getBoundingClientRect(),t.width=0}else if(n.anchorNode===i){let e=i;for(;e.firstElementChild!=null;)e=e.firstElementChild;t=e.getBoundingClientRect()}else t=e.getBoundingClientRect();let r=hj(i);if(r){let e=r.getBoundingClientRect();return{top:Math.round(t.top-e.top),left:Math.round(t.left-e.left),width:Math.round(t.width),height:Math.round(t.height)}}return{top:Math.round(t.top),left:Math.round(t.left),width:Math.round(t.width),height:Math.round(t.height)}}else if(r?.className!==`link-input`)return null;return null}function _j(e,t){let n=``;return e.getEditorState().read(()=>{let e=W();if(!e||!U(e)||e.isCollapsed())return;let t=e.getNodes();if(t.length===0)return;let r=new Set;t.forEach(e=>{let t=e;for(;t;){if(cx(t)||GA(t)||t.getType()===`paragraph`||t.getType()===`quote`){G(t)&&r.add(t);break}t=t.getParent()}});let i=r.size>0?Array.from(r):t;function a(e){if(cx(e)){let t=parseInt(e.getTag().replace(`h`,``)),n=e.getChildren().map(e=>a(e)).join(``);return`#`.repeat(t)+` `+n+`
|
|
80
|
+
|
|
81
|
+
`}else if(GA(e)){let t=e.getParent();return(t&&QA(t)&&t.getListType()===`number`?`1. `:`- `)+e.getChildren().map(e=>a(e)).join(``)+`
|
|
82
|
+
`}else if(QA(e))return e.getChildren().map(e=>a(e)).join(``)+`
|
|
83
|
+
`;else if(H(e)){let t=e.getTextContent(),n=e.getFormat();return n&16?`\`${t}\``:(n&1&&(t=`**${t}**`),n&2&&(t=`*${t}*`),n&4&&(t=`~~${t}~~`),t)}else if(hA(e)){let t=e.getURL(),n=e.getTitle(),r=e.getChildren().map(e=>a(e)).join(``);return n?`[${r}](${t} "${n}")`:`[${r}](${t})`}else if(G(e))return e.getChildren().map(e=>a(e)).join(``);return e.getTextContent()}n=i.map(e=>a(e)).join(``)}),n.trim()}var vj=t(lA(),1),yj=({children:e})=>{let t=Id(bO),n=L.useMemo(()=>[t,Jd(null,vO)],[t]);return L.createElement(qd.Provider,{value:n},e)},bj=()=>{let e=Bk(),t=Rd(ZO),n=Rd(Ete),r=e=>{n(e),t(e?{current:e}:null)},[i,a,o,s,c,l,u]=Ld(SO,CO,vk,bk,wk,TO,Sk);return L.createElement(L.Fragment,null,s.map((e,t)=>L.createElement(e,{key:t})),L.createElement(wj,{wrappers:c},L.createElement(`div`,{className:(0,vj.default)(J.rootContentEditableWrapper,`mdxeditor-root-contenteditable`)},L.createElement(sA,{contentEditable:L.createElement(`div`,{ref:r},L.createElement(Yk,{className:(0,vj.default)(J.contentEditable,i),ariaLabel:e(`contentArea.editableMarkdown`,`editable markdown`),spellCheck:a})),placeholder:L.createElement(`div`,{className:(0,vj.default)(J.contentEditable,J.placeholder,i)},L.createElement(`p`,null,l)),ErrorBoundary:tA}))),o.map((e,t)=>L.createElement(e,{key:t})),u.map((e,t)=>L.createElement(e,{key:t})))},xj={listItemIndent:`one`},Sj=e=>uA[e];function Cj(e,t,n={}){let r=t;for(let[e,t]of Object.entries(n))r=r.replaceAll(`{{${e}}}`,String(t));return r}var wj=({wrappers:e,children:t})=>{if(e.length===0)return L.createElement(L.Fragment,null,t);let n=e[0];return L.createElement(n,null,L.createElement(wj,{wrappers:e.slice(1)},t))},Tj=({children:e,className:t,overlayContainer:n})=>{let r=L.useRef(null),i=L.useRef(null),a=Rd(YO),o=Rd(XO);return L.useEffect(()=>{let e=document.createElement(`div`);return e.classList.add(`mdxeditor-popup-container`,J.editorRoot,J.popupContainer,...(t??``).trim().split(` `).filter(Boolean)),(n??document.body).appendChild(e),r.current=e,a(r),o(i),()=>{e.remove()}},[t,r,n,a,o]),L.createElement(`div`,{className:(0,vj.default)(`mdxeditor`,J.editorRoot,J.editorWrapper,t),ref:i},e)},Ej=({mdxRef:e})=>{let t=Fd();return L.useImperativeHandle(e,()=>({getMarkdown:()=>{let e=t.getValue(Nk);return e===`source`||e===`diff`?t.getValue(Pk):t.getValue(PO)},setMarkdown:e=>{t.pub(ak,e)},insertMarkdown:e=>{t.pub(ok,e)},focus:(e,n)=>{var r;(r=t.getValue(bO))==null||r.focus(e,n)},getContentEditableHTML:()=>t.getValue(ZO)?.current.innerHTML??``,getSelectionMarkdown:()=>{let e=t.getValue(Nk);if(e===`source`||e===`diff`)return``;let n=t.getValue(xO);return n?(t.getValue(HO),t.getValue(UO),t.getValue(WO),t.getValue(KO),t.getValue(GO),_j(n)):``}}),[t]),null},Dj=L.forwardRef((e,t)=>L.createElement(Kd,{plugins:[zk({contentEditableClassName:e.contentEditableClassName??``,spellCheck:e.spellCheck??!0,initialMarkdown:e.markdown,onChange:e.onChange??Wd,onBlur:e.onBlur??Wd,toMarkdownOptions:e.toMarkdownOptions??xj,autoFocus:e.autoFocus??!1,placeholder:e.placeholder??``,readOnly:!!e.readOnly,iconComponentFor:e.iconComponentFor??Sj,suppressHtmlProcessing:e.suppressHtmlProcessing??!1,onError:e.onError??Wd,translation:e.translation??Cj,trim:e.trim??!0,lexicalTheme:e.lexicalTheme,...`editorState`in e?{editorState:e.editorState}:{},suppressSharedHistory:e.suppressSharedHistory??!1,additionalLexicalNodes:e.additionalLexicalNodes??[],lexicalEditorNamespace:e.lexicalEditorNamespace??`MDXEditor`}),...e.plugins??[]]},L.createElement(Tj,{className:e.className,overlayContainer:e.overlayContainer},L.createElement(yj,null,L.createElement(bj,null))),L.createElement(Ej,{mdxRef:t}))),Oj=typeof window<`u`&&window.document.createElement!==void 0&&(()=>{let e=navigator.userAgentData?.platform;return e?/mac/i.test(e):/Mac|iPod|iPhone|iPad/.test(navigator.userAgent)})();function kj(e,t){return Oj?e:t}var Aj={testLexicalNode:cx,visitLexicalNode:({lexicalNode:e,actions:t})=>{let n=parseInt(e.getTag()[1],10);t.addAndStepInto(`heading`,{depth:n})}},jj={testNode:`heading`,visitNode:function({mdastNode:e,actions:t}){t.addAndStepInto(sx(`h${e.depth}`))}},Mj=[`Digit0`,`Digit1`,`Digit2`,`Digit3`,`Digit4`,`Digit5`,`Digit6`],Nj=[1,2,3,4,5,6],Pj={Digit1:1,Digit2:2,Digit3:3,Digit4:4,Digit5:5,Digit6:6},Fj=B(Nj,e=>{e.pub(hk,t=>t.registerCommand(tm,n=>{let{code:r,ctrlKey:i,metaKey:a,altKey:o}=n;return Mj.includes(r)&&kj(a,i)&&o?(n.preventDefault(),t.update(()=>{if(r===`Digit0`)e.pub(jk,()=>Yg());else{let t=e.getValue(Fj),n=Pj[r];t.includes(n)&&e.pub(jk,()=>sx(`h${n}`))}}),!0):!1},1))}),Ij=Gd({init(e){e.pubIn({[Ik]:`headings`,[$O]:jj,[QO]:rx,[nk]:Aj})},update(e,t){e.pub(Fj,t?.allowedHeadingLevels??Nj)}});function Lj(e,t){return e.getEditorState().read((()=>{let e=C_(t);return e!==null&&e.isSelected()}))}function Rj(e){let[t]=Yd(),[n,r]=(0,L.useState)((()=>Lj(t,e)));return(0,L.useEffect)((()=>{let n=!0,i=t.registerUpdateListener((()=>{n&&r(Lj(t,e))}));return()=>{n=!1,i()}}),[t,e]),[n,(0,L.useCallback)((n=>{t.update((()=>{let t=W();Lh(t)||(t=Yh(),j_(t)),Lh(t)&&(n?t.add(e):t.delete(e))}))}),[t,e]),(0,L.useCallback)((()=>{t.update((()=>{let e=W();Lh(e)&&e.clear()}))}),[t])]}var zj=Bp(`INSERT_HORIZONTAL_RULE_COMMAND`);function Bj({nodeKey:e}){let[t]=Yd(),[n,r,i]=Rj(e);return(0,L.useEffect)((()=>Xy(t.registerCommand(Up,(a=>{let o=t.getElementByKey(e);return a.target===o&&(a.shiftKey||i(),r(!n),!0)}),1))),[i,t,n,e,r]),(0,L.useEffect)((()=>{let r=t.getElementByKey(e),i=t._config.theme.hrSelected??`selected`;r!==null&&(n?$y(r,i):eb(r,i))}),[t,n,e]),null}var Vj=class e extends Ig{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return Uj().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:Hj,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return $y(t,e.theme.hr),t}getTextContent(){return`
|
|
84
|
+
`}isInline(){return!1}updateDOM(){return!1}decorate(){return(0,R.jsx)(Bj,{nodeKey:this.__key})}};function Hj(){return{node:Uj()}}function Uj(){return lv(new Vj)}function Wj(e){return e instanceof Vj}function Gj(){let[e]=Yd();return(0,L.useEffect)((()=>e.registerCommand(zj,(e=>{let t=W();return U(t)?(t.focus.getNode()!==null&&ib(Uj()),!0):!1}),0)),[e]),null}var Kj={testLexicalNode:Wj,visitLexicalNode({actions:e}){e.addAndStepInto(`thematicBreak`)}},qj={testNode:`thematicBreak`,visitNode({actions:e}){e.addAndStepInto(Uj())}},Jj=Nd(e=>{e.sub(e.pipe(Jj,Bd(xO)),([,e])=>{e?.dispatchCommand(zj,void 0)})}),Yj=Gd({init(e){e.pubIn({[Ik]:`thematicBreak`,[$O]:qj,[QO]:Vj,[nk]:Kj,[yk]:Gj})}}),Xj={testNode:`list`,visitNode:function({mdastNode:e,lexicalParent:t,actions:n}){let r=ZA(e.children.some(e=>typeof e.checked==`boolean`)?`check`:e.ordered?`number`:`bullet`);if(GA(t)){let e=WA();e.append(r),t.insertAfter(e)}else t.append(r);n.visitChildren(e,r)}},Zj={testNode:`listItem`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){let r=n.getListType()===`check`?e.checked??!1:void 0;t.addAndStepInto(WA(r))}},Qj={testLexicalNode:QA,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`list`,{ordered:e.getListType()===`number`,spread:!1})}},$j={testLexicalNode:GA,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{let r=e.getChildren(),i=r[0];if(r.length===1&&QA(i)){let r=t.children.at(-1);r?n.visitChildren(e,r):n.visitChildren(i,t)}else{let r=e.getParent(),i=n.appendToParent(t,{type:`listItem`,checked:r.getListType()===`check`?!!e.getChecked():void 0,spread:!1,children:[]}),a=null;for(let t of e.getChildren())H(t)||lh(t)||t.isInline()&&(G(t)||Lg(t))?(a??=n.appendToParent(i,{type:`paragraph`,children:[]}),n.visit(t,a)):(a=null,n.visit(t,i))}}};function eM(e,t){return Xy(e.registerCommand(fm,(t=>{let n=W();if(!U(n))return!1;t.preventDefault();let r=function(e){if(cb(e.getNodes(),(e=>Kh(e)&&e.canIndent()?e:null)).length>0)return!0;let t=e.anchor,n=e.focus,r=n.isBefore(t)?n:t,i=nb(r.getNode());if(i.canIndent()){let e=i.getKey(),t=Jh();if(t.anchor.set(e,0,`element`),t.focus.set(e,0,`element`),t=ip(t),t.anchor.is(r))return!0}return!1}(n)?t.shiftKey?hm:mm:pm;return e.dispatchCommand(r,void 0)}),0),e.registerCommand(mm,(()=>{if(t==null)return!1;let e=W();if(!U(e))return!1;let n=e.getNodes().map((e=>nb(e).getIndent()));return Math.max(...n)+1>=t}),4))}function tM({maxIndent:e}){let[t]=Yd();return(0,L.useEffect)((()=>eM(t,e)),[t,e]),null}function nM(){let[e]=Yd();return(0,L.useEffect)((()=>ej(e)),[e]),null}function rM({hasStrictIndent:e=!1}){let[t]=Yd();return(0,L.useEffect)((()=>{if(!t.hasNodes([KA,VA]))throw Error(`ListPlugin: ListNode and/or ListItemNode not registered on editor`)}),[t]),(0,L.useEffect)((()=>{if(e)return dj(t)}),[t,e]),function(e){(0,L.useEffect)((()=>uj(e)),[e])}(t),null}var iM={name:`tasklistCheck`,tokenize:oM};function aM(){return{text:{91:iM}}}function oM(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Cx(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return q(r)?t(r):wx(r)?e.check({tokenize:sM},t,n)(r):n(r)}}function sM(e,t,n){return kC(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function cM(){return{exit:{taskListCheckValueChecked:uM,taskListCheckValueUnchecked:uM,paragraph:dM}}}function lM(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:fM}}}function uM(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function dM(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function fM(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=TT.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}var pM=new Map([[`number`,cj],[`bullet`,sj],[`check`,$A],[``,lj]]),mM=B(``,e=>{e.sub(e.pipe(MO,Bd(xO)),([t,n])=>{if(!t||!n)return;let r=t.anchor.getNode(),i=r.getKey()===`root`?r:rb(r,e=>{let t=e.getParent();return t!==null&&cv(t)});i??=r.getTopLevelElementOrThrow();let a=i.getKey();if(n.getElementByKey(a)!==null)if(QA(i)){let t=tb(r,KA),n=t?t.getListType():i.getListType();e.pub(mM,n)}else e.pub(mM,``)})}),hM=Md(e=>{e.sub(e.pipe(hM,Bd(xO)),([e,t])=>{t?.dispatchCommand(pM.get(e),void 0)})}),gM=Gd({init(e){var t;(t=e.getValue(bO))==null||t.registerCommand(mm,()=>!vM(7),4),e.pubIn({[Ik]:`lists`,[tk]:cM(),[ek]:aM(),[$O]:[Xj,Zj],[QO]:[VA,KA],[nk]:[Qj,$j],[rk]:lM(),[yk]:[tM,rM,nM],[Tk]:[tM,rM,nM]})}});function _M(e){let t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(e=>G(e)?e:e.getParentOrThrow()))}function vM(e){let t=W();if(!U(t))return!1;let n=_M(t),r=0;for(let e of n)if(QA(e))r=Math.max(TA(e)+1,r);else if(GA(e)){let t=e.getParent();if(t?.getChildren().length===1){let e=t.getParent();if(GA(e)&&e.getChildren().length===1)return!1}if(!QA(t))throw Error(`ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.`);r=Math.max(TA(t)+1,r)}return r<=e}function yM(e){return e.length}function bM(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||yM,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=xM(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=SM(r[d]);else{let e=SM(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
85
|
+
`)}function xM(e){return e==null?``:String(e)}function SM(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function CM(){return{enter:{table:wM,tableData:OM,tableHeader:OM,tableRow:EM},exit:{codeText:kM,table:TM,tableData:DM,tableHeader:DM,tableRow:DM}}}function wM(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function TM(e){this.exit(e),this.data.inTable=void 0}function EM(e){this.enter({type:`tableRow`,children:[]},e)}function DM(e){this.exit(e)}function OM(e){this.enter({type:`tableCell`,children:[]},e)}function kM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,AM));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function AM(e,t){return t===`|`?t:e}function jM(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
86
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
87
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return bM(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=TT.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}var MM=class{constructor(){this.map=[]}add(e,t,n){NM(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function NM(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function PM(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function FM(){return{flow:{null:{name:`table`,tokenize:IM,resolveAll:LM}}}}function IM(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):wx(t)?kC(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Cx(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,wx(t)?kC(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return wx(t)?kC(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return wx(t)?kC(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||q(n)?(e.exit(`tableRow`),t(n)):wx(n)?kC(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Cx(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function LM(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new MM;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(zM(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=RM(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=RM(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=RM(f,t,o,i,n,d)):(o[0]=o[1],d=RM(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&zM(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=PM(t.events,n))}return e}function RM(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},BM(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=BM(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=BM(t.events,n[2]),a=BM(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},BM(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function zM(e,t,n,r,i){let a=[],o=BM(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function BM(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var VM=[[`Cat`,`rgb(125, 50, 0)`],[`Dog`,`rgb(100, 0, 0)`],[`Rabbit`,`rgb(150, 0, 0)`],[`Frog`,`rgb(200, 0, 0)`],[`Fox`,`rgb(200, 75, 0)`],[`Hedgehog`,`rgb(0, 75, 0)`],[`Pigeon`,`rgb(0, 125, 0)`],[`Squirrel`,`rgb(75, 100, 0)`],[`Bear`,`rgb(125, 100, 0)`],[`Tiger`,`rgb(0, 0, 150)`],[`Leopard`,`rgb(0, 0, 200)`],[`Zebra`,`rgb(0, 0, 250)`],[`Wolf`,`rgb(0, 100, 150)`],[`Owl`,`rgb(0, 100, 100)`],[`Gull`,`rgb(100, 0, 100)`],[`Squid`,`rgb(150, 0, 150)`]],HM=VM[Math.floor(Math.random()*VM.length)],UM=(0,L.createContext)({clientID:0,color:HM[1],isCollabActive:!1,name:HM[0],yjsDocMap:new Map});function WM(e,t){let n=(0,L.useContext)(UM);return e!=null&&(n.name=e),t!=null&&(n.color=t),n}function GM(e){let t=new Set,{ownNodeConfig:n}=Mv(e),r=e.transform();if(n){let e=n.$transform;e&&t.add(e)}return r&&t.add(r),t}function KM({initialEditor:e,children:t,initialNodes:n,initialTheme:r,skipCollabChecks:i,skipEditableListener:a}){let o=(0,L.useRef)(!1),s=(0,L.useContext)(qd);s??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(9);let[c,{getTheme:l}]=s,u=(0,L.useMemo)((()=>{let t=r||l()||void 0,i=Jd(s,t);t!==void 0&&(e._config.theme=t),e._parentEditor=e._parentEditor||c;let a=e._createEditorArgs,o=a&&a.namespace;if(n){o||(e._config.namespace=c._config.namespace);for(let t of n){let n=null,r=null;if(typeof t!=`function`){let e=t;t=e.replace,n=e.with,r=e.withKlass||null}let i=i_(e,t.getType());e._nodes.set(t.getType(),{exportDOM:i?i.exportDOM:void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:qf(t),transforms:GM(t)})}}else if(a&&a.nodes)o||(e._config.namespace=c._config.namespace);else{let t=e._nodes=new Map(c._nodes);o||(e._config.namespace=c._config.namespace);for(let[n,r]of t)e._nodes.set(n,{exportDOM:r.exportDOM,klass:r.klass,replace:r.replace,replaceWithKlass:r.replaceWithKlass,sharedNodeState:qf(r.klass),transforms:GM(r.klass)})}return[e,i]}),[]),{isCollabActive:d,yjsDocMap:f}=WM(),p=i||o.current||f.has(e.getKey());return(0,L.useEffect)((()=>{p&&(o.current=!0)}),[p]),(0,L.useEffect)((()=>{if(!a){let t=t=>e.setEditable(t);return t(c.isEditable()),c.registerEditableListener(t)}}),[e,c,a]),(0,R.jsx)(qd.Provider,{value:u,children:!d||p?t:null})}typeof window<`u`&&window.document&&window.document.createElement;function qM(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function JM(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function YM(...e){return t=>{let n=!1,r=e.map(e=>{let r=JM(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():JM(e[t],null)}}}}function XM(...e){return L.useCallback(YM(...e),e)}function ZM(e,t=[]){let n=[];function r(t,r){let i=L.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=L.useMemo(()=>o,Object.values(o));return(0,R.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=L.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>L.createContext(e));return function(n){let r=n?.[e]||t;return L.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,QM(i,...t)]}function QM(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return L.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function $M(e){let t=eN(e),n=L.forwardRef((e,n)=>{let{children:r,...i}=e,a=L.Children.toArray(r),o=a.find(rN);if(o){let e=o.props.children,r=a.map(t=>t===o?L.Children.count(e)>1?L.Children.only(null):L.isValidElement(e)?e.props.children:null:t);return(0,R.jsx)(t,{...i,ref:n,children:L.isValidElement(e)?L.cloneElement(e,void 0,r):null})}return(0,R.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function eN(e){let t=L.forwardRef((e,t)=>{let{children:n,...r}=e;if(L.isValidElement(n)){let e=aN(n),i=iN(r,n.props);return n.type!==L.Fragment&&(i.ref=t?YM(t,e):e),L.cloneElement(n,i)}return L.Children.count(n)>1?L.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tN=Symbol(`radix.slottable`);function nN(e){let t=({children:e})=>(0,R.jsx)(R.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=tN,t}function rN(e){return L.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===tN}function iN(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function aN(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oN=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=$M(`Primitive.${t}`),r=L.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,R.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sN(e,t){e&&Ma.flushSync(()=>e.dispatchEvent(t))}function cN(e){let t=L.useRef(e);return L.useEffect(()=>{t.current=e}),L.useMemo(()=>(...e)=>t.current?.(...e),[])}function lN(e,t=globalThis?.document){let n=cN(e);L.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var uN=`DismissableLayer`,dN=`dismissableLayer.update`,fN=`dismissableLayer.pointerDownOutside`,pN=`dismissableLayer.focusOutside`,mN,hN=L.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gN=L.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=L.useContext(hN),[u,d]=L.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=L.useState({}),m=XM(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=kte(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=Ate(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return lN(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),L.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(mN=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),yN(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=mN)}},[u,f,n,l]),L.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),yN())},[u,l]),L.useEffect(()=>{let e=()=>p({});return document.addEventListener(dN,e),()=>document.removeEventListener(dN,e)},[]),(0,R.jsx)(oN.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:qM(e.onFocusCapture,S.onFocusCapture),onBlurCapture:qM(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:qM(e.onPointerDownCapture,x.onPointerDownCapture)})});gN.displayName=uN;var _N=`DismissableLayerBranch`,vN=L.forwardRef((e,t)=>{let n=L.useContext(hN),r=L.useRef(null),i=XM(t,r);return L.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,R.jsx)(oN.div,{...e,ref:i})});vN.displayName=_N;function kte(e,t=globalThis?.document){let n=cN(e),r=L.useRef(!1),i=L.useRef(()=>{});return L.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){bN(fN,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ate(e,t=globalThis?.document){let n=cN(e),r=L.useRef(!1);return L.useEffect(()=>{let e=e=>{e.target&&!r.current&&bN(pN,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yN(){let e=new CustomEvent(dN);document.dispatchEvent(e)}function bN(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?sN(i,a):i.dispatchEvent(a)}var xN=0;function SN(){L.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??CN()),document.body.insertAdjacentElement(`beforeend`,e[1]??CN()),xN++,()=>{xN===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),xN--}},[])}function CN(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var wN=`focusScope.autoFocusOnMount`,TN=`focusScope.autoFocusOnUnmount`,EN={bubbles:!1,cancelable:!0},jte=`FocusScope`,DN=L.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=L.useState(null),l=cN(i),u=cN(a),d=L.useRef(null),f=XM(t,e=>c(e)),p=L.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;L.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:AN(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||AN(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&AN(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),L.useEffect(()=>{if(s){jN.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(wN,EN);s.addEventListener(wN,l),s.dispatchEvent(t),t.defaultPrevented||(Mte(NN(ON(s)),{select:!0}),document.activeElement===e&&AN(s))}return()=>{s.removeEventListener(wN,l),setTimeout(()=>{let t=new CustomEvent(TN,EN);s.addEventListener(TN,u),s.dispatchEvent(t),t.defaultPrevented||AN(e??document.body,{select:!0}),s.removeEventListener(TN,u),jN.remove(p)},0)}}},[s,l,u,p]);let m=L.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Nte(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&AN(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&AN(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,R.jsx)(oN.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});DN.displayName=jte;function Mte(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(AN(r,{select:t}),document.activeElement!==n)return}function Nte(e){let t=ON(e);return[kN(t,e),kN(t.reverse(),e)]}function ON(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function kN(e,t){for(let n of e)if(!Pte(n,{upTo:t}))return n}function Pte(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Fte(e){return e instanceof HTMLInputElement&&`select`in e}function AN(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Fte(e)&&t&&e.select()}}var jN=Ite();function Ite(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=MN(e,t),e.unshift(t)},remove(t){e=MN(e,t),e[0]?.resume()}}}function MN(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function NN(e){return e.filter(e=>e.tagName!==`A`)}var PN=globalThis?.document?L.useLayoutEffect:()=>{},FN=L.useId||(()=>void 0),IN=0;function LN(e){let[t,n]=L.useState(FN());return PN(()=>{e||n(e=>e??String(IN++))},[e]),e||(t?`radix-${t}`:``)}var RN=[`top`,`right`,`bottom`,`left`],zN=Math.min,BN=Math.max,VN=Math.round,HN=Math.floor,UN=e=>({x:e,y:e}),WN={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function GN(e,t,n){return BN(e,zN(t,n))}function KN(e,t){return typeof e==`function`?e(t):e}function qN(e){return e.split(`-`)[0]}function JN(e){return e.split(`-`)[1]}function YN(e){return e===`x`?`y`:`x`}function XN(e){return e===`y`?`height`:`width`}function ZN(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function QN(e){return YN(ZN(e))}function $N(e,t,n){n===void 0&&(n=!1);let r=JN(e),i=QN(e),a=XN(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=cP(o)),[o,cP(o)]}function eP(e){let t=cP(e);return[tP(e),t,tP(t)]}function tP(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var nP=[`left`,`right`],rP=[`right`,`left`],iP=[`top`,`bottom`],aP=[`bottom`,`top`];function oP(e,t,n){switch(e){case`top`:case`bottom`:return n?t?rP:nP:t?nP:rP;case`left`:case`right`:return t?iP:aP;default:return[]}}function sP(e,t,n,r){let i=JN(e),a=oP(qN(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(tP)))),a}function cP(e){let t=qN(e);return WN[t]+e.slice(t.length)}function lP(e){return{top:0,right:0,bottom:0,left:0,...e}}function uP(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:lP(e)}function dP(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fP(e,t,n){let{reference:r,floating:i}=e,a=ZN(t),o=QN(t),s=XN(o),c=qN(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(JN(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function pP(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=KN(t,e),p=uP(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=dP(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=dP(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var mP=50,hP=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:pP},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=fP(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<mP&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=fP(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},gP=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=KN(e,t)||{};if(l==null)return{};let d=uP(u),f={x:n,y:r},p=QN(i),m=XN(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=zN(d[_],T),D=zN(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=GN(O,A,k),M=!c.arrow&&JN(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),_P=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=KN(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=qN(r),_=ZN(o),v=qN(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[cP(o)]:eP(o)),x=p!==`none`;!d&&x&&b.push(...sP(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=$N(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ZN(t))||T.every(e=>ZN(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ZN(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function vP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yP(e){return RN.some(t=>e[t]>=0)}var bP=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=KN(e,t);switch(i){case`referenceHidden`:{let e=vP(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:yP(e)}}}case`escaped`:{let e=vP(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:yP(e)}}}default:return{}}}}},xP=new Set([`left`,`top`]);async function SP(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=qN(n),s=JN(n),c=ZN(n)===`y`,l=xP.has(o)?-1:1,u=a&&c?-1:1,d=KN(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var CP=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await SP(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},wP=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=KN(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ZN(qN(i)),p=YN(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=GN(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=GN(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},TP=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=KN(e,t),u={x:n,y:r},d=ZN(i),f=YN(d),p=u[f],m=u[d],h=KN(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=xP.has(qN(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},EP=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=KN(e,t),u=await o.detectOverflow(t,l),d=qN(i),f=JN(i),p=ZN(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=zN(h-u[g],v),x=zN(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=BN(u.left,0),t=BN(u.right,0),n=BN(u.top,0),r=BN(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:BN(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:BN(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function DP(){return typeof window<`u`}function OP(e){return jP(e)?(e.nodeName||``).toLowerCase():`#document`}function kP(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function AP(e){return((jP(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function jP(e){return DP()?e instanceof Node||e instanceof kP(e).Node:!1}function MP(e){return DP()?e instanceof Element||e instanceof kP(e).Element:!1}function NP(e){return DP()?e instanceof HTMLElement||e instanceof kP(e).HTMLElement:!1}function PP(e){return!DP()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof kP(e).ShadowRoot}function FP(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=KP(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function IP(e){return/^(table|td|th)$/.test(OP(e))}function LP(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var RP=/transform|translate|scale|rotate|perspective|filter/,zP=/paint|layout|strict|content/,BP=e=>!!e&&e!==`none`,VP;function HP(e){let t=MP(e)?KP(e):e;return BP(t.transform)||BP(t.translate)||BP(t.scale)||BP(t.rotate)||BP(t.perspective)||!WP()&&(BP(t.backdropFilter)||BP(t.filter))||RP.test(t.willChange||``)||zP.test(t.contain||``)}function UP(e){let t=JP(e);for(;NP(t)&&!GP(t);){if(HP(t))return t;if(LP(t))return null;t=JP(t)}return null}function WP(){return VP??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),VP}function GP(e){return/^(html|body|#document)$/.test(OP(e))}function KP(e){return kP(e).getComputedStyle(e)}function qP(e){return MP(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function JP(e){if(OP(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||PP(e)&&e.host||AP(e);return PP(t)?t.host:t}function YP(e){let t=JP(e);return GP(t)?e.ownerDocument?e.ownerDocument.body:e.body:NP(t)&&FP(t)?t:YP(t)}function XP(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=YP(e),i=r===e.ownerDocument?.body,a=kP(r);if(i){let e=ZP(a);return t.concat(a,a.visualViewport||[],FP(r)?r:[],e&&n?XP(e):[])}else return t.concat(r,XP(r,[],n))}function ZP(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function QP(e){let t=KP(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=NP(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=VN(n)!==a||VN(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $P(e){return MP(e)?e:e.contextElement}function eF(e){let t=$P(e);if(!NP(t))return UN(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=QP(t),o=(a?VN(n.width):n.width)/r,s=(a?VN(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var tF=UN(0);function nF(e){let t=kP(e);return!WP()||!t.visualViewport?tF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==kP(e)?!1:t}function iF(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$P(e),o=UN(1);t&&(r?MP(r)&&(o=eF(r)):o=eF(e));let s=rF(a,n,r)?nF(a):UN(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=kP(a),t=r&&MP(r)?kP(r):r,n=e,i=ZP(n);for(;i&&r&&t!==n;){let e=eF(i),t=i.getBoundingClientRect(),r=KP(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=kP(i),i=ZP(n)}}return dP({width:u,height:d,x:c,y:l})}function aF(e,t){let n=qP(e).scrollLeft;return t?t.left+n:iF(AP(e)).left+n}function oF(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-aF(e,n),y:n.top+t.scrollTop}}function sF(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=AP(r),s=t?LP(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=UN(1),u=UN(0),d=NP(r);if((d||!d&&!a)&&((OP(r)!==`body`||FP(o))&&(c=qP(r)),d)){let e=iF(r);l=eF(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?oF(o,c):UN(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function cF(e){return Array.from(e.getClientRects())}function lF(e){let t=AP(e),n=qP(e),r=e.ownerDocument.body,i=BN(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=BN(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+aF(e),s=-n.scrollTop;return KP(r).direction===`rtl`&&(o+=BN(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var uF=25;function dF(e,t){let n=kP(e),r=AP(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=WP();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=aF(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=uF&&(a-=o)}else l<=uF&&(a+=l);return{width:a,height:o,x:s,y:c}}function fF(e,t){let n=iF(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=NP(e)?eF(e):UN(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function pF(e,t,n){let r;if(t===`viewport`)r=dF(e,n);else if(t===`document`)r=lF(AP(e));else if(MP(t))r=fF(t,n);else{let n=nF(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return dP(r)}function mF(e,t){let n=JP(e);return n===t||!MP(n)||GP(n)?!1:KP(n).position===`fixed`||mF(n,t)}function hF(e,t){let n=t.get(e);if(n)return n;let r=XP(e,[],!1).filter(e=>MP(e)&&OP(e)!==`body`),i=null,a=KP(e).position===`fixed`,o=a?JP(e):e;for(;MP(o)&&!GP(o);){let t=KP(o),n=HP(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||FP(o)&&!n&&mF(e,o))?r=r.filter(e=>e!==o):i=t,o=JP(o)}return t.set(e,r),r}function gF(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?LP(t)?[]:hF(t,this._c):[].concat(n),r],o=pF(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=pF(t,a[e],i);s=BN(n.top,s),c=zN(n.right,c),l=zN(n.bottom,l),u=BN(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function _F(e){let{width:t,height:n}=QP(e);return{width:t,height:n}}function vF(e,t,n){let r=NP(t),i=AP(t),a=n===`fixed`,o=iF(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=UN(0);function l(){c.x=aF(i)}if(r||!r&&!a)if((OP(t)!==`body`||FP(i))&&(s=qP(t)),r){let e=iF(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?oF(i,s):UN(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function yF(e){return KP(e).position===`static`}function bF(e,t){if(!NP(e)||KP(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return AP(e)===n&&(n=n.ownerDocument.body),n}function xF(e,t){let n=kP(e);if(LP(e))return n;if(!NP(e)){let t=JP(e);for(;t&&!GP(t);){if(MP(t)&&!yF(t))return t;t=JP(t)}return n}let r=bF(e,t);for(;r&&IP(r)&&yF(r);)r=bF(r,t);return r&&GP(r)&&yF(r)&&!HP(r)?n:r||UP(e)||n}var SF=async function(e){let t=this.getOffsetParent||xF,n=this.getDimensions,r=await n(e.floating);return{reference:vF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function CF(e){return KP(e).direction===`rtl`}var wF={convertOffsetParentRelativeRectToViewportRelativeRect:sF,getDocumentElement:AP,getClippingRect:gF,getOffsetParent:xF,getElementRects:SF,getClientRects:cF,getDimensions:_F,getScale:eF,isElement:MP,isRTL:CF};function TF(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function EF(e,t){let n=null,r,i=AP(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=HN(d),h=HN(i.clientWidth-(u+f)),g=HN(i.clientHeight-(d+p)),_=HN(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:BN(0,zN(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!TF(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function DF(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=$P(e),u=i||a?[...l?XP(l):[],...t?XP(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?EF(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?iF(e):null;c&&g();function g(){let t=iF(e);h&&!TF(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var OF=CP,kF=wP,AF=_P,jF=EP,MF=bP,NF=gP,PF=TP,FF=(e,t,n)=>{let r=new Map,i={platform:wF,...n},a={...i.platform,_c:r};return hP(e,t,{...i,platform:a})},IF=typeof document<`u`?L.useLayoutEffect:function(){};function LF(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!LF(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!LF(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function RF(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zF(e,t){let n=RF(e);return Math.round(t*n)/n}function BF(e){let t=L.useRef(e);return IF(()=>{t.current=e}),t}function VF(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=L.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=L.useState(r);LF(f,r)||p(r);let[m,h]=L.useState(null),[g,_]=L.useState(null),v=L.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=L.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=L.useRef(null),C=L.useRef(null),w=L.useRef(u),T=c!=null,E=BF(c),D=BF(i),O=BF(l),k=L.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),FF(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!LF(w.current,t)&&(w.current=t,Ma.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);IF(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=L.useRef(!1);IF(()=>(A.current=!0,()=>{A.current=!1}),[]),IF(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=L.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=L.useMemo(()=>({reference:b,floating:x}),[b,x]),N=L.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=zF(M.floating,u.x),r=zF(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...RF(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return L.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var HF=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:NF({element:r.current,padding:i}).fn(n):r?NF({element:r,padding:i}).fn(n):{}}}},UF=(e,t)=>{let n=OF(e);return{name:n.name,fn:n.fn,options:[e,t]}},WF=(e,t)=>{let n=kF(e);return{name:n.name,fn:n.fn,options:[e,t]}},GF=(e,t)=>({fn:PF(e).fn,options:[e,t]}),KF=(e,t)=>{let n=AF(e);return{name:n.name,fn:n.fn,options:[e,t]}},qF=(e,t)=>{let n=jF(e);return{name:n.name,fn:n.fn,options:[e,t]}},JF=(e,t)=>{let n=MF(e);return{name:n.name,fn:n.fn,options:[e,t]}},YF=(e,t)=>{let n=HF(e);return{name:n.name,fn:n.fn,options:[e,t]}},XF=`Arrow`,ZF=L.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(oN.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,R.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});ZF.displayName=XF;var QF=ZF;function $F(e){let[t,n]=L.useState(void 0);return PN(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var eI=`Popper`,[tI,nI]=ZM(eI),[rI,iI]=tI(eI),aI=e=>{let{__scopePopper:t,children:n}=e,[r,i]=L.useState(null);return(0,R.jsx)(rI,{scope:t,anchor:r,onAnchorChange:i,children:n})};aI.displayName=eI;var oI=`PopperAnchor`,sI=L.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=iI(oI,n),o=L.useRef(null),s=XM(t,o),c=L.useRef(null);return L.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,R.jsx)(oN.div,{...i,ref:s})});sI.displayName=oI;var cI=`PopperContent`,[lI,uI]=tI(cI),dI=L.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=iI(cI,n),[_,v]=L.useState(null),y=XM(t,e=>v(e)),[b,x]=L.useState(null),S=$F(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(hI),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=VF({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>DF(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[UF({mainAxis:i+w,alignmentAxis:o}),c&&WF({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?GF():void 0,...k}),c&&KF({...k}),qF({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&YF({element:b,padding:s}),gI({arrowWidth:C,arrowHeight:w}),f&&JF({strategy:`referenceHidden`,...k})]}),[F,ee]=_I(M),te=cN(m);PN(()=>{N&&te?.()},[N,te]);let ne=P.arrow?.x,re=P.arrow?.y,I=P.arrow?.centerOffset!==0,[ie,ae]=L.useState();return PN(()=>{_&&ae(window.getComputedStyle(_).zIndex)},[_]),(0,R.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ie,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(lI,{scope:n,placedSide:F,onArrowChange:x,arrowX:ne,arrowY:re,shouldHideArrow:I,children:(0,R.jsx)(oN.div,{"data-side":F,"data-align":ee,...h,ref:y,style:{...h.style,animation:N?void 0:`none`}})})})});dI.displayName=cI;var fI=`PopperArrow`,pI={top:`bottom`,right:`left`,bottom:`top`,left:`right`},mI=L.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=uI(fI,n),a=pI[i.placedSide];return(0,R.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,R.jsx)(QF,{...r,ref:t,style:{...r.style,display:`block`}})})});mI.displayName=fI;function hI(e){return e!==null}var gI=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=_I(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function _I(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var vI=aI,yI=sI,bI=dI,xI=mI,SI=`Portal`,CI=L.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=L.useState(!1);PN(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Ma.createPortal((0,R.jsx)(oN.div,{...r,ref:t}),o):null});CI.displayName=SI;function wI(e,t){return L.useReducer((e,n)=>t[e][n]??e,e)}var TI=e=>{let{present:t,children:n}=e,r=EI(t),i=typeof n==`function`?n({present:r.isPresent}):L.Children.only(n),a=XM(r.ref,OI(i));return typeof n==`function`||r.isPresent?L.cloneElement(i,{ref:a}):null};TI.displayName=`Presence`;function EI(e){let[t,n]=L.useState(),r=L.useRef(null),i=L.useRef(e),a=L.useRef(`none`),[o,s]=wI(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return L.useEffect(()=>{let e=DI(r.current);a.current=o===`mounted`?e:`none`},[o]),PN(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=DI(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),PN(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=DI(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=DI(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:L.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function DI(e){return e?.animationName||`none`}function OI(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var kI=L.useInsertionEffect||PN;function AI({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=jI({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=L.useRef(e!==void 0);L.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,L.useCallback(t=>{if(s){let n=MI(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function jI({defaultProp:e,onChange:t}){let[n,r]=L.useState(e),i=L.useRef(n),a=L.useRef(t);return kI(()=>{a.current=t},[t]),L.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function MI(e){return typeof e==`function`}var NI=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},PI=new WeakMap,FI=new WeakMap,II={},LI=0,RI=function(e){return e&&(e.host||RI(e.parentNode))},zI=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=RI(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},BI=function(e,t,n,r){var i=zI(t,Array.isArray(e)?e:[e]);II[n]||(II[n]=new WeakMap);var a=II[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(PI.get(e)||0)+1,l=(a.get(e)||0)+1;PI.set(e,c),a.set(e,l),o.push(e),c===1&&i&&FI.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),LI++,function(){o.forEach(function(e){var t=PI.get(e)-1,i=a.get(e)-1;PI.set(e,t),a.set(e,i),t||(FI.has(e)||e.removeAttribute(r),FI.delete(e)),i||e.removeAttribute(n)}),LI--,LI||(PI=new WeakMap,PI=new WeakMap,FI=new WeakMap,II={})}},VI=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||NI(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),BI(r,i,n,`aria-hidden`)):function(){return null}},HI=function(){return HI=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},HI.apply(this,arguments)};function UI(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function WI(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var GI=`right-scroll-bar-position`,KI=`width-before-scroll-bar`,qI=`with-scroll-bars-hidden`,JI=`--removed-body-scroll-bar-size`;function YI(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function XI(e,t){var n=(0,L.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ZI=typeof window<`u`?L.useLayoutEffect:L.useEffect,QI=new WeakMap;function $I(e,t){var n=XI(t||null,function(t){return e.forEach(function(e){return YI(e,t)})});return ZI(function(){var t=QI.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||YI(e,null)}),i.forEach(function(e){r.has(e)||YI(e,a)})}QI.set(n,e)},[e]),n}function eL(e){return e}function tL(e,t){t===void 0&&(t=eL);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function nL(e){e===void 0&&(e={});var t=tL(null);return t.options=HI({async:!0,ssr:!1},e),t}var rL=function(e){var t=e.sideCar,n=UI(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return L.createElement(r,HI({},n))};rL.isSideCarExport=!0;function iL(e,t){return e.useMedium(t),rL}var aL=nL(),oL=function(){},sL=L.forwardRef(function(e,t){var n=L.useRef(null),r=L.useState({onScrollCapture:oL,onWheelCapture:oL,onTouchMoveCapture:oL}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=UI(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=$I([n,t]),C=HI(HI({},b),i);return L.createElement(L.Fragment,null,u&&L.createElement(x,{sideCar:aL,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?L.cloneElement(L.Children.only(s),HI(HI({},C),{ref:S})):L.createElement(v,HI({},C,{className:c,ref:S}),s))});sL.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},sL.classNames={fullWidth:KI,zeroRight:GI};var cL,lL=function(){if(cL)return cL;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function uL(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=lL();return t&&e.setAttribute(`nonce`,t),e}function dL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fL(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var pL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=uL())&&(dL(t,n),fL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mL=function(){var e=pL();return function(t,n){L.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hL=function(){var e=mL();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},gL={left:0,top:0,right:0,gap:0},_L=function(e){return parseInt(e||``,10)||0},vL=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[_L(n),_L(r),_L(i)]},yL=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return gL;var t=vL(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},bL=hL(),xL=`data-scroll-locked`,SL=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
88
|
+
.${qI} {
|
|
89
|
+
overflow: hidden ${r};
|
|
90
|
+
padding-right: ${s}px ${r};
|
|
91
|
+
}
|
|
92
|
+
body[${xL}] {
|
|
93
|
+
overflow: hidden ${r};
|
|
94
|
+
overscroll-behavior: contain;
|
|
95
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
96
|
+
padding-left: ${i}px;
|
|
97
|
+
padding-top: ${a}px;
|
|
98
|
+
padding-right: ${o}px;
|
|
99
|
+
margin-left:0;
|
|
100
|
+
margin-top:0;
|
|
101
|
+
margin-right: ${s}px ${r};
|
|
102
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.${GI} {
|
|
106
|
+
right: ${s}px ${r};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.${KI} {
|
|
110
|
+
margin-right: ${s}px ${r};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.${GI} .${GI} {
|
|
114
|
+
right: 0 ${r};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.${KI} .${KI} {
|
|
118
|
+
margin-right: 0 ${r};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
body[${xL}] {
|
|
122
|
+
${JI}: ${s}px;
|
|
123
|
+
}
|
|
124
|
+
`},CL=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},wL=function(){L.useEffect(function(){return document.body.setAttribute(xL,(CL()+1).toString()),function(){var e=CL()-1;e<=0?document.body.removeAttribute(xL):document.body.setAttribute(xL,e.toString())}},[])},TL=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;wL();var a=L.useMemo(function(){return yL(i)},[i]);return L.createElement(bL,{styles:SL(a,!t,i,n?``:`!important`)})},EL=!1;if(typeof window<`u`)try{var DL=Object.defineProperty({},`passive`,{get:function(){return EL=!0,!0}});window.addEventListener(`test`,DL,DL),window.removeEventListener(`test`,DL,DL)}catch{EL=!1}var OL=EL?{passive:!1}:!1,kL=function(e){return e.tagName===`TEXTAREA`},AL=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!kL(e)&&n[t]===`visible`)},jL=function(e){return AL(e,`overflowY`)},ML=function(e){return AL(e,`overflowX`)},NL=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),IL(e,r)){var i=LL(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},PL=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},FL=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},IL=function(e,t){return e===`v`?jL(t):ML(t)},LL=function(e,t){return e===`v`?PL(t):FL(t)},RL=function(e,t){return e===`h`&&t===`rtl`?-1:1},zL=function(e,t,n,r,i){var a=RL(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=LL(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&IL(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},BL=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},VL=function(e){return[e.deltaX,e.deltaY]},HL=function(e){return e&&`current`in e?e.current:e},UL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},WL=function(e){return`
|
|
125
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
126
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
127
|
+
`},GL=0,KL=[];function qL(e){var t=L.useRef([]),n=L.useRef([0,0]),r=L.useRef(),i=L.useState(GL++)[0],a=L.useState(hL)[0],o=L.useRef(e);L.useEffect(function(){o.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=WI([e.lockRef.current],(e.shards||[]).map(HL),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=L.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=BL(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=NL(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=NL(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return zL(h,t,e,h===`h`?s:c,!0)},[]),c=L.useCallback(function(e){var n=e;if(!(!KL.length||KL[KL.length-1]!==a)){var r=`deltaY`in n?VL(n):BL(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&UL(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(HL).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=L.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:JL(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=L.useCallback(function(e){n.current=BL(e),r.current=void 0},[]),d=L.useCallback(function(t){l(t.type,VL(t),t.target,s(t,e.lockRef.current))},[]),f=L.useCallback(function(t){l(t.type,BL(t),t.target,s(t,e.lockRef.current))},[]);L.useEffect(function(){return KL.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,OL),document.addEventListener(`touchmove`,c,OL),document.addEventListener(`touchstart`,u,OL),function(){KL=KL.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,OL),document.removeEventListener(`touchmove`,c,OL),document.removeEventListener(`touchstart`,u,OL)}},[]);var p=e.removeScrollBar,m=e.inert;return L.createElement(L.Fragment,null,m?L.createElement(a,{styles:WL(i)}):null,p?L.createElement(TL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function JL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var YL=iL(aL,qL),XL=L.forwardRef(function(e,t){return L.createElement(sL,HI({},e,{ref:t,sideCar:YL}))});XL.classNames=sL.classNames;var ZL=`Popover`,[QL,Lte]=ZM(ZL,[nI]),$L=nI(),[eR,tR]=QL(ZL),nR=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=$L(t),c=L.useRef(null),[l,u]=L.useState(!1),[d,f]=AI({prop:r,defaultProp:i??!1,onChange:a,caller:ZL});return(0,R.jsx)(vI,{...s,children:(0,R.jsx)(eR,{scope:t,contentId:LN(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:L.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:L.useCallback(()=>u(!0),[]),onCustomAnchorRemove:L.useCallback(()=>u(!1),[]),modal:o,children:n})})};nR.displayName=ZL;var rR=`PopoverAnchor`,iR=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=tR(rR,n),a=$L(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return L.useEffect(()=>(o(),()=>s()),[o,s]),(0,R.jsx)(yI,{...a,...r,ref:t})});iR.displayName=rR;var aR=`PopoverTrigger`,oR=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=tR(aR,n),a=$L(n),o=XM(t,i.triggerRef),s=(0,R.jsx)(oN.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":xR(i.open),...r,ref:o,onClick:qM(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,R.jsx)(yI,{asChild:!0,...a,children:s})});oR.displayName=aR;var sR=`PopoverPortal`,[cR,lR]=QL(sR,{forceMount:void 0}),uR=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=tR(sR,t);return(0,R.jsx)(cR,{scope:t,forceMount:n,children:(0,R.jsx)(TI,{present:n||a.open,children:(0,R.jsx)(CI,{asChild:!0,container:i,children:r})})})};uR.displayName=sR;var dR=`PopoverContent`,fR=L.forwardRef((e,t)=>{let n=lR(dR,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=tR(dR,e.__scopePopover);return(0,R.jsx)(TI,{present:r||a.open,children:a.modal?(0,R.jsx)(mR,{...i,ref:t}):(0,R.jsx)(hR,{...i,ref:t})})});fR.displayName=dR;var pR=$M(`PopoverContent.RemoveScroll`),mR=L.forwardRef((e,t)=>{let n=tR(dR,e.__scopePopover),r=L.useRef(null),i=XM(t,r),a=L.useRef(!1);return L.useEffect(()=>{let e=r.current;if(e)return VI(e)},[]),(0,R.jsx)(XL,{as:pR,allowPinchZoom:!0,children:(0,R.jsx)(gR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qM(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:qM(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:qM(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),hR=L.forwardRef((e,t)=>{let n=tR(dR,e.__scopePopover),r=L.useRef(!1),i=L.useRef(!1);return(0,R.jsx)(gR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),gR=L.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=tR(dR,n),p=$L(n);return SN(),(0,R.jsx)(DN,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(gN,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,R.jsx)(bI,{"data-state":xR(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),_R=`PopoverClose`,vR=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=tR(_R,n);return(0,R.jsx)(oN.button,{type:`button`,...r,ref:t,onClick:qM(e.onClick,()=>i.onOpenChange(!1))})});vR.displayName=_R;var yR=`PopoverArrow`,bR=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=$L(n);return(0,R.jsx)(xI,{...i,...r,ref:t})});bR.displayName=yR;function xR(e){return e?`open`:`closed`}var SR=nR,CR=iR,wR=uR,TR=fR,ER=bR;function DR(e){let t=e+`CollectionProvider`,[n,r]=ZM(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=L.useRef(null),a=L.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=$M(s),l=L.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,R.jsx)(c,{ref:XM(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=$M(u),p=L.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=L.useRef(null),s=XM(t,o),c=a(u,n);return L.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return L.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var OR=L.createContext(void 0);function kR(e){let t=L.useContext(OR);return e||t||`ltr`}var AR=`rovingFocusGroup.onEntryFocus`,jR={bubbles:!1,cancelable:!0},MR=`RovingFocusGroup`,[NR,PR,FR]=DR(MR),[IR,LR]=ZM(MR,[FR]),[RR,zR]=IR(MR),BR=L.forwardRef((e,t)=>(0,R.jsx)(NR.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(NR.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(VR,{...e,ref:t})})}));BR.displayName=MR;var VR=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=L.useRef(null),p=XM(t,f),m=kR(a),[h,g]=AI({prop:o,defaultProp:s??null,onChange:c,caller:MR}),[_,v]=L.useState(!1),y=cN(l),b=PR(n),x=L.useRef(!1),[S,C]=L.useState(0);return L.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(AR,y),()=>e.removeEventListener(AR,y)},[y]),(0,R.jsx)(RR,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:L.useCallback(e=>g(e),[g]),onItemShiftTab:L.useCallback(()=>v(!0),[]),onFocusableItemAdd:L.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:L.useCallback(()=>C(e=>e-1),[]),children:(0,R.jsx)(oN.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:qM(e.onMouseDown,()=>{x.current=!0}),onFocus:qM(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(AR,jR);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);qR([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:qM(e.onBlur,()=>v(!1))})})}),HR=`RovingFocusGroupItem`,UR=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=LN(),l=a||c,u=zR(HR,n),d=u.currentTabStopId===l,f=PR(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return L.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,R.jsx)(NR.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(oN.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:qM(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:qM(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:qM(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=KR(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?JR(n,r+1):n.slice(r+1)}setTimeout(()=>qR(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});UR.displayName=HR;var WR={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function GR(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function KR(e,t,n){let r=GR(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return WR[r]}function qR(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function JR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var YR=BR,XR=UR,ZR=`Separator`,QR=`horizontal`,$R=[`horizontal`,`vertical`],ez=L.forwardRef((e,t)=>{let{decorative:n,orientation:r=QR,...i}=e,a=tz(r)?r:QR,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,R.jsx)(oN.div,{"data-orientation":a,...o,...i,ref:t})});ez.displayName=ZR;function tz(e){return $R.includes(e)}var nz=ez,rz=`Toggle`,iz=L.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=AI({prop:n,onChange:i,defaultProp:r??!1,caller:rz});return(0,R.jsx)(oN.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:qM(e.onClick,()=>{e.disabled||s(!o)})})});iz.displayName=rz;var az=`ToggleGroup`,[oz,sz]=ZM(az,[LR]),cz=LR(),lz=L.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,R.jsx)(fz,{...r,ref:t});if(n===`multiple`)return(0,R.jsx)(pz,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${az}\``)});lz.displayName=az;var[uz,dz]=oz(az),fz=L.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=AI({prop:n,defaultProp:r??``,onChange:i,caller:az});return(0,R.jsx)(uz,{scope:e.__scopeToggleGroup,type:`single`,value:L.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:L.useCallback(()=>s(``),[s]),children:(0,R.jsx)(gz,{...a,ref:t})})}),pz=L.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=AI({prop:n,defaultProp:r??[],onChange:i,caller:az}),c=L.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=L.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,R.jsx)(uz,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,R.jsx)(gz,{...a,ref:t})})});lz.displayName=az;var[mz,hz]=oz(az),gz=L.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=cz(n),u=kR(o),d={role:`group`,dir:u,...c};return(0,R.jsx)(mz,{scope:n,rovingFocus:i,disabled:r,children:i?(0,R.jsx)(YR,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,R.jsx)(oN.div,{...d,ref:t})}):(0,R.jsx)(oN.div,{...d,ref:t})})}),_z=`ToggleGroupItem`,vz=L.forwardRef((e,t)=>{let n=dz(_z,e.__scopeToggleGroup),r=hz(_z,e.__scopeToggleGroup),i=cz(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=L.useRef(null);return r.rovingFocus?(0,R.jsx)(XR,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,R.jsx)(yz,{...s,ref:t})}):(0,R.jsx)(yz,{...s,ref:t})});vz.displayName=_z;var yz=L.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=dz(_z,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,R.jsx)(iz,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),bz=lz,xz=vz,Sz=`Toolbar`,[Cz,Rte]=ZM(Sz,[LR,sz]),wz=LR(),Tz=sz(),[Ez,Dz]=Cz(Sz),Oz=L.forwardRef((e,t)=>{let{__scopeToolbar:n,orientation:r=`horizontal`,dir:i,loop:a=!0,...o}=e,s=wz(n),c=kR(i);return(0,R.jsx)(Ez,{scope:n,orientation:r,dir:c,children:(0,R.jsx)(YR,{asChild:!0,...s,orientation:r,dir:c,loop:a,children:(0,R.jsx)(oN.div,{role:`toolbar`,"aria-orientation":r,dir:c,...o,ref:t})})})});Oz.displayName=Sz;var kz=`ToolbarSeparator`,Az=L.forwardRef((e,t)=>{let{__scopeToolbar:n,...r}=e,i=Dz(kz,n);return(0,R.jsx)(nz,{orientation:i.orientation===`horizontal`?`vertical`:`horizontal`,...r,ref:t})});Az.displayName=kz;var jz=`ToolbarButton`,Mz=L.forwardRef((e,t)=>{let{__scopeToolbar:n,...r}=e,i=wz(n);return(0,R.jsx)(XR,{asChild:!0,...i,focusable:!e.disabled,children:(0,R.jsx)(oN.button,{type:`button`,...r,ref:t})})});Mz.displayName=jz;var Nz=`ToolbarLink`,Pz=L.forwardRef((e,t)=>{let{__scopeToolbar:n,...r}=e,i=wz(n);return(0,R.jsx)(XR,{asChild:!0,...i,focusable:!0,children:(0,R.jsx)(oN.a,{...r,ref:t,onKeyDown:qM(e.onKeyDown,e=>{e.key===` `&&e.currentTarget.click()})})})});Pz.displayName=Nz;var Fz=`ToolbarToggleGroup`,Iz=L.forwardRef((e,t)=>{let{__scopeToolbar:n,...r}=e,i=Dz(Fz,n),a=Tz(n);return(0,R.jsx)(bz,{"data-orientation":i.orientation,dir:i.dir,...a,...r,ref:t,rovingFocus:!1})});Iz.displayName=Fz;var Lz=`ToolbarToggleItem`,Rz=L.forwardRef((e,t)=>{let{__scopeToolbar:n,...r}=e,i=Tz(n);return(0,R.jsx)(Mz,{asChild:!0,__scopeToolbar:e.__scopeToolbar,children:(0,R.jsx)(xz,{...i,...r,ref:t})})});Rz.displayName=Lz;var zz=Oz,Bz=Az,Vz=Mz,Hz=Iz,Uz=Rz;function Wz(e,t){return e===null||e===t?!1:e.dataset.editorDialog!==void 0||e.dataset.toolbarItem!==void 0||e.dataset.editorDropdown?!0:Wz(e.parentElement,t)}function Gz(){let e=[...Array(256).keys()].map(e=>e.toString(16).padStart(2,`0`)),t=crypto.getRandomValues(new Uint8Array(16));return t[6]=t[6]&15|64,t[8]=t[8]&63|128,[...t.entries()].map(([t,n])=>[4,6,8,10].includes(t)?`-${e[n]}`:e[n]).join(``)}var Kz=e=>e===0?`th`:`td`,qz={center:J.centeredCell,left:J.leftAlignedCell,right:J.rightAlignedCell},Jz=({mdastNode:e,parentEditor:t,lexicalTable:n})=>{let[r,i]=L.useState(null),[a,o]=Ld(fk,wO),s=L.useMemo(()=>e=>(e.__cacheKey??=Gz(),e.__cacheKey),[]),c=L.useCallback(e=>{let r=n.getColCount();if(e===null){i(null);return}let[a,o]=e;if(a>r-1&&(a=0,o++),a<0&&(a=r-1,--o),o>n.getRowCount()-1){i(null),t.update(()=>{if(n.getLatest().getNextSibling())n.getLatest().selectNext();else{let e=Yg();n.insertAfter(e),e.select()}});return}if(o<0){i(null),t.update(()=>{n.getLatest().selectPrevious()});return}i([a,o])},[n,t]);L.useEffect(()=>{n.focusEmitter.subscribe(c)},[n,c]);let l=L.useCallback(e=>{e.preventDefault(),t.update(()=>{n.addRowToBottom(),i([0,n.getRowCount()])})},[t,n]),u=L.useCallback(e=>{e.preventDefault(),t.update(()=>{n.addColumnToRight(),i([n.getColCount(),0])})},[t,n]),[d,f]=L.useState([-1,-1]),p=L.useCallback(e=>{let t=e.target;for(;t&&![`TH`,`TD`].includes(t.tagName);){if(t===e.currentTarget)return;t=t.parentElement}if(t===null)return;let n=t.parentElement;f([n.parentElement.tagName===`TFOOT`?-1:Array.from(n.children).indexOf(t),t.tagName===`TH`?-1:Array.from(n.parentElement.children).indexOf(n)])},[]),m=Bk();return L.createElement(`table`,{className:J.tableEditor,onMouseOver:p,onMouseLeave:()=>{f([-1,-1])}},L.createElement(`colgroup`,null,o?null:L.createElement(`col`,null),Array.from({length:e.children[0].children.length},(t,n)=>{let r=qz[(e.align??[])[n]??`left`];return L.createElement(`col`,{key:n,className:r})}),o?null:L.createElement(`col`,null)),o||L.createElement(`thead`,null,L.createElement(`tr`,null,L.createElement(`th`,{className:J.tableToolsColumn}),Array.from({length:e.children[0].children.length},(r,i)=>L.createElement(`th`,{key:i,"data-tool-cell":!0},L.createElement(Zz,{setActiveCellWithBoundaries:c,parentEditor:t,colIndex:i,highlightedCoordinates:d,lexicalTable:n,align:(e.align??[])[i]}))),L.createElement(`th`,{className:J.tableToolsColumn,"data-tool-cell":!0},L.createElement(`button`,{className:J.iconButton,type:`button`,title:m(`table.deleteTable`,`Delete table`),onClick:e=>{e.preventDefault(),t.update(()=>{n.selectNext(),n.remove()})}},a(`delete_small`))))),L.createElement(`tbody`,null,e.children.map((i,l)=>{let f=Kz(l);return L.createElement(`tr`,{key:l},o||L.createElement(f,{className:J.toolCell,"data-tool-cell":!0},L.createElement(Qz,{setActiveCellWithBoundaries:c,parentEditor:t,rowIndex:l,highlightedCoordinates:d,lexicalTable:n})),i.children.map((i,a)=>L.createElement(Yz,{align:e.align?.[a],key:s(i),contents:i.children,setActiveCell:c,rowIndex:l,colIndex:a,lexicalTable:n,parentEditor:t,activeCell:o?[-1,-1]:r})),o||l===0&&L.createElement(`th`,{rowSpan:n.getRowCount(),"data-tool-cell":!0},L.createElement(`button`,{type:`button`,className:J.addColumnButton,onClick:u},a(`add_column`))))})),o||L.createElement(`tfoot`,null,L.createElement(`tr`,null,L.createElement(`th`,null),L.createElement(`th`,{colSpan:n.getColCount(),"data-tool-cell":!0},L.createElement(`button`,{type:`button`,className:J.addRowButton,onClick:l},a(`add_row`))),L.createElement(`th`,null))))},Yz=({align:e,...t})=>{let{activeCell:n,setActiveCell:r}=t,i=!!(n&&n[0]===t.colIndex&&n[1]===t.rowIndex),a=qz[e??`left`],o=Kz(t.rowIndex);return L.createElement(o,{className:a,"data-active":i,onClick:()=>{r([t.colIndex,t.rowIndex])}},L.createElement(Xz,{...t,focus:i}))},Xz=({focus:e,setActiveCell:t,parentEditor:n,lexicalTable:r,contents:i,colIndex:a,rowIndex:o})=>{let[s,c,l,u,d,f,p,m,h]=Ld(RO,HO,zO,KO,qO,JO,GO,bO,Ek),[g]=L.useState(()=>{let e=Qg({nodes:l,theme:vO,namespace:`TableCellEditor`});return e.update(()=>{KD({root:k_(),mdastRoot:{type:`root`,children:[{type:`paragraph`,children:i}]},visitors:s,jsxComponentDescriptors:u,directiveDescriptors:d,codeBlockEditorDescriptors:f})}),e}),_=L.useCallback(e=>{g.getEditorState().read(()=>{let e=aE({root:k_(),jsxComponentDescriptors:u,visitors:c,jsxIsAvailable:p});n.update(()=>{r.updateCellContents(a,o,e.children[0].children)},{discrete:!0}),n.dispatchCommand(yO,void 0)}),t(e)},[a,g,c,u,p,r,n,o,t]);return L.useEffect(()=>Xy(g.registerCommand(fm,e=>(e.preventDefault(),_(e.shiftKey?[a-1,o]:[a+1,o]),!0),4),g.registerCommand(Dm,()=>(t([a,o]),!1),1),g.registerCommand(sm,e=>(e?.preventDefault(),_(e?.shiftKey?[a,o-1]:[a,o+1]),!0),4),g.registerCommand(Om,e=>{let t=e.relatedTarget;return Wz(t,m.getRootElement())?!1:(_(null),!0)},0),g.registerCommand(yO,()=>(_(null),!0),0)),[a,g,m,o,_,t]),L.useEffect(()=>{e&&g.focus()},[e,g]),L.createElement(KM,{initialEditor:g},L.createElement(sA,{contentEditable:L.createElement(Yk,null),placeholder:L.createElement(`div`,null),ErrorBoundary:tA}),h.map((e,t)=>L.createElement(e,{key:t})),L.createElement(wb,null))},Zz=({parentEditor:e,highlightedCoordinates:t,align:n,lexicalTable:r,colIndex:i,setActiveCellWithBoundaries:a})=>{let[o,s]=Ld(YO,fk),c=L.useCallback(t=>{e.update(()=>{r.insertColumnAt(t)}),a([t,0])},[e,r,a]),l=L.useCallback(t=>{e.update(()=>{r.deleteColumnAt(t)})},[e,r]),u=L.useCallback((t,n)=>{e.update(()=>{r.setColumnAlign(t,n)})},[e,r]),d=Bk();return L.createElement(SR,null,L.createElement(oR,{className:J.tableColumnEditorTrigger,"data-active":t[0]===i+1,title:d(`table.columnMenu`,`Column menu`)},s(`more_horiz`)),L.createElement(wR,{container:o?.current},L.createElement(fR,{className:(0,vj.default)(J.tableColumnEditorPopoverContent),onOpenAutoFocus:e=>{e.preventDefault()},sideOffset:5,side:`top`},L.createElement(zz,{className:J.tableColumnEditorToolbar},L.createElement(Hz,{className:J.toggleGroupRoot,onValueChange:e=>{u(i,e)},value:n??`left`,type:`single`,"aria-label":d(`table.textAlignment`,`Text alignment`)},L.createElement(Uz,{value:`left`,title:d(`table.alignLeft`,`Align left`)},s(`format_align_left`)),L.createElement(Uz,{value:`center`,title:d(`table.alignCenter`,`Align center`)},s(`format_align_center`)),L.createElement(Uz,{value:`right`,title:d(`table.alignRight`,`Align right`)},s(`format_align_right`))),L.createElement(Bz,null),L.createElement(Vz,{onClick:c.bind(null,i),title:d(`table.insertColumnLeft`,`Insert a column to the left of this one`)},s(`insert_col_left`)),L.createElement(Vz,{onClick:c.bind(null,i+1),title:d(`table.insertColumnRight`,`Insert a column to the right of this one`)},s(`insert_col_right`)),L.createElement(Vz,{onClick:l.bind(null,i),title:d(`table.deleteColumn`,`Delete this column`)},s(`delete_small`))),L.createElement(ER,{className:J.popoverArrow}))))},Qz=({parentEditor:e,highlightedCoordinates:t,lexicalTable:n,rowIndex:r,setActiveCellWithBoundaries:i})=>{let[a,o]=Ld(YO,fk),s=L.useCallback(t=>{e.update(()=>{n.insertRowAt(t)}),i([0,t])},[e,n,i]),c=L.useCallback(t=>{e.update(()=>{n.deleteRowAt(t)})},[e,n]),l=Bk();return L.createElement(SR,null,L.createElement(oR,{className:J.tableColumnEditorTrigger,"data-active":t[1]===r,title:l(`table.rowMenu`,`Row menu`)},o(`more_horiz`)),L.createElement(wR,{container:a?.current},L.createElement(fR,{className:(0,vj.default)(J.tableColumnEditorPopoverContent),onOpenAutoFocus:e=>{e.preventDefault()},sideOffset:5,side:`bottom`},L.createElement(zz,{className:J.tableColumnEditorToolbar},L.createElement(Vz,{onClick:s.bind(null,r),title:l(`table.insertRowAbove`,`Insert a row above this one`)},o(`insert_row_above`)),L.createElement(Vz,{onClick:s.bind(null,r+1),title:l(`table.insertRowBelow`,`Insert a row below this one`)},o(`insert_row_below`)),L.createElement(Vz,{onClick:c.bind(null,r),title:l(`table.deleteRow`,`Delete this row`)},o(`delete_small`))),L.createElement(ER,{className:J.popoverArrow}))))},$z=Object.defineProperty,eB=(e,t,n)=>t in e?$z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tB=(e,t,n)=>(eB(e,typeof t==`symbol`?t:t+``,n),n),nB={type:`tableCell`,children:[]};function rB(){let e=Wd;return{publish:t=>{e(t)},subscribe:t=>{e=t}}}var iB=class e extends Ig{constructor(e,t){super(t),tB(this,`__mdastNode`),tB(this,`focusEmitter`,rB()),this.__mdastNode=e??{type:`table`,children:[]}}static getType(){return`table`}static clone(t){return new e(structuredClone(t.__mdastNode),t.__key)}static importJSON(e){return oB(e.mdastNode)}static importDOM(){return{table:()=>({conversion:sB,priority:3})}}exportJSON(){return{mdastNode:structuredClone(this.__mdastNode),type:`table`,version:1}}getMdastNode(){return this.__mdastNode}getRowCount(){return this.__mdastNode.children.length}getColCount(){return this.__mdastNode.children[0]?.children.length||0}createDOM(){return document.createElement(`div`)}updateDOM(){return!1}updateCellContents(e,t,n){let r=this.getWritable().__mdastNode,i=r.children[t],a=i.children,o=a[e],s=Array.from(a),c={...o,children:n},l={...i,children:s};s[e]=c,r.children[t]=l}insertColumnAt(e){let t=this.getWritable().__mdastNode;for(let n=0;n<t.children.length;n++){let r=t.children[n],i=r.children,a=Array.from(i),o={...r,children:a};a.splice(e,0,structuredClone(nB)),t.children[n]=o}t.align&&t.align.length>0&&t.align.splice(e,0,`left`)}deleteColumnAt(e){let t=this.getWritable().__mdastNode;for(let n=0;n<t.children.length;n++){let r=t.children[n],i=r.children,a=Array.from(i),o={...r,children:a};a.splice(e,1),t.children[n]=o}}insertRowAt(e){let t=this.getWritable().__mdastNode,n={type:`tableRow`,children:Array.from({length:this.getColCount()},()=>structuredClone(nB))};t.children.splice(e,0,n)}deleteRowAt(e){this.getRowCount()===1?(this.selectNext(),this.remove()):this.getWritable().__mdastNode.children.splice(e,1)}addRowToBottom(){this.insertRowAt(this.getRowCount())}addColumnToRight(){this.insertColumnAt(this.getColCount())}setColumnAlign(e,t){let n=this.getWritable().__mdastNode;n.align??=[],n.align[e]=t}decorate(e){return L.createElement(Jz,{lexicalTable:this,mdastNode:this.__mdastNode,parentEditor:e})}select(e){this.focusEmitter.publish(e??[0,0])}isInline(){return!1}};function aB(e){return e instanceof iB}function oB(e){return new iB(e)}function sB(e){let t=e.querySelectorAll(`tr`);return{node:new iB({type:`table`,children:Array.from(t).map(e=>({type:`tableRow`,children:Array.from(e.querySelectorAll(`td, th`)).map(e=>({type:`tableCell`,children:[{type:`text`,value:e.textContent}]}))}))})}}var cB={testLexicalNode:aB,visitLexicalNode({actions:e,mdastParent:t,lexicalNode:n}){e.appendToParent(t,n.getMdastNode())}},lB={testNode:`table`,visitNode({mdastNode:e,lexicalParent:t}){t.append(oB(e))}};function uB(e=1,t=1){let n={type:`table`,children:[]};for(let r=0;r<e;r++){let e={type:`tableRow`,children:[]};for(let n=0;n<t;n++)e.children.push({type:`tableCell`,children:[]});n.children.push(e)}return n}var dB=Md(e=>{e.link(e.pipe(dB,zd(({rows:e,columns:t})=>()=>oB(uB(e,t)))),Mk)}),fB=Gd({init(e,t){e.pubIn({[tk]:CM(),[ek]:FM(),[$O]:lB,[QO]:iB,[nk]:cB,[rk]:jM({tableCellPadding:t?.tableCellPadding??!0,tablePipeAlign:t?.tablePipeAlign??!0})})}}),pB={testNode:`link`,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(mA(e.url,{title:e.title}))}},mB={testLexicalNode:hA,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`link`,{url:e.getURL(),title:e.getTitle()})}};function hB({validateUrl:e,attributes:t}){let[n]=Yd();return(0,L.useEffect)((()=>{if(!n.hasNodes([fA]))throw Error(`LinkPlugin: LinkNode not registered on editor`);return Xy(n.registerCommand(yA,(n=>{if(n===null)return xA(n),!0;if(typeof n==`string`)return!(e!==void 0&&!e(n))&&(xA(n,t),!0);{let{url:e,target:r,rel:i,title:a}=n;return xA(e,{...t,rel:i,target:r,title:a}),!0}}),1),e===void 0?()=>{}:n.registerCommand(Jp,(r=>{let i=W();if(!U(i)||i.isCollapsed()||!sb(r,ClipboardEvent)||r.clipboardData===null)return!1;let a=r.clipboardData.getData(`text`);return!!e(a)&&!i.getNodes().some((e=>G(e)))&&(n.dispatchCommand(yA,{...t,url:a}),r.preventDefault(),!0)}),1))}),[n,e,t]),null}function gB(e,t=(e=>e)){return n=>{let r=e.exec(n);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}function _B(e,t){for(let n=0;n<t.length;n++){let r=t[n](e);if(r)return r}return null}var vB=/[.,;\s]/;function yB(e){return vB.test(e)}function bB(e){return yB(e[e.length-1])}function xB(e){return yB(e[0])}function SB(e){let t=e.getPreviousSibling();return G(t)&&(t=t.getLastDescendant()),t===null||lh(t)||H(t)&&bB(t.getTextContent())}function CB(e){let t=e.getNextSibling();return G(t)&&(t=t.getFirstDescendant()),t===null||lh(t)||H(t)&&xB(t.getTextContent())}function wB(e,t,n,r){return(e>0?yB(n[e-1]):SB(r[0]))?t<n.length?yB(n[t]):CB(r[r.length-1]):!1}function TB(e,t,n){let r=[],i=[],a=[],o=0,s=0,c=[...e];for(;c.length>0;){let e=c[0],l=e.getTextContent().length,u=s;s+l<=t?(r.push(e),o+=l):u>=n?a.push(e):i.push(e),s+=l,c.shift()}return[o,r,i,a]}function EB(e,t,n,r){let i=_A(r.url,r.attributes);if(e.length===1){let a,o=e[0];t===0?[a,o]=o.splitText(n):[,a,o]=o.splitText(t,n);let s=Eh(r.text);return s.setFormat(a.getFormat()),s.setDetail(a.getDetail()),s.setStyle(a.getStyle()),i.append(s),a.replace(i),o}if(e.length>1){let r=e[0],a,o=r.getTextContent().length;t===0?a=r:[,a]=r.splitText(t);let s=[],c;for(let t=1;t<e.length;t++){let r=e[t],i=r.getTextContent().length,a=o;if(a<n)if(o+i<=n)s.push(r);else{let[e,t]=r.splitText(n-a);s.push(e),c=t}o+=i}let l=W(),u=l?l.getNodes().find(H):void 0,d=Eh(a.getTextContent());return d.setFormat(a.getFormat()),d.setDetail(a.getDetail()),d.setStyle(a.getStyle()),i.append(d,...s),u&&u===a&&(U(l)?d.select(l.anchor.offset,l.focus.offset):Lh(l)&&d.select(0,d.getTextContent().length)),a.replace(i),c}}function DB(e,t,n){let r=e.getChildren(),i=r.length;for(let t=0;t<i;t++){let i=r[t];if(!H(i)||!i.isSimpleText())return OB(e),void n(null,e.getURL())}let a=e.getTextContent(),o=_B(a,t);if(o===null||o.text!==a||!SB(e)||!CB(e))return OB(e),void n(null,e.getURL());let s=e.getURL();if(s!==o.url&&(e.setURL(o.url),n(o.url,s)),o.attributes){let t=e.getRel();t!==o.attributes.rel&&(e.setRel(o.attributes.rel||null),n(o.attributes.rel||null,t));let r=e.getTarget();r!==o.attributes.target&&(e.setTarget(o.attributes.target||null),n(o.attributes.target||null,r))}}function OB(e){let t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map((e=>e.getLatest()))}function kB(e,t,n){(0,L.useEffect)((()=>{e.hasNodes([gA])||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77);let r=(e,t)=>{n&&n(e,t)};return Xy(e.registerNodeTransform(_h,(e=>{let n=e.getParentOrThrow(),i=e.getPreviousSibling();vA(n)&&!n.getIsUnlinked()?DB(n,t,r):hA(n)||(e.isSimpleText()&&(xB(e.getTextContent())||!vA(i))&&(function(e,t,n){let r=[...e],i=r.map((e=>e.getTextContent())).join(``),a,o=i,s=0;for(;(a=_B(o,t))&&a!==null;){let e=a.index,t=e+a.length;if(wB(s+e,s+t,i,r)){let[i,,o,c]=TB(r,s+e,s+t),l=EB(o,s+e-i,s+t-i,a);r=l?[l,...c]:c,n(a.url,null),s=0}else s+=t;o=o.substring(t)}})(function(e){let t=[e],n=e.getNextSibling();for(;n!==null&&H(n)&&n.isSimpleText()&&(t.push(n),!/[\s]/.test(n.getTextContent()));)n=n.getNextSibling();return t}(e),t,r),(function(e,t,n){let r=e.getPreviousSibling(),i=e.getNextSibling(),a=e.getTextContent();var o;!vA(r)||r.getIsUnlinked()||xB(a)&&(o=a,!(r.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(o):/^\.[a-zA-Z0-9]{1,}/.test(o)))||(r.append(e),DB(r,t,n),n(null,r.getURL())),!vA(i)||i.getIsUnlinked()||bB(a)||(OB(i),DB(i,t,n),n(null,i.getURL()))})(e,t,r))})),e.registerCommand(yA,(e=>{let t=W();return e!==null||!U(t)||t.extract().forEach((e=>{let t=e.getParent();vA(t)&&(t.setIsUnlinked(!t.getIsUnlinked()),t.markDirty())})),!1}),1))}),[e,t,n])}function AB({matchers:e,onChange:t}){let[n]=Yd();return kB(n,e,t),null}var jB=[gB(/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,e=>e.startsWith(`http`)?e:`https://${e}`),gB(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,e=>`mailto:${e}`)],MB=()=>L.createElement(AB,{matchers:jB}),NB=B(!1),PB=Gd({init(e,t){let n=!!t?.disableAutoLink,r=t?.validateUrl?{validateUrl:t.validateUrl}:{},i=()=>L.createElement(L.Fragment,null,L.createElement(hB,{...r}),n?null:L.createElement(MB,null));e.pubIn({[Ik]:`link`,[$O]:pB,[QO]:[fA,gA],[nk]:mB,[NB]:n,[Tk]:i,[Dk]:i,[yk]:i})}}),FB=e=>e.type===`checkbox`,IB=e=>e instanceof Date,LB=e=>e==null,RB=e=>typeof e==`object`,zB=e=>!LB(e)&&!Array.isArray(e)&&RB(e)&&!IB(e),BB=e=>zB(e)&&e.target?FB(e.target)?e.target.checked:e.target.value:e,VB=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),HB=e=>{let t=e.constructor&&e.constructor.prototype;return zB(t)&&t.hasOwnProperty(`isPrototypeOf`)},UB=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function WB(e){if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(UB&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&!(zB(e)&&HB(e)))return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=WB(e[t]));return r}var GB=e=>/^\w*$/.test(e),KB=e=>e===void 0,qB=e=>Array.isArray(e)?e.filter(Boolean):[],JB=e=>qB(e.replace(/["|']|\]/g,``).split(/\.|\[/)),Y=(e,t,n)=>{if(!t||!zB(e))return n;let r=(GB(t)?[t]:JB(t)).reduce((e,t)=>LB(e)?void 0:e[t],e);return KB(r)||r===e?KB(e[t])?n:e[t]:r},YB=e=>typeof e==`boolean`,XB=e=>typeof e==`function`,ZB=(e,t,n)=>{let r=-1,i=GB(t)?[t]:JB(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=zB(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(t===`__proto__`||t===`constructor`||t===`prototype`)return;e[t]=a,e=e[t]}},QB={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},$B={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},eV={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},tV=`form`,nV=`root`,rV=L.createContext(null);rV.displayName=`HookFormControlContext`;var iV=()=>L.useContext(rV),aV=(e,t,n,r=!0)=>{let i={defaultValues:t._defaultValues};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==$B.all&&(t._proxyFormState[i]=!r||$B.all),n&&(n[i]=!0),e[i]}});return i},oV=typeof window<`u`?L.useLayoutEffect:L.useEffect;function zte(e){let t=iV(),{control:n=t,disabled:r,name:i,exact:a}=e||{},[o,s]=L.useState(n._formState),c=L.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return oV(()=>n._subscribe({name:i,formState:c.current,exact:a,callback:e=>{!r&&s({...n._formState,...e})}}),[i,r,a]),L.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),L.useMemo(()=>aV(o,n,c.current,!1),[o,n])}var sV=e=>typeof e==`string`,cV=(e,t,n,r,i)=>sV(e)?(r&&t.watch.add(e),Y(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),Y(n,e))):(r&&(t.watchAll=!0),n),lV=e=>LB(e)||!RB(e);function uV(e,t,n=new WeakSet){if(e===t)return!0;if(lV(e)||lV(t))return Object.is(e,t);if(IB(e)&&IB(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(IB(r)&&IB(e)||(zB(r)||Array.isArray(r))&&(zB(e)||Array.isArray(e))?!uV(r,e,n):!Object.is(r,e))return!1}}return!0}function Bte(e){let t=iV(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=L.useRef(i),l=L.useRef(s),u=L.useRef(void 0),d=L.useRef(n),f=L.useRef(r);l.current=s;let[p,m]=L.useState(()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e}),h=L.useCallback(e=>{let t=cV(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),g=L.useCallback(e=>{if(!a){let t=cV(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);uV(e,u.current)||(m(e),u.current=e)}else m(t)}},[n._formValues,n._names,a,r]);oV(()=>((d.current!==n||!uV(f.current,r))&&(d.current=n,f.current=r,g()),n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{g(e.values)}})),[n,o,r,g]),L.useEffect(()=>n._removeUnmounted());let _=d.current!==n,v=f.current,y=L.useMemo(()=>{if(a)return null;let e=!_&&!uV(v,r);return _||e?h():null},[a,_,r,v,h]);return y===null?p:y}function Vte(e){let t=iV(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=VB(i._names.array,n),l=Bte({control:i,name:n,defaultValue:L.useMemo(()=>Y(i._formValues,n,Y(i._defaultValues,n,o)),[i,n,o]),exact:s}),u=zte({control:i,name:n,exact:s}),d=L.useRef(e),f=L.useRef(i.register(n,{...e.rules,value:l,...YB(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;let p=L.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Y(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Y(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Y(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Y(u.validatingFields,n)},error:{enumerable:!0,get:()=>Y(u.errors,n)}}),[u,n]),m=L.useCallback(e=>f.current.onChange({target:{value:BB(e),name:n},type:QB.CHANGE}),[n]),h=L.useCallback(()=>f.current.onBlur({target:{value:Y(i._formValues,n),name:n},type:QB.BLUR}),[n,i._formValues]),g=L.useCallback(e=>{let t=Y(i._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>XB(e.focus)&&e.focus(),select:()=>XB(e.select)&&e.select(),setCustomValidity:t=>XB(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>XB(e.reportValidity)&&e.reportValidity()})},[i._fields,n]),_=L.useMemo(()=>({name:n,value:l,...YB(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:m,onBlur:h,ref:g}),[n,r,u.disabled,m,h,g,l]);return L.useEffect(()=>{let e=i._options.shouldUnregister||a;i.register(n,{...d.current.rules,...YB(d.current.disabled)?{disabled:d.current.disabled}:{}});let t=(e,t)=>{let n=Y(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=WB(Y(i._options.defaultValues,n,d.current.defaultValue));ZB(i._defaultValues,n,e),KB(Y(i._formValues,n))&&ZB(i._formValues,n,e)}return!c&&i.register(n),()=>{(c?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,c,a]),L.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),L.useMemo(()=>({field:_,formState:u,fieldState:p}),[_,u,p])}var Hte=e=>e.render(Vte(e)),Ute=L.createContext(null);Ute.displayName=`HookFormContext`;var Wte=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},dV=e=>Array.isArray(e)?e:[e],fV=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function pV(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&zB(i)&&a){let e=pV(i,a);zB(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var mV=e=>zB(e)&&!Object.keys(e).length,hV=e=>e.type===`file`,gV=e=>{if(!UB)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},_V=e=>e.type===`select-multiple`,vV=e=>e.type===`radio`,Gte=e=>vV(e)||FB(e),yV=e=>gV(e)&&e.isConnected;function Kte(e,t){let n=t.slice(0,-1).length,r=0;for(;r<n;){if(LB(e)){e=void 0;break}e=e[t[r]],r++}return e}function qte(e){for(let t in e)if(e.hasOwnProperty(t)&&!KB(e[t]))return!1;return!0}function bV(e,t){if(sV(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:GB(t)?[t]:JB(t),r=n.length===1?e:Kte(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(zB(r)&&mV(r)||Array.isArray(r)&&qte(r))&&bV(e,n.slice(0,-1)),e}var Jte=e=>{for(let t in e)if(XB(e[t]))return!0;return!1};function xV(e){return Array.isArray(e)||zB(e)&&!Jte(e)}function SV(e,t={}){for(let n in e){let r=e[n];xV(r)?(t[n]=Array.isArray(r)?[]:{},SV(r,t[n])):KB(r)||(t[n]=!0)}return t}function CV(e,t,n){n||=SV(t);for(let r in e){let i=e[r];if(xV(i))KB(t)||lV(n[r])?n[r]=SV(i,Array.isArray(i)?[]:{}):CV(i,LB(t)?{}:t[r],n[r]);else{let e=t[r];n[r]=!uV(i,e)}}return n}var wV={value:!1,isValid:!1},TV={value:!0,isValid:!0},EV=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!KB(e[0].attributes.value)?KB(e[0].value)||e[0].value===``?TV:{value:e[0].value,isValid:!0}:TV:wV}return wV},DV=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>KB(e)?e:t?e===``?NaN:e&&+e:n&&sV(e)?new Date(e):r?r(e):e,OV={isValid:!1,value:null},kV=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,OV):OV;function AV(e){let t=e.ref;return hV(t)?t.files:vV(t)?kV(e.refs).value:_V(t)?[...t.selectedOptions].map(({value:e})=>e):FB(t)?EV(e.refs).value:DV(KB(t.value)?e.ref.value:t.value,e)}var jV=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,MV=(e,t,n,r)=>{let i={};for(let n of e){let e=Y(t,n);e&&ZB(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},NV=e=>e instanceof RegExp,PV=e=>KB(e)?e:NV(e)?e.source:zB(e)?NV(e.value)?e.value.source:e.value:e,FV=e=>({isOnSubmit:!e||e===$B.onSubmit,isOnBlur:e===$B.onBlur,isOnChange:e===$B.onChange,isOnAll:e===$B.all,isOnTouch:e===$B.onTouched}),IV=`AsyncFunction`,LV=e=>!!e&&!!e.validate&&!!(XB(e.validate)&&e.validate.constructor.name===IV||zB(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===IV)),RV=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),zV=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))),BV=(e,t,n,r)=>{for(let i of n||Object.keys(e)){let n=Y(e,i);if(n){let{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(BV(a,t))break}else if(zB(a)&&BV(a,t))break}}};function VV(e,t,n){let r=Y(e,n);if(r||GB(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=Y(t,r),o=Y(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var HV=(e,t,n,r)=>{n(e);let{name:i,...a}=e;return mV(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||$B.all))},UV=(e,t,n)=>!e||!t||e===t||dV(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e))),WV=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,GV=(e,t)=>!qB(Y(e,t)).length&&bV(e,t),KV=(e,t,n)=>{let r=dV(Y(e,n));return ZB(r,nV,t[n]),ZB(e,n,r),e};function qV(e,t,n=`validate`){if(sV(e)||Array.isArray(e)&&e.every(sV)||YB(e)&&!e)return{type:n,message:sV(e)?e:``,ref:t}}var JV=e=>zB(e)&&!NV(e)?e:{value:e,message:``},YV=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_}=e._f,v=Y(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{i&&y.reportValidity&&(y.setCustomValidity(YB(e)?``:e||``),y.reportValidity())},x={},S=vV(o),C=FB(o),w=S||C,T=(g||hV(o))&&KB(o.value)&&KB(v)||gV(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length||g&&typeof v==`number`&&isNaN(v),E=Wte.bind(null,h,r,x),D=(e,t,n,r=eV.maxLength,i=eV.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...E(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||LB(v))||YB(v)&&!v||C&&!EV(s).isValid||S&&!kV(s).isValid)){let{value:e,message:t}=sV(c)?{value:!!c,message:c}:JV(c);if(e&&(x[h]={type:eV.required,message:t,ref:y,...E(eV.required,t)},!r))return b(t),x}if(!T&&(!LB(d)||!LB(f))){let e,t,n=JV(f),i=JV(d);if(!LB(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;LB(n.value)||(e=r>n.value),LB(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;sV(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),sV(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(D(!!e,n.message,i.message,eV.max,eV.min),!r))return b(x[h].message),x}if((l||u)&&!T&&(sV(v)||a&&Array.isArray(v))){let e=JV(l),t=JV(u),n=!LB(e.value)&&v.length>+e.value,i=!LB(t.value)&&v.length<+t.value;if((n||i)&&(D(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&sV(v)){let{value:e,message:t}=JV(p);if(NV(e)&&!v.match(e)&&(x[h]={type:eV.pattern,message:t,ref:o,...E(eV.pattern,t)},!r))return b(t),x}if(m){if(XB(m)){let e=qV(await m(v,n),y);if(e&&(x[h]={...e,...E(eV.validate,e.message)},!r))return b(e.message),x}else if(zB(m)){let e={};for(let t in m){if(!mV(e)&&!r)break;let i=qV(await m[t](v,n),y,t);i&&(e={...i,...E(t,i.message)},b(i.message),r&&(x[h]=e))}if(!mV(e)&&(x[h]={ref:y,...e},!r))return x}}return b(!0),x},XV={mode:$B.onSubmit,reValidateMode:$B.onChange,shouldFocusError:!0};function ZV(e={}){let t={...XV,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:XB(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=(zB(t.defaultValues)||zB(t.values))&&WB(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:WB(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,l=0,u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u},f={...d},p={array:fV(),state:fV()},m=t.criteriaMode===$B.all,h=e=>t=>{clearTimeout(l),l=setTimeout(e,t)},g=async e=>{if(!o.keepIsValid&&!t.disabled&&(d.isValid||f.isValid||e)){let e;t.resolver?(e=mV((await T()).errors),_()):e=await O({fields:r,onlyCheckValid:!0,eventType:QB.VALID}),e!==n.isValid&&p.state.next({isValid:e})}},_=(e,r)=>{!t.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((e||Array.from(s.mount)).forEach(e=>{e&&(r?ZB(n.validatingFields,e,r):bV(n.validatingFields,e))}),p.state.next({validatingFields:n.validatingFields,isValidating:!mV(n.validatingFields)}))},v=e=>{let t=CV(i,a),r=jV(e);ZB(n.dirtyFields,r,Y(t,r))},y=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){if(o.action=!0,u&&Array.isArray(Y(r,e))){let t=s(Y(r,e),c.argA,c.argB);l&&ZB(r,e,t)}if(u&&Array.isArray(Y(n.errors,e))){let t=s(Y(n.errors,e),c.argA,c.argB);l&&ZB(n.errors,e,t),GV(n.errors,e)}if((d.touchedFields||f.touchedFields)&&u&&Array.isArray(Y(n.touchedFields,e))){let t=s(Y(n.touchedFields,e),c.argA,c.argB);l&&ZB(n.touchedFields,e,t)}(d.dirtyFields||f.dirtyFields)&&v(e),p.state.next({name:e,isDirty:A(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ZB(a,e,i)},b=(e,t)=>{ZB(n.errors,e,t),p.state.next({errors:n.errors})},x=e=>{n.errors=e,p.state.next({errors:n.errors,isValid:!1})},S=(e,t,n,s)=>{let c=Y(r,e);if(c){let r=Y(a,e,KB(n)?Y(i,e):n);KB(r)||s&&s.defaultChecked||t?ZB(a,e,t?r:AV(c._f)):N(e,r),o.mount&&!o.action&&g()}},C=(e,r,a,o,s)=>{let c=!1,l=!1,u={name:e};if(!t.disabled){if(!a||o){(d.isDirty||f.isDirty)&&(l=n.isDirty,n.isDirty=u.isDirty=A(),c=l!==u.isDirty);let t=uV(Y(i,e),r);l=!!Y(n.dirtyFields,e),t?bV(n.dirtyFields,e):ZB(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c||=(d.dirtyFields||f.dirtyFields)&&l!==!t}if(a){let t=Y(n.touchedFields,e);t||(ZB(n.touchedFields,e,a),u.touchedFields=n.touchedFields,c||=(d.touchedFields||f.touchedFields)&&t!==a)}c&&s&&p.state.next(u)}return c?u:{}},w=(e,r,i,a)=>{let o=Y(n.errors,e),s=(d.isValid||f.isValid)&&YB(r)&&n.isValid!==r;if(t.delayError&&i?(c=h(()=>b(e,i)),c(t.delayError)):(clearTimeout(l),c=null,i?ZB(n.errors,e,i):bV(n.errors,e)),(i?!uV(o,i):o)||!mV(a)||s){let t={...a,...s&&YB(r)?{isValid:r}:{},errors:n.errors,name:e};n={...n,...t},p.state.next(t)}},T=async e=>(_(e,!0),await t.resolver(a,t.context,MV(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),E=async e=>{let{errors:t}=await T(e);if(_(e),e)for(let r of e){let e=Y(t,r);e?ZB(n.errors,r,e):bV(n.errors,r)}else n.errors=t;return t},D=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(zB(i))for(let e in i)i[e]&&oe(`${tV}.${e}`,{message:sV(i.message)?i.message:``,type:eV.validate});else sV(i)||!i?oe(tV,{message:i||``,type:eV.validate}):ae(tV);return i}return!0},O=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(l.runRootValidation=!0,!await D({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let u=r[o];if(u){let{_f:r,...f}=u;if(r){let o=s.array.has(r.name),c=u._f&&LV(u._f);c&&d.validatingFields&&_([r.name],!0);let f=await YV(u,s.disabled,a,m,t.shouldUseNativeValidation&&!i,o);if(c&&d.validatingFields&&_([r.name]),f[r.name]&&(l.valid=!1,i)||(!i&&(Y(f,r.name)?o?KV(n.errors,f,r.name):ZB(n.errors,r.name,f[r.name]):bV(n.errors,r.name)),e.shouldUseNativeValidation&&f[r.name]))break}!mV(f)&&await O({context:l,onlyCheckValid:i,fields:f,name:o,eventType:c})}}return l.valid},k=()=>{for(let e of s.unMount){let t=Y(r,e);t&&(t._f.refs?t._f.refs.every(e=>!yV(e)):!yV(t._f.ref))&&ue(e)}s.unMount=new Set},A=(e,n)=>!t.disabled&&(e&&n&&ZB(a,e,n),!uV(I(),i)),j=(e,t,n)=>cV(e,s,{...o.mount?a:KB(t)?i:sV(e)?{[e]:t}:t},n,t),M=e=>qB(Y(o.mount?a:i,e,t.shouldUnregister?Y(i,e,[]):[])),N=(e,t,n={})=>{let i=Y(r,e),o=t;if(i){let n=i._f;n&&(!n.disabled&&ZB(a,e,DV(t,n)),o=gV(n.ref)&&LB(t)?``:t,_V(n.ref)?[...n.ref.options].forEach(e=>e.selected=o.includes(e.value)):n.refs?FB(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(o)?e.checked=!!o.find(t=>t===e.value):e.checked=o===e.value||!!o)}):n.refs.forEach(e=>e.checked=e.value===o):hV(n.ref)?n.ref.value=``:(n.ref.value=o,n.ref.type||p.state.next({name:e,values:WB(a)})))}(n.shouldDirty||n.shouldTouch)&&C(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&re(e)},P=(e,t,n)=>{for(let i in t){if(!t.hasOwnProperty(i))return;let a=t[i],o=e+`.`+i,c=Y(r,o);(s.array.has(e)||zB(a)||c&&!c._f)&&!IB(a)?P(o,a,n):N(o,a,n)}},F=(e,t,i={})=>{let c=Y(r,e),l=s.array.has(e),u=WB(t),d=uV(Y(a,e),u);if(ZB(a,e,u),l)p.array.next({name:e,values:WB(a)}),i.shouldDirty&&(v(e),p.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:A(e,u)}));else{let t=Array.isArray(u)&&!u.length||mV(u);!c||c._f||LB(u)||t?N(e,u,i):P(e,u,i)}d||(zV(e,s)?p.state.next({...n,name:e,values:WB(a)}):p.state.next({name:o.mount?e:void 0,values:WB(a)}))},ee=e=>{let t=XB(e)?e(a):e;uV(a,t)||(a={...a,...t},p.state.next({...n,values:a}))},te=async i=>{o.mount=!0;let l=i.target,u=l.name,h=!0,v=Y(r,u),y=e=>{h=Number.isNaN(e)||IB(e)&&isNaN(e.getTime())||uV(e,Y(a,u,e))},b=FV(t.mode),x=FV(t.reValidateMode);if(v){let o,S,E=l.type?AV(v._f):BB(i),k=i.type===QB.BLUR||i.type===QB.FOCUS_OUT,A=!RV(v._f)&&!e.validate&&!t.resolver&&!Y(n.errors,u)&&!v._f.deps||WV(k,Y(n.touchedFields,u),n.isSubmitted,x,b),j=zV(u,s,k);ZB(a,u,E),k?(!l||!l.readOnly)&&(v._f.onBlur&&v._f.onBlur(i),c&&c(0)):v._f.onChange&&v._f.onChange(i);let M=C(u,E,k),N=!mV(M)||j;if(!k&&p.state.next({name:u,type:i.type,values:WB(a)}),A)return(d.isValid||f.isValid)&&(t.mode===`onBlur`?k&&g():k||g()),N&&p.state.next({name:u,...j?{}:M});if(!t.resolver&&e.validate&&await D({name:u,eventType:i.type}),!k&&j&&p.state.next({...n}),t.resolver){let{errors:e}=await T([u]);if(_([u]),y(E),h){let t=VV(n.errors,r,u),i=VV(e,r,t.name||u);o=i.error,u=i.name,S=mV(e)}}else _([u],!0),o=(await YV(v,s.disabled,a,m,t.shouldUseNativeValidation))[u],_([u]),y(E),h&&(o?S=!1:(d.isValid||f.isValid)&&(S=await O({fields:r,onlyCheckValid:!0,name:u,eventType:i.type})));h&&(v._f.deps&&(!Array.isArray(v._f.deps)||v._f.deps.length>0)&&re(v._f.deps),w(u,S,o,M))}},ne=(e,t)=>{if(Y(n.errors,t)&&e.focus)return e.focus(),1},re=async(e,i={})=>{let a,o,c=dV(e);if(t.resolver){let t=await E(KB(e)?e:c);a=mV(t),o=e?!c.some(e=>Y(t,e)):a}else e?(o=(await Promise.all(c.map(async e=>{let t=Y(r,e);return await O({fields:t&&t._f?{[e]:t}:t,eventType:QB.TRIGGER})}))).every(Boolean),!(!o&&!n.isValid)&&g()):o=a=await O({fields:r,name:e,eventType:QB.TRIGGER});return p.state.next({...!sV(e)||(d.isValid||f.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:n.errors}),i.shouldFocus&&!o&&BV(r,ne,e?c:s.mount),o},I=(e,t)=>{let r={...o.mount?a:i};return t&&(r=pV(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),KB(e)?r:sV(e)?Y(r,e):e.map(e=>Y(r,e))},ie=(e,t)=>({invalid:!!Y((t||n).errors,e),isDirty:!!Y((t||n).dirtyFields,e),error:Y((t||n).errors,e),isValidating:!!Y(n.validatingFields,e),isTouched:!!Y((t||n).touchedFields,e)}),ae=e=>{let t=e?dV(e):void 0;t?.forEach(e=>bV(n.errors,e)),t?t.forEach(e=>{p.state.next({name:e,errors:n.errors})}):p.state.next({errors:{}})},oe=(e,t,i)=>{let a=(Y(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=Y(n.errors,e)||{};ZB(n.errors,e,{...l,...t,ref:a}),p.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},se=(e,t)=>XB(e)?p.state.subscribe({next:n=>`values`in n&&e(n.values||j(void 0,t),n)}):j(e,t,!0),ce=e=>p.state.subscribe({next:t=>{if(UV(e.name,t.name,e.exact)&&HV(t,e.formState||d,be,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}}).unsubscribe,le=e=>(o.mount=!0,f={...f,...e.formState},ce({...e,formState:{...u,...e.formState}})),ue=(e,o={})=>{for(let c of e?dV(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(bV(r,c),bV(a,c)),!o.keepError&&bV(n.errors,c),!o.keepDirty&&bV(n.dirtyFields,c),!o.keepTouched&&bV(n.touchedFields,c),!o.keepIsValidating&&bV(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&bV(i,c);p.state.next({values:WB(a)}),p.state.next({...n,...o.keepDirty?{isDirty:A()}:{}}),!o.keepIsValid&&g()},de=({disabled:e,name:t})=>{if(YB(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&g()}},fe=(e,n={})=>{let a=Y(r,e),c=YB(n.disabled)||YB(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;return ZB(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&!l?de({disabled:YB(n.disabled)?n.disabled:t.disabled,name:e}):S(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:PV(n.min),max:PV(n.max),minLength:PV(n.minLength),maxLength:PV(n.maxLength),pattern:PV(n.pattern)}:{},name:e,onChange:te,onBlur:te,ref:c=>{if(c){s.registerName.add(e),fe(e,n),s.registerName.delete(e),a=Y(r,e);let t=KB(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=Gte(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;ZB(r,e,{_f:{...a._f,...o?{refs:[...l.filter(yV),t,...Array.isArray(Y(i,e))?[{}]:[]],ref:{type:t.type,name:e}}:{ref:t}}}),S(e,!1,void 0,t)}else a=Y(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(VB(s.array,e)&&o.action)&&s.unMount.add(e)}}},pe=()=>t.shouldFocusError&&BV(r,ne,s.mount),me=e=>{YB(e)&&(p.state.next({disabled:e}),BV(r,(t,n)=>{let i=Y(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},he=(e,i)=>async o=>{let c;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let l=WB(a);if(p.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await T();_(),n.errors=e,l=WB(t)}else await O({fields:r,eventType:QB.SUBMIT});if(s.disabled.size)for(let e of s.disabled)bV(l,e);if(bV(n.errors,nV),mV(n.errors)){p.state.next({errors:{}});try{await e(l,o)}catch(e){c=e}}else i&&await i({...n.errors},o),pe(),setTimeout(pe);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:mV(n.errors)&&!c,submitCount:n.submitCount+1,errors:n.errors}),c)throw c},ge=(e,t={})=>{Y(r,e)&&(KB(t.defaultValue)?F(e,WB(Y(i,e))):(F(e,t.defaultValue),ZB(i,e,WB(t.defaultValue))),t.keepTouched||bV(n.touchedFields,e),t.keepDirty||(bV(n.dirtyFields,e),n.isDirty=t.defaultValue?A(e,WB(Y(i,e))):A()),t.keepError||(bV(n.errors,e),d.isValid&&g()),p.state.next({...n}))},_e=(e,c={})=>{let l=e?WB(e):i,u=WB(l),f=mV(e),m=f?i:u;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues){let e=new Set([...s.mount,...Object.keys(CV(i,a))]);for(let t of Array.from(e)){let e=Y(n.dirtyFields,t),r=Y(a,t),i=Y(m,t);e&&!KB(r)?ZB(m,t,r):!e&&!KB(i)&&F(t,i)}}else{if(UB&&KB(e))for(let e of s.mount){let t=Y(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(gV(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(c.keepFieldsRef)for(let e of s.mount)F(e,Y(m,e));else r={}}a=t.shouldUnregister?c.keepDefaultValues?WB(i):{}:WB(m),p.array.next({values:{...m}}),p.state.next({values:{...m}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!d.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!mV(m),o.watch=!!t.shouldUnregister,o.keepIsValid=!!c.keepIsValid,o.action=!1,c.keepErrors||(n.errors={}),p.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:f?!1:c.keepDirty?n.isDirty:!!(c.keepDefaultValues&&!uV(e,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:f?{}:c.keepDirtyValues?c.keepDefaultValues&&a?CV(i,a):n.dirtyFields:c.keepDefaultValues&&e?CV(i,e):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},ve=(e,n)=>_e(XB(e)?e(a):e,{...t.resetOptions,...n}),ye=(e,t={})=>{let n=Y(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&XB(e.select)&&e.select()})}},be=e=>{n={...n,...e}},xe={control:{register:fe,unregister:ue,getFieldState:ie,handleSubmit:he,setError:oe,_subscribe:ce,_runSchema:T,_updateIsValidating:_,_focusError:pe,_getWatch:j,_getDirty:A,_setValid:g,_setFieldArray:y,_setDisabledField:de,_setErrors:x,_getFieldArray:M,_reset:_e,_resetDefaultValues:()=>XB(t.defaultValues)&&t.defaultValues().then(e=>{ve(e,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:k,_disableForm:me,_subjects:p,_proxyFormState:d,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e}}},subscribe:le,trigger:re,register:fe,handleSubmit:he,watch:se,setValue:F,setValues:ee,getValues:I,reset:ve,resetField:ge,clearErrors:ae,unregister:ue,setError:oe,setFocus:ye,getFieldState:ie};return{...xe,formControl:xe}}function QV(e={}){let t=L.useRef(void 0),n=L.useRef(void 0),[r,i]=L.useState({isDirty:!1,isValidating:!1,isLoading:XB(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:XB(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!XB(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...i}=ZV(e);t.current={...i,formState:r}}let a=t.current.control;return a._options=e,oV(()=>{let e=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(e=>({...e,isReady:!0})),a._formState.isReady=!0,e},[a]),L.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),L.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),L.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),L.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),L.useEffect(()=>{if(a._proxyFormState.isDirty){let e=a._getDirty();e!==r.isDirty&&a._subjects.state.next({isDirty:e})}},[a,r.isDirty]),L.useEffect(()=>{e.values&&!uV(e.values,n.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),a._options.resetOptions?.keepIsValid||a._setValid(),n.current=e.values,i(e=>({...e}))):a._resetDefaultValues()},[a,e.values]),L.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=L.useMemo(()=>aV(r,a),[a,r]),t.current}var $V=n(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),eH=n(((e,t)=>{var n=$V();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),tH=n(((e,t)=>{t.exports=eH()()})),nH=n((e=>{if(typeof Symbol==`function`&&Symbol.for){var t=Symbol.for;t(`react.element`),t(`react.portal`),t(`react.fragment`),t(`react.strict_mode`),t(`react.profiler`),t(`react.provider`),t(`react.context`),t(`react.forward_ref`),t(`react.suspense`),t(`react.suspense_list`),t(`react.memo`),t(`react.lazy`),t(`react.block`),t(`react.server.block`),t(`react.fundamental`),t(`react.debug_trace_mode`),t(`react.legacy_hidden`)}})),rH=n(((e,t)=>{t.exports=nH()})),iH=e=>typeof e==`object`&&!!e&&e.nodeType===1,aH=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,oH=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return aH(n.overflowY,t)||aH(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},sH=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,cH=e=>e.parentElement??(e.getRootNode().host||null),lH=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!iH(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;iH(u)&&s(u);){if(u=cH(u),u===c){l.push(u);break}u!=null&&u===document.body&&oH(u)&&!oH(document.documentElement)||u!=null&&oH(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,p=window.scrollX??pageXOffset,m=window.scrollY??pageYOffset,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),x=r===`start`||r===`nearest`?_:r===`end`?y:_+h/2,S=i===`center`?b+g/2:i===`end`?v:b,C=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:w,left:T}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&_>=s&&y<=w&&b>=T&&v<=u)return C;let E=getComputedStyle(t),D=parseInt(E.borderLeftWidth,10),O=parseInt(E.borderTopWidth,10),k=parseInt(E.borderRightWidth,10),A=parseInt(E.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-D-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,F=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,ee=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?x:r===`end`?x-f:r===`nearest`?sH(m,m+f,f,O,A,m+x,m+x+h,h):x-f/2,M=i===`start`?S:i===`center`?S-d/2:i===`end`?S-d:sH(p,p+d,d,D,k,p+S,p+S+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?x-s-O:r===`end`?x-w+A+P:r===`nearest`?sH(s,w,a,O,A+P,x,x+h,h):x-(s+a/2)+P/2,M=i===`start`?S-T-D:i===`center`?S-(T+o/2)+N/2:i===`end`?S-u+k+N:sH(T,u,o,D,k+N,S,S+g,g);let{scrollLeft:e,scrollTop:n}=t;j=Math.max(0,Math.min(n+j/ee,t.scrollHeight-a/ee+P)),M=Math.max(0,Math.min(e+M/F,t.scrollWidth-o/F+N)),x+=n-j,S+=e-M}C.push({el:t,top:j,left:M})}return C},X=t(tH());rH();var uH=0;function dH(){}function fH(e,t){e&&lH(e,{boundary:t,block:`nearest`,scrollMode:`if-needed`}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}function pH(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function mH(e,t){var n;function r(){n&&clearTimeout(n)}function i(){var i=[...arguments];r(),n=setTimeout(function(){n=null,e.apply(void 0,i)},t)}return i.cancel=r,i}function hH(){var e=[...arguments];return function(t){var n=[...arguments].slice(1);return e.some(function(e){return e&&e.apply(void 0,[t].concat(n)),t.preventDownshiftDefault||t.hasOwnProperty(`nativeEvent`)&&t.nativeEvent.preventDownshiftDefault})}}function gH(){var e=[...arguments];return function(t){e.forEach(function(e){typeof e==`function`?e(t):e&&(e.current=t)})}}function _H(){return String(uH++)}function vH(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n===r?``:n+` result`+(n===1?` is`:`s are`)+` available, use up and down arrow keys to navigate. Press Enter key to select.`:`No results are available.`:``}function yH(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=bH(t,r)?t[r]:e[r],n},{})}function bH(e,t){return e[t]!==void 0}function xH(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf(`Arrow`)!==0?`Arrow`+t:t}function SH(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var a=n-1;(typeof t!=`number`||t<0||t>=n)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=CH(e,o,n,r,i);return s===-1?t>=n?-1:t:s}function CH(e,t,n,r,i){var a=r(t);if(!a||!a.hasAttribute(`disabled`))return t;if(e>0){for(var o=t+1;o<n;o++)if(!r(o).hasAttribute(`disabled`))return o}else for(var s=t-1;s>=0;s--)if(!r(s).hasAttribute(`disabled`))return s;return i?e>0?CH(1,0,n,r,!1):CH(-1,n-1,n,r,!1):-1}function wH(e,t,n,r){return r===void 0&&(r=!0),t.some(function(t){return t&&(pH(t,e,n)||r&&pH(t,n.document.activeElement,n))})}var TH=mH(function(e){DH(e).textContent=``},500);function EH(e,t){var n=DH(t);e&&(n.textContent=e,TH(t))}function DH(e){e===void 0&&(e=document);var t=e.getElementById(`a11y-status-message`);return t||(t=e.createElement(`div`),t.setAttribute(`id`,`a11y-status-message`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-relevant`,`additions text`),Object.assign(t.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`}),e.body.appendChild(t),t)}var OH=[`isInitialMount`,`highlightedIndex`,`items`,`environment`],kH={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``};function AH(e,t,n){var r=e.props,i=e.type,a={};Object.keys(t).forEach(function(r){jH(r,e,t,n),n[r]!==t[r]&&(a[r]=n[r])}),r.onStateChange&&Object.keys(a).length&&r.onStateChange(z({type:i},a))}function jH(e,t,n,r){var i=t.props,a=t.type,o=`on`+BH(e)+`Change`;i[o]&&r[e]!==void 0&&r[e]!==n[e]&&i[o](z({type:a},r))}function MH(e,t){return t.changes}function NH(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+` has been selected.`:``}var PH=mH(function(e,t){EH(e(),t)},200),FH=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function IH(e){var t=e.id,n=t===void 0?`downshift-`+_H():t,r=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId;return(0,L.useRef)({labelId:r||n+`-label`,menuId:i||n+`-menu`,getItemId:a||function(e){return n+`-item-`+e},toggleButtonId:o||n+`-toggle-button`,inputId:s||n+`-input`}).current}function LH(e,t,n,r){var i,a;if(e===void 0){if(t===void 0)throw Error(r);i=n[t],a=t}else a=t===void 0?n.indexOf(e):t,i=e;return[i,a]}function RH(e){return e?String(e):``}function zH(e){return/^\S{1}$/.test(e)}function BH(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function VH(e){var t=(0,L.useRef)(e);return t.current=e,t}function HH(e,t,n){var r=(0,L.useRef)(),i=(0,L.useRef)(),a=(0,L.useReducer)((0,L.useCallback)(function(t,n){i.current=n,t=yH(t,n.props);var r=e(t,n);return n.props.stateReducer(t,z({},n,{changes:r}))},[e]),t),o=a[0],s=a[1],c=VH(n),l=(0,L.useCallback)(function(e){return s(z({props:c.current},e))},[c]),u=i.current;return(0,L.useEffect)(function(){u&&r.current&&r.current!==o&&AH(u,yH(r.current,u.props),o),r.current=o},[o,n,u]),[o,l]}function UH(e,t,n){var r=HH(e,t,n),i=r[0],a=r[1];return[yH(i,n),a]}var WH={itemToString:RH,stateReducer:MH,getA11ySelectionMessage:NH,scrollIntoView:fH,environment:typeof window>`u`?{}:window};function GH(e,t,n){n===void 0&&(n=kH);var r=e[`default`+BH(t)];return r===void 0?n[t]:r}function KH(e,t,n){n===void 0&&(n=kH);var r=e[t];if(r!==void 0)return r;var i=e[`initial`+BH(t)];return i===void 0?GH(e,t,n):i}function qH(e){var t=KH(e,`selectedItem`),n=KH(e,`isOpen`),r=KH(e,`highlightedIndex`),i=KH(e,`inputValue`);return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function JH(e,t,n){var r=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=t.selectedItem,s=t.highlightedIndex;return r.length===0?-1:i!==void 0&&s===i?i:a===void 0?o?r.indexOf(o):n===0?-1:n<0?r.length-1:0:a}function YH(e,t,n,r){var i=(0,L.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,L.useEffect)(function(){if(n?.addEventListener!=null){var a=function(){i.current.isMouseDown=!0},o=function(a){i.current.isMouseDown=!1,e&&!wH(a.target,t.map(function(e){return e.current}),n)&&r()},s=function(){i.current.isTouchMove=!1},c=function(){i.current.isTouchMove=!0},l=function(a){e&&!i.current.isTouchMove&&!wH(a.target,t.map(function(e){return e.current}),n,!1)&&r()};return n.addEventListener(`mousedown`,a),n.addEventListener(`mouseup`,o),n.addEventListener(`touchstart`,s),n.addEventListener(`touchmove`,c),n.addEventListener(`touchend`,l),function(){n.removeEventListener(`mousedown`,a),n.removeEventListener(`mouseup`,o),n.removeEventListener(`touchstart`,s),n.removeEventListener(`touchmove`,c),n.removeEventListener(`touchend`,l)}}},[e,n]),i}var XH=function(){return dH};function ZH(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,a=n.items,o=n.environment,s=gc(n,OH);(0,L.useEffect)(function(){r||PH(function(){return e(z({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function QH(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=(0,L.useRef)(!0);return FH(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var $H=dH;function eU(e,t,n){return n===void 0&&(n=!0),z({isOpen:!1,highlightedIndex:-1},e.items?.length&&t>=0&&z({selectedItem:e.items[t],isOpen:GH(e,`isOpen`),highlightedIndex:GH(e,`highlightedIndex`)},n&&{inputValue:e.itemToString(e.items[t])}))}function tU(e,t,n){var r=t.type,i=t.props,a;switch(r){case n.ItemMouseMove:a={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:a={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:JH(i,e,0)};break;case n.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:JH(i,e,0)};break;case n.FunctionCloseMenu:a={isOpen:!1};break;case n.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:a={inputValue:t.inputValue};break;case n.FunctionReset:a={highlightedIndex:GH(i,`highlightedIndex`),isOpen:GH(i,`isOpen`),selectedItem:GH(i,`selectedItem`),inputValue:GH(i,`inputValue`)};break;default:throw Error(`Reducer called without proper action type.`)}return z({},e,a)}function nU(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,a=e.getItemNodeFromIndex,o=t.toLowerCase(),s=0;s<r.length;s++){var c=(s+n+ +(t.length<2))%r.length,l=r[c];if(l!==void 0&&i(l).toLowerCase().startsWith(o)&&!a(c)?.hasAttribute(`disabled`))return c}return n}X.default.array.isRequired,X.default.func,X.default.func,X.default.func,X.default.number,X.default.number,X.default.number,X.default.bool,X.default.bool,X.default.bool,X.default.any,X.default.any,X.default.any,X.default.string,X.default.string,X.default.string,X.default.func,X.default.string,X.default.func,X.default.func,X.default.func,X.default.func,X.default.func,X.default.shape({addEventListener:X.default.func,removeEventListener:X.default.func,document:X.default.shape({getElementById:X.default.func,activeElement:X.default.any,body:X.default.any})});function rU(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n===r?``:`${n} result${n===1?` is`:`s are`} available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.`:`No results are available.`:``}var iU=HI(HI({},WH),{getA11yStatusMessage:rU}),aU=dH,oU=0,sU=1,cU=2,lU=3,uU=4,dU=5,fU=6,pU=7,mU=8,hU=9,gU=10,_U=11,vU=12,yU=13,bU=14,xU=15,SU=16,CU=17,wU=18,TU=19,EU=20,DU=21,OU=Object.freeze({__proto__:null,ToggleButtonClick:oU,ToggleButtonKeyDownArrowDown:sU,ToggleButtonKeyDownArrowUp:cU,ToggleButtonKeyDownCharacter:lU,ToggleButtonKeyDownEscape:uU,ToggleButtonKeyDownHome:dU,ToggleButtonKeyDownEnd:fU,ToggleButtonKeyDownEnter:pU,ToggleButtonKeyDownSpaceButton:mU,ToggleButtonKeyDownPageUp:hU,ToggleButtonKeyDownPageDown:gU,ToggleButtonBlur:_U,MenuMouseLeave:vU,ItemMouseMove:yU,ItemClick:bU,FunctionToggleMenu:xU,FunctionOpenMenu:SU,FunctionCloseMenu:CU,FunctionSetHighlightedIndex:wU,FunctionSelectItem:TU,FunctionSetInputValue:EU,FunctionReset:DU});function kU(e,t){var n=t.type,r=t.props,i=t.altKey,a;switch(n){case bU:a={isOpen:GH(r,`isOpen`),highlightedIndex:GH(r,`highlightedIndex`),selectedItem:r.items[t.index]};break;case lU:var o=t.key,s=``+e.inputValue+o;a={inputValue:s,highlightedIndex:nU({keysSoFar:s,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.indexOf(e.selectedItem):e.highlightedIndex,items:r.items,itemToString:r.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex}),isOpen:!0};break;case sU:a={highlightedIndex:e.isOpen?SH(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):i&&e.selectedItem==null?-1:JH(r,e,1),isOpen:!0};break;case cU:a=e.isOpen&&i?eU(r,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?SH(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):JH(r,e,-1),isOpen:!0};break;case pU:case mU:a=eU(r,e.highlightedIndex,!1);break;case dU:a={highlightedIndex:CH(1,0,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case fU:a={highlightedIndex:CH(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case hU:a={highlightedIndex:SH(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case gU:a={highlightedIndex:SH(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case uU:a={isOpen:!1,highlightedIndex:-1};break;case _U:a=z({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items?.length&&{selectedItem:r.items[e.highlightedIndex]});break;case TU:a={selectedItem:t.selectedItem};break;default:return tU(e,t,OU)}return z({},e,a)}var AU=[`onMouseLeave`,`refKey`,`onKeyDown`,`onBlur`,`ref`],jU=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`],MU=[`item`,`index`,`onMouseMove`,`onClick`,`onPress`,`refKey`,`ref`,`disabled`];NU.stateChangeTypes=OU;function NU(e){e===void 0&&(e={}),aU(e,NU);var t=z({},iU,e),n=t.items,r=t.scrollIntoView,i=t.environment,a=t.itemToString,o=t.getA11ySelectionMessage,s=t.getA11yStatusMessage,c=UH(kU,qH(t),t),l=c[0],u=c[1],d=l.isOpen,f=l.highlightedIndex,p=l.selectedItem,m=l.inputValue,h=(0,L.useRef)(null),g=(0,L.useRef)(null),_=(0,L.useRef)({}),v=(0,L.useRef)(null),y=IH(t),b=(0,L.useRef)(),x=(0,L.useRef)(!0),S=VH({state:l,props:t}),C=(0,L.useCallback)(function(e){return _.current[y.getItemId(e)]},[y]);ZH(s,[d,f,m,n],z({isInitialMount:x.current,previousResultCount:b.current,items:n,environment:i,itemToString:a},l)),ZH(o,[p],z({isInitialMount:x.current,previousResultCount:b.current,items:n,environment:i,itemToString:a},l));var w=QH({menuElement:g.current,highlightedIndex:f,isOpen:d,itemRefs:_,scrollIntoView:r,getItemNodeFromIndex:C});(0,L.useEffect)(function(){return v.current=mH(function(e){e({type:EU,inputValue:``})},500),function(){v.current.cancel()}},[]),(0,L.useEffect)(function(){m&&v.current(u)},[u,m]),$H({isInitialMount:x.current,props:t,state:l}),(0,L.useEffect)(function(){x.current||(b.current=n.length)});var T=YH(d,[g,h],i,function(){u({type:_U})}),E=XH(`getMenuProps`,`getToggleButtonProps`);(0,L.useEffect)(function(){return x.current=!1,function(){x.current=!0}},[]),(0,L.useEffect)(function(){d||(_.current={})},[d]);var D=(0,L.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),u({type:sU,getItemNodeFromIndex:C,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),u({type:cU,getItemNodeFromIndex:C,altKey:e.altKey})},Home:function(e){e.preventDefault(),u({type:dU,getItemNodeFromIndex:C})},End:function(e){e.preventDefault(),u({type:fU,getItemNodeFromIndex:C})},Escape:function(){S.current.state.isOpen&&u({type:uU})},Enter:function(e){e.preventDefault(),u({type:S.current.state.isOpen?pU:oU})},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),u({type:hU,getItemNodeFromIndex:C}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),u({type:gU,getItemNodeFromIndex:C}))}," ":function(e){e.preventDefault();var t=S.current.state;if(!t.isOpen){u({type:oU});return}t.inputValue?u({type:lU,key:` `,getItemNodeFromIndex:C}):u({type:mU})}}},[u,C,S]),O=(0,L.useCallback)(function(){u({type:xU})},[u]),k=(0,L.useCallback)(function(){u({type:CU})},[u]),A=(0,L.useCallback)(function(){u({type:SU})},[u]),j=(0,L.useCallback)(function(e){u({type:wU,highlightedIndex:e})},[u]),M=(0,L.useCallback)(function(e){u({type:TU,selectedItem:e})},[u]),N=(0,L.useCallback)(function(){u({type:DU})},[u]),P=(0,L.useCallback)(function(e){u({type:EU,inputValue:e})},[u]),F=(0,L.useCallback)(function(e){return z({id:y.labelId,htmlFor:y.toggleButtonId},e)},[y]),ee=(0,L.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a;r.onKeyDown,r.onBlur;var s=r.ref,c=gc(r,AU),l=(t===void 0?{}:t).suppressRefError;return E(`getMenuProps`,l===void 0?!1:l,o,g),z((n={},n[o]=gH(s,function(e){g.current=e}),n.id=y.menuId,n.role=`listbox`,n[`aria-labelledby`]=c&&c[`aria-label`]?void 0:``+y.labelId,n.onMouseLeave=hH(i,function(){u({type:vU})}),n),c)},[u,E,y]);return{getToggleButtonProps:(0,L.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onBlur,a=r.onClick;r.onPress;var o=r.onKeyDown,s=r.refKey,c=s===void 0?`ref`:s,l=r.ref,d=gc(r,jU),f=(t===void 0?{}:t).suppressRefError,p=f===void 0?!1:f,m=S.current.state,g=function(){u({type:oU})},_=function(){m.isOpen&&!T.current.isMouseDown&&u({type:_U})},v=function(e){var t=xH(e);t&&D[t]?D[t](e):zH(t)&&u({type:lU,key:t,getItemNodeFromIndex:C})},b=z((n={},n[c]=gH(l,function(e){h.current=e}),n[`aria-activedescendant`]=m.isOpen&&m.highlightedIndex>-1?y.getItemId(m.highlightedIndex):``,n[`aria-controls`]=y.menuId,n[`aria-expanded`]=S.current.state.isOpen,n[`aria-haspopup`]=`listbox`,n[`aria-labelledby`]=d&&d[`aria-label`]?void 0:``+y.labelId,n.id=y.toggleButtonId,n.role=`combobox`,n.tabIndex=0,n.onBlur=hH(i,_),n),d);return d.disabled||(b.onClick=hH(a,g),b.onKeyDown=hH(o,v)),E(`getToggleButtonProps`,p,c,h),b},[S,y,E,u,T,D,C]),getLabelProps:F,getMenuProps:ee,getItemProps:(0,L.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.item,i=n.index,a=n.onMouseMove,o=n.onClick;n.onPress;var s=n.refKey,c=s===void 0?`ref`:s,l=n.ref,d=n.disabled,f=gc(n,MU),m=S.current,h=m.state,g=m.props,v=LH(r,i,g.items,`Pass either item or index to getItemProps!`),b=v[0],x=v[1],C=function(){x!==h.highlightedIndex&&(w.current=!1,u({type:yU,index:x,disabled:d}))},T=function(){u({type:bU,index:x})},E=z((t={disabled:d,role:`option`,"aria-selected":``+(b===p),id:y.getItemId(x)},t[c]=gH(l,function(e){e&&(_.current[y.getItemId(x)]=e)}),t),f);return d||(E.onClick=hH(o,T)),E.onMouseMove=hH(a,C),E},[S,p,y,w,u]),toggleMenu:O,openMenu:A,closeMenu:k,setHighlightedIndex:j,selectItem:M,reset:N,setInputValue:P,highlightedIndex:f,isOpen:d,selectedItem:p,inputValue:m}}var PU=0,FU=1,IU=2,LU=3,RU=4,zU=5,BU=6,VU=7,HU=8,UU=9,WU=10,GU=11,KU=12,qU=13,JU=14,YU=15,XU=16,ZU=17,QU=18,$U=19,eW=20,tW=21,nW=22,rW=Object.freeze({__proto__:null,InputKeyDownArrowDown:PU,InputKeyDownArrowUp:FU,InputKeyDownEscape:IU,InputKeyDownHome:LU,InputKeyDownEnd:RU,InputKeyDownPageUp:zU,InputKeyDownPageDown:BU,InputKeyDownEnter:VU,InputChange:HU,InputBlur:UU,InputFocus:WU,MenuMouseLeave:GU,ItemMouseMove:KU,ItemClick:qU,ToggleButtonClick:JU,FunctionToggleMenu:YU,FunctionOpenMenu:XU,FunctionCloseMenu:ZU,FunctionSetHighlightedIndex:QU,FunctionSelectItem:$U,FunctionSetInputValue:eW,FunctionReset:tW,ControlledPropUpdatedSelectedItem:nW});function iW(e){var t=qH(e),n=t.selectedItem,r=t.inputValue;return r===``&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),z({},t,{inputValue:r})}X.default.array.isRequired,X.default.func,X.default.func,X.default.func,X.default.func,X.default.number,X.default.number,X.default.number,X.default.bool,X.default.bool,X.default.bool,X.default.any,X.default.any,X.default.any,X.default.string,X.default.string,X.default.string,X.default.string,X.default.string,X.default.string,X.default.func,X.default.string,X.default.string,X.default.func,X.default.func,X.default.func,X.default.func,X.default.func,X.default.func,X.default.shape({addEventListener:X.default.func,removeEventListener:X.default.func,document:X.default.shape({getElementById:X.default.func,activeElement:X.default.any,body:X.default.any})});function aW(e,t,n){var r=(0,L.useRef)(),i=HH(e,t,n),a=i[0],o=i[1];return(0,L.useEffect)(function(){bH(n,`selectedItem`)&&(n.selectedItemChanged(r.current,n.selectedItem)&&o({type:nW,inputValue:n.itemToString(n.selectedItem)}),r.current=a.selectedItem===r.current?n.selectedItem:a.selectedItem)},[a.selectedItem,n.selectedItem]),[yH(a,n),o]}var oW=dH,sW=z({},WH,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:vH});function cW(e,t){var n=t.type,r=t.props,i=t.altKey,a;switch(n){case qU:a={isOpen:GH(r,`isOpen`),highlightedIndex:GH(r,`highlightedIndex`),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case PU:a=e.isOpen?{highlightedIndex:SH(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:i&&e.selectedItem==null?-1:JH(r,e,1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case FU:a=e.isOpen?i?eU(r,e.highlightedIndex):{highlightedIndex:SH(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:JH(r,e,-1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case VU:a=eU(r,e.highlightedIndex);break;case IU:a=z({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case zU:a={highlightedIndex:SH(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case BU:a={highlightedIndex:SH(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case LU:a={highlightedIndex:CH(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case RU:a={highlightedIndex:CH(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case UU:a=z({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items?.length&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case HU:a={isOpen:!0,highlightedIndex:GH(r,`highlightedIndex`),inputValue:t.inputValue};break;case WU:a={isOpen:!0,highlightedIndex:JH(r,e,0)};break;case $U:a={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case nW:a={inputValue:t.inputValue};break;default:return tU(e,t,rW)}return z({},e,a)}var lW=[`onMouseLeave`,`refKey`,`ref`],uW=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],dW=[`onClick`,`onPress`,`refKey`,`ref`],fW=[`onKeyDown`,`onChange`,`onInput`,`onFocus`,`onBlur`,`onChangeText`,`refKey`,`ref`];pW.stateChangeTypes=rW;function pW(e){e===void 0&&(e={}),oW(e,pW);var t=z({},sW,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,c=t.getA11ySelectionMessage,l=t.itemToString,u=aW(cW,iW(t),t),d=u[0],f=u[1],p=d.isOpen,m=d.highlightedIndex,h=d.selectedItem,g=d.inputValue,_=(0,L.useRef)(null),v=(0,L.useRef)({}),y=(0,L.useRef)(null),b=(0,L.useRef)(null),x=(0,L.useRef)(!0),S=IH(t),C=(0,L.useRef)(),w=VH({state:d,props:t}),T=(0,L.useCallback)(function(e){return v.current[S.getItemId(e)]},[S]);ZH(s,[p,m,g,i],z({isInitialMount:x.current,previousResultCount:C.current,items:i,environment:o,itemToString:l},d)),ZH(c,[h],z({isInitialMount:x.current,previousResultCount:C.current,items:i,environment:o,itemToString:l},d));var E=QH({menuElement:_.current,highlightedIndex:m,isOpen:p,itemRefs:v,scrollIntoView:a,getItemNodeFromIndex:T});$H({isInitialMount:x.current,props:t,state:d}),(0,L.useEffect)(function(){(n||r||p)&&y.current&&y.current.focus()},[]),(0,L.useEffect)(function(){x.current||(C.current=i.length)});var D=YH(p,[y,_,b],o,function(){f({type:UU,selectItem:!1})}),O=XH(`getInputProps`,`getMenuProps`);(0,L.useEffect)(function(){return x.current=!1,function(){x.current=!0}},[]),(0,L.useEffect)(function(){if(!p)v.current={};else if(o.document?.activeElement!==y.current){var e;y==null||(e=y.current)==null||e.focus()}},[p,o]);var k=(0,L.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),f({type:PU,altKey:e.altKey,getItemNodeFromIndex:T})},ArrowUp:function(e){e.preventDefault(),f({type:FU,altKey:e.altKey,getItemNodeFromIndex:T})},Home:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:LU,getItemNodeFromIndex:T}))},End:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:RU,getItemNodeFromIndex:T}))},Escape:function(e){var t=w.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),f({type:IU}))},Enter:function(e){!w.current.state.isOpen||e.which===229||(e.preventDefault(),f({type:VU,getItemNodeFromIndex:T}))},PageUp:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:zU,getItemNodeFromIndex:T}))},PageDown:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:BU,getItemNodeFromIndex:T}))}}},[f,w,T]),A=(0,L.useCallback)(function(e){return z({id:S.labelId,htmlFor:S.inputId},e)},[S]),j=(0,L.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,c=gc(r,lW),l=(t===void 0?{}:t).suppressRefError;return O(`getMenuProps`,l===void 0?!1:l,o,_),z((n={},n[o]=gH(s,function(e){_.current=e}),n.id=S.menuId,n.role=`listbox`,n[`aria-labelledby`]=c&&c[`aria-label`]?void 0:``+S.labelId,n.onMouseLeave=hH(i,function(){f({type:GU})}),n),c)},[f,O,S]),M=(0,L.useCallback)(function(e){var t,n,r=e===void 0?{}:e,i=r.item,a=r.index,o=r.refKey,s=o===void 0?`ref`:o,c=r.ref,l=r.onMouseMove,u=r.onMouseDown,d=r.onClick;r.onPress;var p=r.disabled,m=gc(r,uW),h=w.current,g=h.props,_=h.state,y=LH(i,a,g.items,`Pass either item or index to getItemProps!`)[1],b=`onClick`,x=d;return z((t={},t[s]=gH(c,function(e){e&&(v.current[S.getItemId(y)]=e)}),t.disabled=p,t.role=`option`,t[`aria-selected`]=``+(y===_.highlightedIndex),t.id=S.getItemId(y),t),!p&&(n={},n[b]=hH(x,function(){f({type:qU,index:y})}),n),{onMouseMove:hH(l,function(){y!==_.highlightedIndex&&(E.current=!1,f({type:KU,index:y,disabled:p}))}),onMouseDown:hH(u,function(e){return e.preventDefault()})},m)},[f,w,E,S]),N=(0,L.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.onClick;n.onPress;var i=n.refKey,a=i===void 0?`ref`:i,o=n.ref,s=gc(n,dW),c=w.current.state;return z((t={},t[a]=gH(o,function(e){b.current=e}),t[`aria-controls`]=S.menuId,t[`aria-expanded`]=c.isOpen,t.id=S.toggleButtonId,t.tabIndex=-1,t),!s.disabled&&z({},{onClick:hH(r,function(){f({type:JU})})}),s)},[f,w,S]),P=(0,L.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onKeyDown,a=r.onChange,s=r.onInput,c=r.onFocus,l=r.onBlur;r.onChangeText;var u=r.refKey,d=u===void 0?`ref`:u,p=r.ref,m=gc(r,fW),h=(t===void 0?{}:t).suppressRefError;O(`getInputProps`,h===void 0?!1:h,d,y);var g=w.current.state,_=function(e){var t=xH(e);t&&k[t]&&k[t](e)},v=function(e){f({type:HU,inputValue:e.target.value})},b=function(e){g.isOpen&&!D.current.isMouseDown&&f({type:UU,selectItem:!(e.relatedTarget===null&&o.document.activeElement!==o.document.body)})},x=function(){g.isOpen||f({type:WU})},C=`onChange`,T={};if(!m.disabled){var E;T=(E={},E[C]=hH(a,s,v),E.onKeyDown=hH(i,_),E.onBlur=hH(l,b),E.onFocus=hH(c,x),E)}return z((n={},n[d]=gH(p,function(e){y.current=e}),n[`aria-activedescendant`]=g.isOpen&&g.highlightedIndex>-1?S.getItemId(g.highlightedIndex):``,n[`aria-autocomplete`]=`list`,n[`aria-controls`]=S.menuId,n[`aria-expanded`]=g.isOpen,n[`aria-labelledby`]=m&&m[`aria-label`]?void 0:``+S.labelId,n.autoComplete=`off`,n.id=S.inputId,n.role=`combobox`,n.value=g.inputValue,n),T,m)},[O,w,S,k,f,D,o]),F=(0,L.useCallback)(function(){f({type:YU})},[f]),ee=(0,L.useCallback)(function(){f({type:ZU})},[f]),te=(0,L.useCallback)(function(){f({type:XU})},[f]),ne=(0,L.useCallback)(function(e){f({type:QU,highlightedIndex:e})},[f]),re=(0,L.useCallback)(function(e){f({type:$U,selectedItem:e})},[f]);return{getItemProps:M,getLabelProps:A,getMenuProps:j,getInputProps:P,getToggleButtonProps:N,toggleMenu:F,openMenu:te,closeMenu:ee,setHighlightedIndex:ne,setInputValue:(0,L.useCallback)(function(e){f({type:eW,inputValue:e})},[f]),selectItem:re,reset:(0,L.useCallback)(function(){f({type:tW})},[f]),highlightedIndex:m,isOpen:p,selectedItem:h,inputValue:g}}var mW={activeIndex:-1,selectedItems:[]};function hW(e,t){return KH(e,t,mW)}function gW(e,t){return GH(e,t,mW)}function _W(e){return{activeIndex:hW(e,`activeIndex`),selectedItems:hW(e,`selectedItems`)}}function vW(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==``&&(t.selectionStart!==0||t.selectionEnd!==0))}function yW(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+` has been removed.`}X.default.array,X.default.array,X.default.array,X.default.func,X.default.func,X.default.func,X.default.number,X.default.number,X.default.number,X.default.func,X.default.func,X.default.string,X.default.string,X.default.shape({addEventListener:X.default.func,removeEventListener:X.default.func,document:X.default.shape({getElementById:X.default.func,activeElement:X.default.any,body:X.default.any})});var bW={itemToString:WH.itemToString,stateReducer:WH.stateReducer,environment:WH.environment,getA11yRemovalMessage:yW,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},xW=dH,SW=0,CW=1,wW=2,TW=3,EW=4,DW=5,OW=6,kW=7,AW=8,jW=9,MW=10,NW=11,PW=12,FW=Object.freeze({__proto__:null,SelectedItemClick:SW,SelectedItemKeyDownDelete:CW,SelectedItemKeyDownBackspace:wW,SelectedItemKeyDownNavigationNext:TW,SelectedItemKeyDownNavigationPrevious:EW,DropdownKeyDownNavigationPrevious:DW,DropdownKeyDownBackspace:OW,DropdownClick:kW,FunctionAddSelectedItem:AW,FunctionRemoveSelectedItem:jW,FunctionSetSelectedItems:MW,FunctionSetActiveIndex:NW,FunctionReset:PW});function IW(e,t){var n=t.type,r=t.index,i=t.props,a=t.selectedItem,o=e.activeIndex,s=e.selectedItems,c;switch(n){case SW:c={activeIndex:r};break;case EW:c={activeIndex:o-1<0?0:o-1};break;case TW:c={activeIndex:o+1>=s.length?-1:o+1};break;case wW:case CW:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=z({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case DW:c={activeIndex:s.length-1};break;case OW:c={selectedItems:s.slice(0,s.length-1)};break;case AW:c={selectedItems:[].concat(s,[a])};break;case kW:c={activeIndex:-1};break;case jW:var u=o,d=s.indexOf(a);if(d<0)break;s.length===1?u=-1:d===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,d),s.slice(d+1)),activeIndex:u};break;case MW:c={selectedItems:t.selectedItems};break;case NW:c={activeIndex:t.activeIndex};break;case PW:c={activeIndex:gW(i,`activeIndex`),selectedItems:gW(i,`selectedItems`)};break;default:throw Error(`Reducer called without proper action type.`)}return z({},e,c)}var LW=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],RW=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];zW.stateChangeTypes=FW;function zW(e){e===void 0&&(e={}),xW(e,zW);var t=z({},bW,e),n=t.getA11yRemovalMessage,r=t.itemToString,i=t.environment,a=t.keyNavigationNext,o=t.keyNavigationPrevious,s=UH(IW,_W(t),t),c=s[0],l=s[1],u=c.activeIndex,d=c.selectedItems,f=(0,L.useRef)(!0),p=(0,L.useRef)(null),m=(0,L.useRef)(d),h=(0,L.useRef)();h.current=[];var g=VH({state:c,props:t});(0,L.useEffect)(function(){if(!f.current){if(d.length<m.current.length){var e=m.current.find(function(e){return d.indexOf(e)<0});EH(n({itemToString:r,resultCount:d.length,removedSelectedItem:e,activeIndex:u,activeSelectedItem:d[u]}),i.document)}m.current=d}},[d.length]),(0,L.useEffect)(function(){f.current||(u===-1&&p.current?p.current.focus():h.current[u]&&h.current[u].focus())},[u]),$H({isInitialMount:f.current,props:t,state:c});var _=XH(`getDropdownProps`);(0,L.useEffect)(function(){return f.current=!1,function(){f.current=!0}},[]);var v=(0,L.useMemo)(function(){var e;return e={},e[o]=function(){l({type:EW})},e[a]=function(){l({type:TW})},e.Delete=function(){l({type:CW})},e.Backspace=function(){l({type:wW})},e},[l,a,o]),y=(0,L.useMemo)(function(){var e;return e={},e[o]=function(e){vW(e)&&l({type:DW})},e.Backspace=function(e){vW(e)&&l({type:OW})},e},[l,o]);return{getSelectedItemProps:(0,L.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.refKey,i=r===void 0?`ref`:r,a=n.ref,o=n.onClick,s=n.onKeyDown,c=n.selectedItem,u=n.index,d=gc(n,LW),f=g.current.state,p=LH(c,u,f.selectedItems,`Pass either item or index to getSelectedItemProps!`)[1],m=p>-1&&p===f.activeIndex;return z((t={},t[i]=gH(a,function(e){e&&h.current.push(e)}),t.tabIndex=m?0:-1,t.onClick=hH(o,function(){l({type:SW,index:p})}),t.onKeyDown=hH(s,function(e){var t=xH(e);t&&v[t]&&v[t](e)}),t),d)},[l,g,v]),getDropdownProps:(0,L.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.refKey,a=i===void 0?`ref`:i,o=r.ref,s=r.onKeyDown,c=r.onClick,u=r.preventKeyAction,d=u===void 0?!1:u,f=gc(r,RW),m=(t===void 0?{}:t).suppressRefError;return _(`getDropdownProps`,m===void 0?!1:m,a,p),z((n={},n[a]=gH(o,function(e){e&&(p.current=e)}),n),!d&&{onKeyDown:hH(s,function(e){var t=xH(e);t&&y[t]&&y[t](e)}),onClick:hH(c,function(){l({type:kW})})},f)},[l,y,_]),addSelectedItem:(0,L.useCallback)(function(e){l({type:AW,selectedItem:e})},[l]),removeSelectedItem:(0,L.useCallback)(function(e){l({type:jW,selectedItem:e})},[l]),setSelectedItems:(0,L.useCallback)(function(e){l({type:MW,selectedItems:e})},[l]),setActiveIndex:(0,L.useCallback)(function(e){l({type:NW,activeIndex:e})},[l]),reset:(0,L.useCallback)(function(){l({type:PW})},[l]),selectedItems:d,activeIndex:u}}var BW=20,VW=e=>e.suggestions.length>0?L.createElement(HW,{...e}):L.createElement(`input`,{className:J.textInput,size:40,autoFocus:!0,...e.register(e.inputName)}),HW=({autofocus:e,suggestions:t,control:n,inputName:r,placeholder:i,initialInputValue:a,setValue:o})=>{let[s,c]=L.useState(t.slice(0,BW)),l=Id(fk),u=t.length>0,{isOpen:d,getToggleButtonProps:f,getMenuProps:p,getInputProps:m,highlightedIndex:h,getItemProps:g,selectedItem:_}=pW({initialInputValue:a,onInputValueChange({inputValue:e=``}){o(r,e),e=e.toLowerCase()||``;let n=[];for(let r of t)if(r.toLowerCase().includes(e)&&(n.push(r),n.length>=BW))break;c(n)},items:s,itemToString(e){return e??``}}),v=d&&s.length>0;return L.createElement(`div`,{className:J.downshiftAutocompleteContainer},L.createElement(`div`,{"data-visible-dropdown":v,className:J.downshiftInputWrapper},L.createElement(Hte,{name:r,control:n,render:({field:t})=>{let n=m();return L.createElement(`input`,{...n,name:t.name,placeholder:i,className:J.downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:e})}}),u&&L.createElement(`button`,{"aria-label":`toggle menu`,type:`button`,...f()},l(`arrow_drop_down`))),L.createElement(`div`,{className:J.downshiftAutocompleteContainer},L.createElement(`ul`,{...p(),"data-visible":v},s.map((e,t)=>L.createElement(`li`,{"data-selected":_===e,"data-highlighted":h===t,key:`${e}${t}`,...g({item:e,index:t})},e)))))};function UW(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var WW={testNode:`blockquote`,visitNode({actions:e}){e.addAndStepInto(tx())}},GW={testLexicalNode:nx,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`blockquote`)}},KW=Gd({init(e){e.pubIn({[Ik]:`quote`,[$O]:WW,[QO]:ex,[nk]:GW})}});function qW(){let e=Wd;return{publish:()=>{e()},subscribe:t=>{e=t}}}var JW=Object.defineProperty,YW=(e,t,n)=>t in e?JW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XW=(e,t,n)=>(YW(e,typeof t==`symbol`?t:t+``,n),n),ZW=class e extends Ig{constructor(e,t,n,r){super(r),XW(this,`__code`),XW(this,`__meta`),XW(this,`__language`),XW(this,`__focusEmitter`,qW()),XW(this,`setCode`,e=>{e!==this.__code&&(this.getWritable().__code=e)}),XW(this,`setMeta`,e=>{e!==this.__meta&&(this.getWritable().__meta=e)}),XW(this,`setLanguage`,e=>{e!==this.__language&&(this.getWritable().__language=e)}),XW(this,`select`,()=>{this.__focusEmitter.publish()}),this.__code=e,this.__meta=n,this.__language=t}static getType(){return`codeblock`}static clone(t){return new e(t.__code,t.__language,t.__meta,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__code=e.__code,this.__meta=e.__meta,this.__language=e.__language,this.__focusEmitter=qW()}static importJSON(e){let{code:t,meta:n,language:r}=e;return nG({code:t,language:r,meta:n})}static importDOM(){return{pre:()=>({conversion:iG,priority:3})}}exportJSON(){return{code:this.getCode(),language:this.getLanguage(),meta:this.getMeta(),type:`codeblock`,version:1}}createDOM(e,t){return document.createElement(`div`)}updateDOM(){return!1}getCode(){return this.__code}getMeta(){return this.__meta}getLanguage(){return this.__language}decorate(e){return L.createElement(tG,{parentEditor:e,code:this.getCode(),meta:this.getMeta(),language:this.getLanguage(),codeBlockNode:this,nodeKey:this.getKey(),focusEmitter:this.__focusEmitter})}isInline(){return!1}},QW=L.createContext(null),$W=({parentEditor:e,lexicalNode:t,children:n})=>{let r=L.useMemo(()=>({lexicalNode:t,parentEditor:e,setCode:n=>{e.update(()=>{t.setCode(n),setTimeout(()=>{e.dispatchCommand(yO,void 0)},0)})},setLanguage:n=>{e.update(()=>{t.setLanguage(n)})},setMeta:n=>{e.update(()=>{t.setMeta(n)})}}),[t,e]);return L.createElement(QW.Provider,{value:r},n)};function eG(){let e=L.useContext(QW);if(!e)throw Error(`useCodeBlockEditor must be used within a CodeBlockEditor`);return e}var tG=e=>{let t=Id(JO),n=Id(sG),r=t.sort((e,t)=>t.priority-e.priority).find(t=>t.match(e.language||``,e.meta||``));if(r??=t.find(t=>t.match(n||``,e.meta||``)),!r)throw Error(`No CodeBlockEditor registered for language=${e.language} meta=${e.meta}`);let i=r.Editor,{codeBlockNode:a,parentEditor:o,...s}=e;return L.createElement($W,{parentEditor:e.parentEditor,lexicalNode:e.codeBlockNode},L.createElement(i,{...s}))};function nG(e){let{code:t=``,language:n=``,meta:r=``}=e;return new ZW(t,n,r)}function rG(e){return e instanceof ZW}function iG(e){let t=e,n=t.textContent,r=e.getAttribute(`class`)??``,i=e.getAttribute(`data-language`)??``,a=/language-(\w+)/.exec(r);return{node:nG({code:n,language:a?a[1]:i,meta:t.getAttribute(`data-meta`)??``})}}var aG={testLexicalNode:rG,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`code`,{value:e.getCode(),lang:e.getLanguage(),meta:e.getMeta()})}},oG={testNode:(e,{codeBlockEditorDescriptors:t})=>e.type===`code`?t.find(t=>t.match(e.lang,e.meta))!==void 0:!1,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(nG({code:e.value,language:e.lang??``,meta:e.meta??``}))}},sG=B(``),cG=Md(e=>{e.link(e.pipe(cG,Bd(sG),zd(([e,t])=>()=>nG({language:t,...e}))),Mk)}),lG=pk(JO),uG=Gd({update(e,t){e.pub(sG,t?.defaultCodeBlockLanguage??``)},init(e,t){e.pubIn({[Ik]:`codeblock`,[JO]:t?.codeBlockEditorDescriptors??[],[$O]:oG,[QO]:ZW,[nk]:aG})}}),dG=`modulepreload`,fG=function(e){return`/apps/chat/`+e},pG={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=fG(t,n),t in pG)return;pG[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:dG,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},mG=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=oe(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(xG(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function hG(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function gG(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=hG(t)+hG(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function _G(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:gG(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function vG(e,t){return n=>{for(let t=oe(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var yG=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function bG(e){return e.selection.main.from}function xG(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var SG=ge.define();function CG(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:k.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var wG=new WeakMap;function TG(e){if(!Array.isArray(e))return e;let t=wG.get(e);return t||wG.set(e,t=_G(e)),t}var EG=w.define(),DG=w.define(),OG=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=ce(e,t),r=a(n);this.chars.push(n);let i=e.slice(t,t+r),o=i.toUpperCase();this.folded.push(ce(o==i?i.toLowerCase():o,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:o}=this;if(t.length==1){let r=ce(e,0),i=a(r),o=i==e.length?0:-100;if(r!=t[0])if(r==n[0])o+=-200;else return null;return this.ret(o,[0,i])}let s=e.indexOf(this.pattern);if(s==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=t.length,l=0;if(s<0){for(let i=0,o=Math.min(e.length,200);i<o&&l<c;){let o=ce(e,i);(o==t[l]||o==n[l])&&(r[l++]=i),i+=a(o)}if(l<c)return null}let u=0,d=0,f=!1,p=0,m=-1,h=-1,g=/[a-z]/.test(e),_=!0;for(let r=0,l=Math.min(e.length,200),v=0;r<l&&d<c;){let l=ce(e,r);s<0&&(u<c&&l==t[u]&&(i[u++]=r),p<c&&(l==t[p]||l==n[p]?(p==0&&(m=r),h=r+1,p++):p=0));let b,x=l<255?l>=48&&l<=57||l>=97&&l<=122?2:+(l>=65&&l<=90):(b=y(l))==b.toLowerCase()?b==b.toUpperCase()?0:2:1;(!r||x==1&&g||v==0&&x!=0)&&(t[d]==l||n[d]==l&&(f=!0)?o[d++]=r:o.length&&(_=!1)),v=x,r+=a(l)}return d==c&&o[0]==0&&_?this.result(-100+(f?-200:0),o,e):p==c&&m==0?this.ret(-200-e.length+(h==e.length?0:-100),[0,h]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):p==c?this.ret(-900-e.length,[m,h]):d==c?this.result(-100+(f?-200:0)+-700+(_?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?a(ce(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},kG=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},AG=ke.define({combine(e){return se(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:MG,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>jG(e(n),t(n)),optionClass:(e,t)=>n=>jG(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function jG(e,t){return e?t?e+` `+t:e:t}function MG(e,t,n,r,i,a){let o=e.textDirection==u.RTL,s=o,c=!1,l=`top`,d,f,p=t.left-i.left,m=i.right-t.right,h=r.right-r.left,g=r.bottom-r.top;if(s&&p<Math.min(h,m)?s=!1:!s&&m<Math.min(h,p)&&(s=!0),h<=(s?p:m))d=Math.max(i.top,Math.min(n.top,i.bottom-g))-t.top,f=Math.min(400,s?p:m);else{c=!0,f=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=g||e>t.top?d=n.bottom-t.top:(l=`bottom`,d=t.bottom-n.top)}let _=(t.bottom-t.top)/a.offsetHeight,v=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${d/_}px; max-width: ${f/v}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var NG=w.define();function PG(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function FG(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var IG=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(AG);this.optionContent=PG(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=FG(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:NG.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(AG).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:DG.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=FG(r.length,i,e.state.facet(AG).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=FG(t.options.length,t.selected,this.view.state.facet(AG).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>he(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&RG(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(AG).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function LG(e,t){return n=>new IG(n,e,t)}function RG(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function zG(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function BG(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(AG);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new yG(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new kG(n):new OG(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new yG(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):zG(e.completion)>zG(c)&&(s[s.length-1]=e),c=e.completion}return s}var VG=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,KG(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=BG(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(AG).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,KG(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:tK,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},HG=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(qG,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(AG),i=(r.override||n.languageDataAt(`autocomplete`,bG(n)).map(TG)).map(e=>(this.active.find(t=>t.source==e)||new YG(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(QG));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!UG(i,this.active)||o?a=VG.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new YG(e.source,0):e));for(let e of t.effects)e.is(NG)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?WG:GG}};function UG(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var WG={"aria-autocomplete":`list`},GG={};function KG(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var qG=[];function JG(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(SG);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var YG=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=JG(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(EG))i=new e(i.source,1,n.value);else if(n.is(DG))i=new e(i.source,0);else if(n.is(QG))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(bG(e.state))}},XG=class e extends YG{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=bG(t.state);if(o>a||!r||n&2&&(bG(t.startState)==this.from||o<this.limit))return new YG(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return ZG(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new mG(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??bG(t.state)):new YG(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new YG(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function ZG(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):xG(e,!0).test(i)}var QG=w.define({map(e,t){return e.map(e=>e.map(t))}}),$G=l.define({create(){return HG.start()},update(e,t){return e.update(t)},provide:e=>[F.from(e,e=>e.tooltip),f.contentAttributes.from(e,e=>e.attrs)]});function eK(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field($G).active.find(e=>e.source==t.source);return r instanceof XG?(typeof n==`string`?e.dispatch({...CG(e.state,n,r.from,r.to),annotations:SG.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var tK=LG($G,eK);function nK(e,t=`option`){return n=>{let i=n.state.field($G,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(AG).interactionDelay)return!1;let a=1,o;t==`page`&&(o=r(n,i.open.tooltip))&&(a=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector(`li`).offsetHeight)-1));let{length:s}=i.open.options,c=i.open.selected>-1?i.open.selected+a*(e?1:-1):e?0:s-1;return c<0?c=t==`page`?0:s-1:c>=s&&(c=t==`page`?s-1:0),n.dispatch({effects:NG.of(c)}),!0}}var rK=e=>{let t=e.state.field($G,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(AG).interactionDelay?!1:eK(e,t.open.options[t.open.selected])},iK=e=>e.state.field($G,!1)?(e.dispatch({effects:EG.of(!0)}),!0):!1,aK=e=>{let t=e.state.field($G,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:DG.of(null)}),!0)},oK=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},sK=50,cK=1e3,lK=_e.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field($G).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field($G),n=e.state.facet(AG);if(!e.selectionSet&&!e.docChanged&&e.startState.field($G)==t)return;let r=e.transactions.some(e=>{let t=JG(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>sK&&Date.now()-n.time>cK){for(let e of n.context.abortListeners)try{e()}catch(e){he(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(EG)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field($G);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(AG).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new mG(t,bG(t),e.explicit,this.view),r=new oK(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:DG.of(null)}),he(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(AG).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(AG),n=this.view.state.field($G);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=bG(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new XG(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new YG(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:QG.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field($G,!1);if(t&&t.tooltip&&this.view.state.facet(AG).closeOnBlur){let n=t.open&&r(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:DG.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:EG.of(!1)}),20),this.composing=0}}}),uK=typeof navigator==`object`&&/Win/.test(navigator.platform),dK=Oe.highest(f.domEventHandlers({keydown(e,t){let n=t.state.field($G,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(uK&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&eK(t,r),!1}})),fK=f.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),pK=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},mK=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,M.TrackDel),r=t.mapPos(this.to,1,M.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},hK=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),a=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=a,o=/^\t*/.exec(i)[0].length;for(let t=0;t<o;t++)n+=e.facet(c);r.push(t+n.length-o),i=n+i.slice(o)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new mK(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1,c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new pK(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},gK=T.widget({widget:new class extends d{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),_K=T.mark({class:`cm-snippetField`}),vK=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=T.set(e.map(e=>(e.from==e.to?gK:_K).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},yK=w.define({map(e,t){return e&&e.map(t)}}),bK=w.define(),xK=l.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(yK))return n.value;if(n.is(bK)&&e)return new vK(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>f.decorations.from(e,e=>e?e.deco:T.none)});function SK(e,t){return k.create(e.filter(e=>e.field==t).map(e=>k.range(e.from,e.to)))}function CK(e){let t=hK.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:c}=e.state.selection,l={changes:{from:r,to:i==c.from?c.to:i,insert:s.of(a)},scrollIntoView:!0,annotations:n?[SG.of(n),_.userEvent.of(`input.complete`)]:void 0};if(o.length&&(l.selection=SK(o,0)),o.some(e=>e.field>0)){let t=new vK(o,0),n=l.effects=[yK.of(t)];e.state.field(xK,!1)===void 0&&n.push(w.appendConfig.of([xK,DK,kK,fK]))}e.dispatch(e.state.update(l))}}function wK(e){return({state:t,dispatch:n})=>{let r=t.field(xK,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:SK(r.ranges,i),effects:yK.of(a?null:new vK(r.ranges,i)),scrollIntoView:!0})),!0}}var TK=[{key:`Tab`,run:wK(1),shift:wK(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(xK,!1)?(t(e.update({effects:yK.of(null)})),!0):!1}],EK=ke.define({combine(e){return e.length?e[0]:TK}}),DK=Oe.highest(ae.compute([EK],e=>e.facet(EK)));function OK(e,t){return{...t,apply:CK(e)}}var kK=f.domEventHandlers({mousedown(e,t){let n=t.state.field(xK,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:SK(n.ranges,i.field),effects:yK.of(n.ranges.some(e=>e.field>i.field)?new vK(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),AK={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},jK=w.define({map(e,t){return t.mapPos(e,-1,M.TrackAfter)??void 0}}),MK=new class extends Ee{};MK.startSide=1,MK.endSide=-1;var NK=l.define({create(){return S.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(jK)&&(e=e.update({add:[MK.range(n.value,n.value+1)]}));return e}});function PK(){return[zK,NK]}var FK=`()[]{}<>«»»«[]{}`;function IK(e){for(let t=0;t<16;t+=2)if(FK.charCodeAt(t)==e)return FK.charAt(t+1);return y(e<128?e:e+1)}function LK(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||AK}var RK=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),zK=f.inputHandler.of((e,t,n,r)=>{if((RK?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&a(ce(r,0))==1||t!=i.from||n!=i.to)return!1;let o=VK(e.state,r);return o?(e.dispatch(o),!0):!1}),BK=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=LK(e,e.selection.main.head).brackets||AK.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=WK(e.doc,t.head);for(let i of n)if(i==r&&UK(e.doc,t.head)==IK(ce(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:k.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function VK(e,t){let n=LK(e,e.selection.main.head),r=n.brackets||AK.brackets;for(let i of r){let a=IK(ce(i,0));if(t==i)return a==i?qK(e,i,r.indexOf(i+i+i)>-1,n):GK(e,i,a,n.before||AK.before);if(t==a&&HK(e,e.selection.main.from))return KK(e,i,a)}return null}function HK(e,t){let n=!1;return e.field(NK).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function UK(e,t){let n=e.sliceString(t,t+2);return n.slice(0,a(ce(n,0)))}function WK(e,t){let n=e.sliceString(t-2,t);return a(ce(n,0))==n.length?n:n.slice(1)}function GK(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:jK.of(a.to+t.length),range:k.range(a.anchor+t.length,a.head+t.length)};let o=UK(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:jK.of(a.head+t.length),range:k.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function KK(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&UK(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:k.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function qK(e,t,n,r){let i=r.stringPrefixes||AK.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:jK.of(r.to+t.length),range:k.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=UK(e.doc,o),c;if(s==t){if(JK(e,o))return{changes:{insert:t+t,from:o},effects:jK.of(o+t.length),range:k.cursor(o+t.length)};if(HK(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:k.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=XK(e,o-2*t.length,i))>-1&&JK(e,c))return{changes:{insert:t+t+t+t,from:o},effects:jK.of(o+t.length),range:k.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=I.Word&&XK(e,o,i)>-1&&!YK(e,o,t,i))return{changes:{insert:t+t,from:o},effects:jK.of(o+t.length),range:k.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function JK(e,t){let n=oe(e).resolveInner(t+1);return n.parent&&n.from==t}function YK(e,t,n,r){let i=oe(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function XK(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=I.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=I.Word)return n}return-1}function ZK(e={}){return[dK,$G,AG.of(e),lK,$K,fK]}var QK=[{key:`Ctrl-Space`,run:iK},{mac:"Alt-`",run:iK},{mac:`Alt-i`,run:iK},{key:`Escape`,run:aK},{key:`ArrowDown`,run:nK(!0)},{key:`ArrowUp`,run:nK(!1)},{key:`PageDown`,run:nK(!0,`page`)},{key:`PageUp`,run:nK(!1,`page`)},{key:`Enter`,run:rK}],$K=Oe.highest(ae.computeN([AG],e=>e.facet(AG).defaultKeymap?[QK]:[])),eq=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=aq(e.state,n.from);return r.line?nq(e):r.block?iq(e):!1};function tq(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var nq=tq(uq,0),rq=tq(lq,0),iq=tq((e,t)=>lq(e,t,cq(t)),0);function aq(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var oq=50;function sq(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-oq,r),o=e.sliceDoc(i,i+oq),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*oq?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+oq),d=e.sliceDoc(i-oq,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function cq(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function lq(e,t,n=t.selection.ranges){let r=n.map(e=>aq(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>sq(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function uq(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=aq(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var dq=ge.define(),fq=ge.define(),pq=ke.define(),mq=ke.define({combine(e){return se(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),hq=l.define({create(){return Pq.empty},update(e,t){let n=t.state.facet(mq),r=t.annotation(dq);if(r){let i=Sq.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?Cq(o,o.length,n.minDepth,i):kq(o,t.startState.selection),new Pq(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(fq);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(_.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Sq.fromTransaction(t),o=t.annotation(_.time),s=t.annotation(_.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new Pq(e.done.map(Sq.fromJSON),e.undone.map(Sq.fromJSON))}});function gq(e={}){return[hq,mq.of(e),f.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?vq:e.inputType==`historyRedo`?yq:null;return n?(e.preventDefault(),n(t)):!1}})]}function _q(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(hq,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var vq=_q(0,!1),yq=_q(1,!1),bq=_q(0,!0),xq=_q(1,!0),Sq=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&ie.fromJSON(t.changes),[],t.mapped&&de.fromJSON(t.mapped),t.startSelection&&k.fromJSON(t.startSelection),t.selectionsAfter.map(k.fromJSON))}static fromTransaction(t,n){let r=Dq;for(let e of t.startState.facet(pq)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Dq)}static selection(t){return new e(void 0,Dq,void 0,void 0,t)}};function Cq(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function wq(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function Tq(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function Eq(e,t){return e.length?t.length?e.concat(t):e:t}var Dq=[],Oq=200;function kq(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Oq));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Cq(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Sq.selection([t])]}function Aq(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function jq(e,t){if(!e.length)return e;let n=e.length,r=Dq;for(;n;){let i=Mq(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Sq.selection(r)]:Dq}function Mq(e,t,n){let r=Eq(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Dq,n);if(!e.changes)return Sq.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new Sq(i,w.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var Nq=/^(input\.type|delete)($|\.)/,Pq=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||Nq.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,wq(s.changes,t.changes))||r==`input.type.compose`)?Cq(o,o.length-1,i.minDepth,new Sq(t.changes.compose(s.changes),Eq(w.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Dq)):Cq(o,o.length,i.minDepth,t),new e(o,Dq,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Dq;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Tq(a[a.length-1],t)?this:new e(kq(this.done,t),this.undone,n,r)}addMapping(t){return new e(jq(this.done,t),jq(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:dq.of({side:e,rest:Aq(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?Dq:r.slice(0,r.length-1);return i.mapped&&(n=jq(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:dq.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};Pq.empty=new Pq(Dq,Dq);var Fq=[{key:`Mod-z`,run:vq,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:yq,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:yq,preventDefault:!0},{key:`Mod-u`,run:bq,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:xq,preventDefault:!0}];function Iq(e,t){return k.create(e.ranges.map(t),e.mainIndex)}function Lq(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function Rq({state:e,dispatch:t},n){let r=Iq(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Lq(e,r)),!0)}function zq(e,t){return k.cursor(t?e.to:e.from)}function Bq(e,t){return Rq(e,n=>n.empty?e.moveByChar(n,t):zq(n,t))}function Vq(e){return e.textDirectionAt(e.state.selection.main.head)==u.LTR}var Hq=e=>Bq(e,!Vq(e)),Uq=e=>Bq(e,Vq(e));function Wq(e,t){return Rq(e,n=>n.empty?e.moveByGroup(n,t):zq(n,t))}var Gq=e=>Wq(e,!Vq(e)),Kq=e=>Wq(e,Vq(e));typeof Intl<`u`&&Intl.Segmenter;function qq(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Jq(e,t,n){let r=oe(e).resolveInner(t.head),i=n?p.closedBy:p.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;qq(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?g(e,r.from,1):g(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,k.cursor(s,n?-1:1)}var Yq=e=>Rq(e,t=>Jq(e.state,t,!Vq(e))),Xq=e=>Rq(e,t=>Jq(e.state,t,Vq(e)));function Zq(e,t){return Rq(e,n=>{if(!n.empty)return zq(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var Qq=e=>Zq(e,!1),$q=e=>Zq(e,!0);function eJ(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(f.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function tJ(e,t){let n=eJ(e),{state:r}=e,i=Iq(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):zq(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=f.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(Lq(r,i),{effects:a}),!0}var nJ=e=>tJ(e,!1),rJ=e=>tJ(e,!0);function iJ(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=k.cursor(r.from+n))}return i}var aJ=e=>Rq(e,t=>iJ(e,t,!0)),oJ=e=>Rq(e,t=>iJ(e,t,!1)),sJ=e=>Rq(e,t=>iJ(e,t,!Vq(e))),cJ=e=>Rq(e,t=>iJ(e,t,Vq(e))),lJ=e=>Rq(e,t=>k.cursor(e.lineBlockAt(t.head).from,1)),uJ=e=>Rq(e,t=>k.cursor(e.lineBlockAt(t.head).to,-1));function dJ(e,t,n){let r=!1,i=Iq(e.selection,t=>{let i=g(e,t.head,-1)||g(e,t.head,1)||t.head>0&&g(e,t.head-1,1)||t.head<e.doc.length&&g(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?k.range(t.anchor,a):k.cursor(a)});return r?(t(Lq(e,i)),!0):!1}var fJ=({state:e,dispatch:t})=>dJ(e,t,!1);function pJ(e,t){let n=Iq(e.state.selection,e=>{let n=t(e);return k.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(Lq(e.state,n)),!0)}function mJ(e,t){return pJ(e,n=>e.moveByChar(n,t))}var hJ=e=>mJ(e,!Vq(e)),gJ=e=>mJ(e,Vq(e));function _J(e,t){return pJ(e,n=>e.moveByGroup(n,t))}var vJ=e=>_J(e,!Vq(e)),yJ=e=>_J(e,Vq(e)),bJ=e=>pJ(e,t=>Jq(e.state,t,!Vq(e))),xJ=e=>pJ(e,t=>Jq(e.state,t,Vq(e)));function SJ(e,t){return pJ(e,n=>e.moveVertically(n,t))}var CJ=e=>SJ(e,!1),wJ=e=>SJ(e,!0);function TJ(e,t){return pJ(e,n=>e.moveVertically(n,t,eJ(e).height))}var EJ=e=>TJ(e,!1),DJ=e=>TJ(e,!0),OJ=e=>pJ(e,t=>iJ(e,t,!0)),kJ=e=>pJ(e,t=>iJ(e,t,!1)),AJ=e=>pJ(e,t=>iJ(e,t,!Vq(e))),jJ=e=>pJ(e,t=>iJ(e,t,Vq(e))),MJ=e=>pJ(e,t=>k.cursor(e.lineBlockAt(t.head).from)),NJ=e=>pJ(e,t=>k.cursor(e.lineBlockAt(t.head).to)),PJ=({state:e,dispatch:t})=>(t(Lq(e,{anchor:0})),!0),FJ=({state:e,dispatch:t})=>(t(Lq(e,{anchor:e.doc.length})),!0),IJ=({state:e,dispatch:t})=>(t(Lq(e,{anchor:e.selection.main.anchor,head:0})),!0),LJ=({state:e,dispatch:t})=>(t(Lq(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),RJ=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),zJ=({state:e,dispatch:t})=>{let n=iY(e).map(({from:t,to:n})=>k.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:k.create(n),userEvent:`select`})),!0},BJ=({state:e,dispatch:t})=>{let n=Iq(e.selection,t=>{let n=oe(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return k.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(Lq(e,n)),!0)};function VJ(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(Lq(n,k.create(i,i.length-1))),!0)}var HJ=e=>VJ(e,!1),UJ=e=>VJ(e,!0),WJ=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=k.create([n.main]):n.main.empty||(r=k.create([k.cursor(n.main.head)])),r?(t(Lq(e,r)),!0):!1};function GJ(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=KJ(e,o,!1)):o>i&&(n=`delete.forward`,o=KJ(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=KJ(e,i,!1),a=KJ(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:k.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?f.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function KJ(e,t,n){if(e instanceof f)for(let r of e.state.facet(f.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var qJ=(e,t,n)=>GJ(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=m(s,a.tabSize)%De(a)||De(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=h(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=h(o.text,c-o.from,!1,!1)+o.from);return c}),JJ=e=>qJ(e,!1,!0),YJ=e=>qJ(e,!0,!1),XJ=(e,t)=>GJ(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=h(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),ZJ=e=>XJ(e,!1),QJ=e=>XJ(e,!0),$J=e=>GJ(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),eY=e=>GJ(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),tY=e=>GJ(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),nY=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:s.of([``,``])},range:k.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},rY=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:h(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:h(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:k.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function iY(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function aY(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of iY(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(k.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(k.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:k.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var oY=({state:e,dispatch:t})=>aY(e,t,!1),sY=({state:e,dispatch:t})=>aY(e,t,!0);function cY(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of iY(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var lY=({state:e,dispatch:t})=>cY(e,t,!1),uY=({state:e,dispatch:t})=>cY(e,t,!0),dY=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(iY(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=Iq(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function fY(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=oe(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(p.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var pY=hY(!1),mY=hY(!0);function hY(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&fY(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let c=new fe(t,{simulateBreak:r,simulateDoubleBreak:!!o}),l=x(c,r);for(l??=m(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let u=[``,C(t,l)];return o&&u.push(C(t,c.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:s.of(u)},range:k.cursor(r+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function gY(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:k.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var _Y=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new fe(e,{overrideIndentation:e=>n[e]??-1}),i=gY(e,(t,i,a)=>{let o=x(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=C(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},vY=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(gY(e,(t,n)=>{n.push({from:t.from,insert:e.facet(c)})}),{userEvent:`input.indent`})),!0),yY=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(gY(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=m(r,e.tabSize),a=0,o=C(e,Math.max(0,i-De(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),bY=e=>(e.setTabFocusMode(),!0),xY=[{key:`Ctrl-b`,run:Hq,shift:hJ,preventDefault:!0},{key:`Ctrl-f`,run:Uq,shift:gJ},{key:`Ctrl-p`,run:Qq,shift:CJ},{key:`Ctrl-n`,run:$q,shift:wJ},{key:`Ctrl-a`,run:lJ,shift:MJ},{key:`Ctrl-e`,run:uJ,shift:NJ},{key:`Ctrl-d`,run:YJ},{key:`Ctrl-h`,run:JJ},{key:`Ctrl-k`,run:$J},{key:`Ctrl-Alt-h`,run:ZJ},{key:`Ctrl-o`,run:nY},{key:`Ctrl-t`,run:rY},{key:`Ctrl-v`,run:rJ}],SY=[{key:`ArrowLeft`,run:Hq,shift:hJ,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:Gq,shift:vJ,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:sJ,shift:AJ,preventDefault:!0},{key:`ArrowRight`,run:Uq,shift:gJ,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Kq,shift:yJ,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:cJ,shift:jJ,preventDefault:!0},{key:`ArrowUp`,run:Qq,shift:CJ,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:PJ,shift:IJ},{mac:`Ctrl-ArrowUp`,run:nJ,shift:EJ},{key:`ArrowDown`,run:$q,shift:wJ,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:FJ,shift:LJ},{mac:`Ctrl-ArrowDown`,run:rJ,shift:DJ},{key:`PageUp`,run:nJ,shift:EJ},{key:`PageDown`,run:rJ,shift:DJ},{key:`Home`,run:oJ,shift:kJ,preventDefault:!0},{key:`Mod-Home`,run:PJ,shift:IJ},{key:`End`,run:aJ,shift:OJ,preventDefault:!0},{key:`Mod-End`,run:FJ,shift:LJ},{key:`Enter`,run:pY,shift:pY},{key:`Mod-a`,run:RJ},{key:`Backspace`,run:JJ,shift:JJ,preventDefault:!0},{key:`Delete`,run:YJ,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:ZJ,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:QJ,preventDefault:!0},{mac:`Mod-Backspace`,run:eY,preventDefault:!0},{mac:`Mod-Delete`,run:tY,preventDefault:!0}].concat(xY.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),CY=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Yq,shift:bJ},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Xq,shift:xJ},{key:`Alt-ArrowUp`,run:oY},{key:`Shift-Alt-ArrowUp`,run:lY},{key:`Alt-ArrowDown`,run:sY},{key:`Shift-Alt-ArrowDown`,run:uY},{key:`Mod-Alt-ArrowUp`,run:HJ},{key:`Mod-Alt-ArrowDown`,run:UJ},{key:`Escape`,run:WJ},{key:`Mod-Enter`,run:mY},{key:`Alt-l`,mac:`Ctrl-l`,run:zJ},{key:`Mod-i`,run:BJ,preventDefault:!0},{key:`Mod-[`,run:yY},{key:`Mod-]`,run:vY},{key:`Mod-Alt-\\`,run:_Y},{key:`Shift-Mod-k`,run:dY},{key:`Shift-Mod-\\`,run:fJ},{key:`Mod-/`,run:eq},{key:`Alt-A`,run:rq},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:bY}].concat(SY),wY={key:`Tab`,run:vY,shift:yY};function TY(e,t,n,r){let i=Id(xO),a=Rd(uk),o=L.useRef(null),{lexicalNode:s}=eG(),c=L.useRef(!1),l=L.useRef(!1),u=L.useCallback(()=>{a({editorType:t,rootNode:s,editorRef:o.current})},[t,s,a]),d=L.useCallback(t=>{if(t.key===`ArrowDown`){let t=o.current?.getCodemirror()?.state;t&&t.doc.length===t.selection.ranges[0].to&&(c.current?(i?.update(()=>{var t;let n=C_(e);n.getNextSibling()?((t=o.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectNext()):n.insertAfter(Yg())}),c.current=!1):c.current=!0)}else if(t.key===`ArrowUp`){let t=o.current?.getCodemirror()?.state;t&&t.selection.ranges[0].from===0&&(l.current?(i?.update(()=>{var t;let n=C_(e);n.getPreviousSibling()&&((t=o.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectPrevious())}),l.current=!1):l.current=!0)}else t.key===`Enter`?t.stopPropagation():(t.key===`Backspace`||t.key===`Delete`)&&(o.current?.getCodemirror()?.state)?.doc.length===0&&i?.update(()=>{C_(e).remove()})},[i,e]);return L.useEffect(()=>{let e=o.current;return setTimeout(()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.addEventListener(`focus`,u),(n=e?.getCodemirror())==null||n.contentDOM.addEventListener(`keydown`,d)},300),()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.removeEventListener(`focus`,u),(n=e?.getCodemirror())==null||n.contentDOM.removeEventListener(`keydown`,d)}},[o,u,d,n]),L.useEffect(()=>{r.subscribe(()=>{var e;(e=o.current?.getCodemirror())==null||e.focus(),u()})},[r,o,e,u]),o}function Q(e){return new me(N.define(e))}function EY(e){return Z(()=>import(`./dist-nFui3f-r.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2]))}var DY=[A.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return Z(()=>import(`./dist-C5YJOwhH.js`).then(e=>e.cpp()),__vite__mapDeps([3,1,2]))}}),A.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return Z(()=>import(`./dist-C5YJOwhH.js`).then(e=>e.cpp()),__vite__mapDeps([3,1,2]))}}),A.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return EY(`Cassandra`)}}),A.of({name:`CSS`,extensions:[`css`],load(){return Z(()=>import(`./dist-CKM5j-iy.js`).then(e=>e.i).then(e=>e.css()),__vite__mapDeps([4,5,1,2]))}}),A.of({name:`Go`,extensions:[`go`],load(){return Z(()=>import(`./dist-_oM7g0eh.js`).then(e=>e.go()),__vite__mapDeps([6,1,2]))}}),A.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return Z(()=>import(`./dist-laadbMWg.js`).then(e=>e.html()),__vite__mapDeps([7,4,5,1,2,8]))}}),A.of({name:`Java`,extensions:[`java`],load(){return Z(()=>import(`./dist--55mTWk3.js`).then(e=>e.java()),__vite__mapDeps([9,1,2]))}}),A.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return Z(()=>import(`./dist-CG_gRSwv.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,5,1,2]))}}),A.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return Z(()=>import(`./dist-B5rcjVCj.js`).then(e=>e.jinja()),__vite__mapDeps([10,7,4,5,1,2,8]))}}),A.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return Z(()=>import(`./dist-BZ39rB1W.js`).then(e=>e.json()),__vite__mapDeps([11,1,2]))}}),A.of({name:`JSX`,extensions:[`jsx`],load(){return Z(()=>import(`./dist-CG_gRSwv.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([8,5,1,2]))}}),A.of({name:`LESS`,extensions:[`less`],load(){return Z(()=>import(`./dist-C5oXtFSP.js`).then(e=>e.less()),__vite__mapDeps([12,4,5,1,2]))}}),A.of({name:`Liquid`,extensions:[`liquid`],load(){return Z(()=>import(`./dist-BPv5MdlL.js`).then(e=>e.liquid()),__vite__mapDeps([13,7,4,5,1,2,8]))}}),A.of({name:`MariaDB SQL`,load(){return EY(`MariaSQL`)}}),A.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return Z(()=>import(`./dist-D4HhiFWB.js`).then(e=>e.markdown()),__vite__mapDeps([14,7,4,5,1,2,8]))}}),A.of({name:`MS SQL`,load(){return EY(`MSSQL`)}}),A.of({name:`MySQL`,load(){return EY(`MySQL`)}}),A.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return Z(()=>import(`./dist-_DPv0-QF.js`).then(e=>e.php()),__vite__mapDeps([15,7,4,5,1,2,8]))}}),A.of({name:`PLSQL`,extensions:[`pls`],load(){return EY(`PLSQL`)}}),A.of({name:`PostgreSQL`,load(){return EY(`PostgreSQL`)}}),A.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return Z(()=>import(`./dist-BvO6SpaM.js`).then(e=>e.python()),__vite__mapDeps([16,1,2]))}}),A.of({name:`Rust`,extensions:[`rs`],load(){return Z(()=>import(`./dist-CUp9us2q.js`).then(e=>e.rust()),__vite__mapDeps([17,1,2]))}}),A.of({name:`Sass`,extensions:[`sass`],load(){return Z(()=>import(`./dist-DSKQpPaz.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([18,4,5,1,2]))}}),A.of({name:`SCSS`,extensions:[`scss`],load(){return Z(()=>import(`./dist-DSKQpPaz.js`).then(e=>e.sass()),__vite__mapDeps([18,4,5,1,2]))}}),A.of({name:`SQL`,extensions:[`sql`],load(){return EY(`StandardSQL`)}}),A.of({name:`SQLite`,load(){return EY(`SQLite`)}}),A.of({name:`TSX`,extensions:[`tsx`],load(){return Z(()=>import(`./dist-CG_gRSwv.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([8,5,1,2]))}}),A.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return Z(()=>import(`./dist-CG_gRSwv.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,5,1,2]))}}),A.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return Z(()=>import(`./dist-CZ9T4Cly.js`).then(e=>e.wast()),__vite__mapDeps([19,1,2]))}}),A.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return Z(()=>import(`./dist-Zqt9kNG9.js`).then(e=>e.xml()),__vite__mapDeps([20,1,2]))}}),A.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return Z(()=>import(`./dist-BsedZGJo.js`).then(e=>e.yaml()),__vite__mapDeps([21,1,2]))}}),A.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return Z(()=>import(`./apl-BxEMbctQ.js`).then(e=>Q(e.apl)),[])}}),A.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return Z(()=>import(`./asciiarmor-eFjeGRuZ.js`).then(e=>Q(e.asciiArmor)),[])}}),A.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return Z(()=>import(`./asn1-Cfx-0pt9.js`).then(e=>Q(e.asn1({}))),[])}}),A.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return Z(()=>import(`./asterisk-B5BHTsBr.js`).then(e=>Q(e.asterisk)),[])}}),A.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return Z(()=>import(`./brainfuck-CAA2xofr.js`).then(e=>Q(e.brainfuck)),[])}}),A.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return Z(()=>import(`./cobol-BfgHZgup.js`).then(e=>Q(e.cobol)),[])}}),A.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.csharp)),[])}}),A.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return Z(()=>import(`./clojure-kVFSWX0o.js`).then(e=>Q(e.clojure)),[])}}),A.of({name:`ClojureScript`,extensions:[`cljs`],load(){return Z(()=>import(`./clojure-kVFSWX0o.js`).then(e=>Q(e.clojure)),[])}}),A.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return Z(()=>import(`./css-BqOeyZOV.js`).then(e=>Q(e.gss)),[])}}),A.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return Z(()=>import(`./cmake-BUPAhezI.js`).then(e=>Q(e.cmake)),[])}}),A.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return Z(()=>import(`./coffeescript-G1Pe_1AZ.js`).then(e=>Q(e.coffeeScript)),[])}}),A.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return Z(()=>import(`./commonlisp-B3N0CjHn.js`).then(e=>Q(e.commonLisp)),[])}}),A.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return Z(()=>import(`./cypher-KjIKv-wW.js`).then(e=>Q(e.cypher)),[])}}),A.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return Z(()=>import(`./python-C2_X1GpX.js`).then(e=>Q(e.cython)),[])}}),A.of({name:`Crystal`,extensions:[`cr`],load(){return Z(()=>import(`./crystal-C15ndaGM.js`).then(e=>Q(e.crystal)),[])}}),A.of({name:`D`,extensions:[`d`],load(){return Z(()=>import(`./d-BlT5AEC-.js`).then(e=>Q(e.d)),[])}}),A.of({name:`Dart`,extensions:[`dart`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.dart)),[])}}),A.of({name:`diff`,extensions:[`diff`,`patch`],load(){return Z(()=>import(`./diff-oF98tbqj.js`).then(e=>Q(e.diff)),[])}}),A.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return Z(()=>import(`./dockerfile-CUaqzcqp.js`).then(e=>Q(e.dockerFile)),__vite__mapDeps([22,23]))}}),A.of({name:`DTD`,extensions:[`dtd`],load(){return Z(()=>import(`./dtd-VCA9yr61.js`).then(e=>Q(e.dtd)),[])}}),A.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return Z(()=>import(`./dylan-O-V5Dw5W.js`).then(e=>Q(e.dylan)),[])}}),A.of({name:`EBNF`,load(){return Z(()=>import(`./ebnf-SPmdBkvT.js`).then(e=>Q(e.ebnf)),[])}}),A.of({name:`ECL`,extensions:[`ecl`],load(){return Z(()=>import(`./ecl-ChfCttfI.js`).then(e=>Q(e.ecl)),[])}}),A.of({name:`edn`,extensions:[`edn`],load(){return Z(()=>import(`./clojure-kVFSWX0o.js`).then(e=>Q(e.clojure)),[])}}),A.of({name:`Eiffel`,extensions:[`e`],load(){return Z(()=>import(`./eiffel-cB9EbjeN.js`).then(e=>Q(e.eiffel)),[])}}),A.of({name:`Elm`,extensions:[`elm`],load(){return Z(()=>import(`./elm-BTiVflBU.js`).then(e=>Q(e.elm)),[])}}),A.of({name:`Erlang`,extensions:[`erl`],load(){return Z(()=>import(`./erlang-egf0TXFm.js`).then(e=>Q(e.erlang)),[])}}),A.of({name:`Esper`,load(){return Z(()=>import(`./sql-D_dieYbr.js`).then(e=>Q(e.esper)),[])}}),A.of({name:`Factor`,extensions:[`factor`],load(){return Z(()=>import(`./factor-C2tAxNob.js`).then(e=>Q(e.factor)),__vite__mapDeps([24,23]))}}),A.of({name:`FCL`,load(){return Z(()=>import(`./fcl-BiCjh1tj.js`).then(e=>Q(e.fcl)),[])}}),A.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return Z(()=>import(`./forth-C4kDGW6u.js`).then(e=>Q(e.forth)),[])}}),A.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return Z(()=>import(`./fortran-DzkLaPnd.js`).then(e=>Q(e.fortran)),[])}}),A.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return Z(()=>import(`./mllike-wTFlPWXS.js`).then(e=>Q(e.fSharp)),[])}}),A.of({name:`Gas`,extensions:[`s`],load(){return Z(()=>import(`./gas-DMOxskQF.js`).then(e=>Q(e.gas)),[])}}),A.of({name:`Gherkin`,extensions:[`feature`],load(){return Z(()=>import(`./gherkin-BPxBpp-k.js`).then(e=>Q(e.gherkin)),[])}}),A.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return Z(()=>import(`./groovy-CkEnc0ZY.js`).then(e=>Q(e.groovy)),[])}}),A.of({name:`Haskell`,extensions:[`hs`],load(){return Z(()=>import(`./haskell-Dadpo9-w.js`).then(e=>Q(e.haskell)),[])}}),A.of({name:`Haxe`,extensions:[`hx`],load(){return Z(()=>import(`./haxe-CDNZL9MW.js`).then(e=>Q(e.haxe)),[])}}),A.of({name:`HXML`,extensions:[`hxml`],load(){return Z(()=>import(`./haxe-CDNZL9MW.js`).then(e=>Q(e.hxml)),[])}}),A.of({name:`HTTP`,load(){return Z(()=>import(`./http-jy9Zxxt3.js`).then(e=>Q(e.http)),[])}}),A.of({name:`IDL`,extensions:[`pro`],load(){return Z(()=>import(`./idl-CGSB6iiy.js`).then(e=>Q(e.idl)),[])}}),A.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return Z(()=>import(`./javascript-DSlzRUd8.js`).then(e=>Q(e.jsonld)),[])}}),A.of({name:`Julia`,extensions:[`jl`],load(){return Z(()=>import(`./julia-DTiF9v6R.js`).then(e=>Q(e.julia)),[])}}),A.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.kotlin)),[])}}),A.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return Z(()=>import(`./livescript-Ci8Xxna6.js`).then(e=>Q(e.liveScript)),[])}}),A.of({name:`Lua`,extensions:[`lua`],load(){return Z(()=>import(`./lua-eVxIrt9t.js`).then(e=>Q(e.lua)),[])}}),A.of({name:`mIRC`,extensions:[`mrc`],load(){return Z(()=>import(`./mirc-CtHu9S1B.js`).then(e=>Q(e.mirc)),[])}}),A.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return Z(()=>import(`./mathematica-Da3grj36.js`).then(e=>Q(e.mathematica)),[])}}),A.of({name:`Modelica`,extensions:[`mo`],load(){return Z(()=>import(`./modelica-cKbQ0UXu.js`).then(e=>Q(e.modelica)),[])}}),A.of({name:`MUMPS`,extensions:[`mps`],load(){return Z(()=>import(`./mumps-CKBHkOQq.js`).then(e=>Q(e.mumps)),[])}}),A.of({name:`Mbox`,extensions:[`mbox`],load(){return Z(()=>import(`./mbox-BWBMSafM.js`).then(e=>Q(e.mbox)),[])}}),A.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return Z(()=>import(`./nginx-B00AiQel.js`).then(e=>Q(e.nginx)),[])}}),A.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return Z(()=>import(`./nsis-SMDwKltR.js`).then(e=>Q(e.nsis)),__vite__mapDeps([25,23]))}}),A.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return Z(()=>import(`./ntriples-B_36EBV0.js`).then(e=>Q(e.ntriples)),[])}}),A.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.objectiveC)),[])}}),A.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.objectiveCpp)),[])}}),A.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return Z(()=>import(`./mllike-wTFlPWXS.js`).then(e=>Q(e.oCaml)),[])}}),A.of({name:`Octave`,extensions:[`m`],load(){return Z(()=>import(`./octave-BXPjzAif.js`).then(e=>Q(e.octave)),[])}}),A.of({name:`Oz`,extensions:[`oz`],load(){return Z(()=>import(`./oz-Dedpat1M.js`).then(e=>Q(e.oz)),[])}}),A.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return Z(()=>import(`./pascal-CMcUg72K.js`).then(e=>Q(e.pascal)),[])}}),A.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return Z(()=>import(`./perl-DoVTbnzt.js`).then(e=>Q(e.perl)),[])}}),A.of({name:`Pig`,extensions:[`pig`],load(){return Z(()=>import(`./pig-CULXT1YV.js`).then(e=>Q(e.pig)),[])}}),A.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return Z(()=>import(`./powershell-Cv5Uhf6b.js`).then(e=>Q(e.powerShell)),[])}}),A.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return Z(()=>import(`./properties-CQ1C2P-M.js`).then(e=>Q(e.properties)),[])}}),A.of({name:`ProtoBuf`,extensions:[`proto`],load(){return Z(()=>import(`./protobuf-SRlvzrl6.js`).then(e=>Q(e.protobuf)),[])}}),A.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return Z(()=>import(`./pug-Bo3wfL-f.js`).then(e=>Q(e.pug)),__vite__mapDeps([26,27]))}}),A.of({name:`Puppet`,extensions:[`pp`],load(){return Z(()=>import(`./puppet-ClSqCGj6.js`).then(e=>Q(e.puppet)),[])}}),A.of({name:`Q`,extensions:[`q`],load(){return Z(()=>import(`./q-B_6Gdyzl.js`).then(e=>Q(e.q)),[])}}),A.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return Z(()=>import(`./r-BD07NGED.js`).then(e=>Q(e.r)),[])}}),A.of({name:`RPM Changes`,load(){return Z(()=>import(`./rpm-CRu5Z2Jl.js`).then(e=>Q(e.rpmChanges)),[])}}),A.of({name:`RPM Spec`,extensions:[`spec`],load(){return Z(()=>import(`./rpm-CRu5Z2Jl.js`).then(e=>Q(e.rpmSpec)),[])}}),A.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return Z(()=>import(`./ruby-dZPnOz8h.js`).then(e=>Q(e.ruby)),[])}}),A.of({name:`SAS`,extensions:[`sas`],load(){return Z(()=>import(`./sas-S2t8_sDI.js`).then(e=>Q(e.sas)),[])}}),A.of({name:`Scala`,extensions:[`scala`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.scala)),[])}}),A.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return Z(()=>import(`./scheme-WcyFWLW2.js`).then(e=>Q(e.scheme)),[])}}),A.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return Z(()=>import(`./shell-DUelnYSh.js`).then(e=>Q(e.shell)),[])}}),A.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return Z(()=>import(`./sieve-jDjlVhNh.js`).then(e=>Q(e.sieve)),[])}}),A.of({name:`Smalltalk`,extensions:[`st`],load(){return Z(()=>import(`./smalltalk-ddWDYy10.js`).then(e=>Q(e.smalltalk)),[])}}),A.of({name:`Solr`,load(){return Z(()=>import(`./solr-C7rQhLuW.js`).then(e=>Q(e.solr)),[])}}),A.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return Z(()=>import(`./mllike-wTFlPWXS.js`).then(e=>Q(e.sml)),[])}}),A.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return Z(()=>import(`./sparql--fPCCgVd.js`).then(e=>Q(e.sparql)),[])}}),A.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return Z(()=>import(`./spreadsheet-DjthqD5G.js`).then(e=>Q(e.spreadsheet)),[])}}),A.of({name:`Squirrel`,extensions:[`nut`],load(){return Z(()=>import(`./clike-BoDCOLzN.js`).then(e=>Q(e.squirrel)),[])}}),A.of({name:`Stylus`,extensions:[`styl`],load(){return Z(()=>import(`./stylus-DxF70RNr.js`).then(e=>Q(e.stylus)),[])}}),A.of({name:`Swift`,extensions:[`swift`],load(){return Z(()=>import(`./swift-T0hDoOb-.js`).then(e=>Q(e.swift)),[])}}),A.of({name:`sTeX`,load(){return Z(()=>import(`./stex-rHcFYcA0.js`).then(e=>Q(e.stex)),[])}}),A.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return Z(()=>import(`./stex-rHcFYcA0.js`).then(e=>Q(e.stex)),[])}}),A.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return Z(()=>import(`./verilog-BJOO83gk.js`).then(e=>Q(e.verilog)),[])}}),A.of({name:`Tcl`,extensions:[`tcl`],load(){return Z(()=>import(`./tcl-Dlzy1mPk.js`).then(e=>Q(e.tcl)),[])}}),A.of({name:`Textile`,extensions:[`textile`],load(){return Z(()=>import(`./textile-Dy5rFZe5.js`).then(e=>Q(e.textile)),[])}}),A.of({name:`TiddlyWiki`,load(){return Z(()=>import(`./tiddlywiki-DQP1OymS.js`).then(e=>Q(e.tiddlyWiki)),[])}}),A.of({name:`Tiki wiki`,load(){return Z(()=>import(`./tiki-0vOj3DB2.js`).then(e=>Q(e.tiki)),[])}}),A.of({name:`TOML`,extensions:[`toml`],load(){return Z(()=>import(`./toml-DEltN0lI.js`).then(e=>Q(e.toml)),[])}}),A.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return Z(()=>import(`./troff-CRbBpEqY.js`).then(e=>Q(e.troff)),[])}}),A.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return Z(()=>import(`./ttcn-M5q1nLKg.js`).then(e=>Q(e.ttcn)),[])}}),A.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return Z(()=>import(`./ttcn-cfg-Rmw9NWq9.js`).then(e=>Q(e.ttcnCfg)),[])}}),A.of({name:`Turtle`,extensions:[`ttl`],load(){return Z(()=>import(`./turtle-BCDWhJK0.js`).then(e=>Q(e.turtle)),[])}}),A.of({name:`Web IDL`,extensions:[`webidl`],load(){return Z(()=>import(`./webidl-Ddy6hbV6.js`).then(e=>Q(e.webIDL)),[])}}),A.of({name:`VB.NET`,extensions:[`vb`],load(){return Z(()=>import(`./vb-QQ7LGlOz.js`).then(e=>Q(e.vb)),[])}}),A.of({name:`VBScript`,extensions:[`vbs`],load(){return Z(()=>import(`./vbscript-BiSEdUzz.js`).then(e=>Q(e.vbScript)),[])}}),A.of({name:`Velocity`,extensions:[`vtl`],load(){return Z(()=>import(`./velocity-CzMg5_6w.js`).then(e=>Q(e.velocity)),[])}}),A.of({name:`Verilog`,extensions:[`v`],load(){return Z(()=>import(`./verilog-BJOO83gk.js`).then(e=>Q(e.verilog)),[])}}),A.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return Z(()=>import(`./vhdl-ed4zAZAA.js`).then(e=>Q(e.vhdl)),[])}}),A.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return Z(()=>import(`./xquery-Bw1zwhh6.js`).then(e=>Q(e.xQuery)),[])}}),A.of({name:`Yacas`,extensions:[`ys`],load(){return Z(()=>import(`./yacas-DZdTXy3s.js`).then(e=>Q(e.yacas)),[])}}),A.of({name:`Z80`,extensions:[`z80`],load(){return Z(()=>import(`./z80-DMG02_YV.js`).then(e=>Q(e.z80)),[])}}),A.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return Z(()=>import(`./mscgen-C5pXQCMK.js`).then(e=>Q(e.mscgen)),[])}}),A.of({name:`Xù`,extensions:[`xu`],load(){return Z(()=>import(`./mscgen-C5pXQCMK.js`).then(e=>Q(e.xu)),[])}}),A.of({name:`MsGenny`,extensions:[`msgenny`],load(){return Z(()=>import(`./mscgen-C5pXQCMK.js`).then(e=>Q(e.msgenny)),[])}}),A.of({name:`Vue`,extensions:[`vue`],load(){return Z(()=>import(`./dist-L1B-KWZO.js`).then(e=>e.vue()),__vite__mapDeps([28,7,4,5,1,2,8]))}}),A.of({name:`Angular Template`,load(){return Z(()=>import(`./dist-DHE-yBLH.js`).then(e=>e.angular()),__vite__mapDeps([29,7,4,5,1,2,8]))}})],OY=`#2e3440`,kY=`#3b4252`,AY=`#434c5e`,jY=`#4c566a`,MY=`#e5e9f0`,NY=`#eceff4`,PY=`#8fbcbb`,FY=`#88c0d0`,IY=`#81a1c1`,LY=`#5e81ac`,RY=`#bf616a`,zY=`#d08770`,BY=`#ebcb8b`,VY=`#a3be8c`,HY=`#b48ead`,UY=`#d30102`,WY=NY,GY=WY,KY=`#ffffff`,qY=kY,JY=WY,YY=kY,XY=[f.theme({"&":{color:OY,backgroundColor:KY},".cm-content":{caretColor:YY},".cm-cursor, .cm-dropCursor":{borderLeftColor:YY},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:JY},".cm-panels":{backgroundColor:WY,color:jY},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid ${jY}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:MY},".cm-activeLine":{backgroundColor:GY},".cm-selectionMatch":{backgroundColor:MY},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${jY}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:NY},".cm-gutters":{backgroundColor:NY,color:OY,border:`none`},".cm-activeLineGutter":{backgroundColor:GY},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:qY},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:qY,borderBottomColor:qY},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:GY,color:jY}}},{dark:!1}),i(be.define([{tag:v.keyword,color:LY},{tag:[v.name,v.deleted,v.character,v.propertyName,v.macroName],color:zY},{tag:[v.variableName],color:zY},{tag:[v.function(v.variableName)],color:LY},{tag:[v.labelName],color:IY},{tag:[v.color,v.constant(v.name),v.standard(v.name)],color:LY},{tag:[v.definition(v.name),v.separator],color:VY},{tag:[v.brace],color:PY},{tag:[v.annotation],color:UY},{tag:[v.number,v.changed,v.annotation,v.modifier,v.self,v.namespace],color:FY},{tag:[v.typeName,v.className],color:BY},{tag:[v.operator,v.operatorKeyword],color:VY},{tag:[v.tagName],color:HY},{tag:[v.squareBracket],color:RY},{tag:[v.angleBracket],color:zY},{tag:[v.attributeName],color:BY},{tag:[v.regexp],color:LY},{tag:[v.quote],color:kY},{tag:[v.string],color:zY},{tag:v.link,color:PY,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[v.url,v.escape,v.special(v.string)],color:zY},{tag:[v.meta],color:FY},{tag:[v.comment],color:AY,fontStyle:`italic`},{tag:v.strong,fontWeight:`bold`,color:LY},{tag:v.emphasis,fontStyle:`italic`,color:LY},{tag:v.strikethrough,textDecoration:`line-through`},{tag:v.heading,fontWeight:`bold`,color:LY},{tag:v.special(v.heading1),fontWeight:`bold`,color:LY},{tag:v.heading1,fontWeight:`bold`,color:LY},{tag:[v.heading2,v.heading3,v.heading4],fontWeight:`bold`,color:LY},{tag:[v.heading5,v.heading6],color:LY},{tag:[v.atom,v.bool,v.special(v.variableName)],color:zY},{tag:[v.processingInstruction,v.inserted],color:PY},{tag:[v.contentSeparator],color:BY},{tag:v.invalid,color:AY,borderBottom:`1px dotted ${UY}`}]))],ZY=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,QY=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(ZY(e)):ZY,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ce(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=y(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=a(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(QY.prototype[Symbol.iterator]=function(){return this});var $Y={from:-1,to:-1,match:/.*/.exec(``),precise:!0},eX=`gm`+(/x/.unicode==null?``:`u`),tX=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=$Y,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new iX(e,t,n,r,i);this.re=new RegExp(t,eX+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=oX(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=oX(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},nX=new WeakMap,rX=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=nX.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return nX.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),nX.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},iX=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=$Y,this.matchPos=oX(e,r),this.re=new RegExp(t,eX+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=rX.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=oX(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=rX.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(tX.prototype[Symbol.iterator]=iX.prototype[Symbol.iterator]=function(){return this});function aX(e){try{return new RegExp(e,eX),!0}catch{return!1}}function oX(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var sX=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=ue(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),m=k.cursor(p.from+Math.max(0,Math.min(u,p.length)));e.dispatch({effects:[r,f.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},cX={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},lX=ke.define({combine(e){return se(e,cX,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function uX(e){let t=[gX,hX];return e&&t.push(lX.of(e)),t}var dX=T.mark({class:`cm-selectionMatch`}),fX=T.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function pX(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=I.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=I.Word)}function mX(e,t,n,r){return e(t.sliceDoc(n,n+1))==I.Word&&e(t.sliceDoc(r-1,r))==I.Word}var hX=_e.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(lX),{state:n}=e,r=n.selection;if(r.ranges.length>1)return T.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return T.none;let e=n.wordAt(i.head);if(!e)return T.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return T.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(pX(o,n,i.from,i.to)&&mX(o,n,i.from,i.to)))return T.none}else if(a=n.sliceDoc(i.from,i.to),!a)return T.none}let s=[];for(let r of e.visibleRanges){let e=new QY(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||pX(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(fX.range(r,a)):(r>=i.to||a<=i.from)&&s.push(dX.range(r,a)),s.length>t.maxMatches))return T.none}}return T.set(s)}},{decorations:e=>e.decorations}),gX=f.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),_X=({state:e,dispatch:t})=>{let{selection:n}=e,r=k.create(n.ranges.map(t=>e.wordAt(t.head)||k.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function vX(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new QY(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new QY(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var yX=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return _X({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=vX(e,r);return i?(t(e.update({selection:e.selection.addRange(k.range(i.from,i.to),!1),effects:f.scrollIntoView(i.to)})),!0):!1},bX=ke.define({combine(e){return se(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new eZ(e),scrollToMatch:e=>f.scrollIntoView(e)})}}),xX=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||aX(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
128
|
+
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new MX(this):new EX(this)}getCursor(e,t=0,n){let r=e.doc?e:we.create({doc:e});return n??=r.doc.length,this.regexp?OX(this,r,t,n):wX(this,r,t,n)}},SX=class{constructor(e){this.spec=e}};function CX(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function wX(e,t,n,r){let i;return e.wholeWord&&(i=TX(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=CX(e.test,t,i)),new QY(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function TX(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(kX(i,n-a))!=I.Word||t(AX(i,n-a))!=I.Word)&&(t(AX(i,r-a))!=I.Word||t(kX(i,r-a))!=I.Word))}var EX=class extends SX{constructor(e){super(e)}nextMatch(e,t,n){let r=wX(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=wX(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=wX(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=wX(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=wX(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function DX(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function OX(e,t,n,r){let i;return e.wholeWord&&(i=jX(t.charCategorizer(t.selection.main.head))),e.test&&(i=DX(e.test,t,i)),new tX(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function kX(e,t){return e.slice(h(e,t,!1),t)}function AX(e,t){return e.slice(t,h(e,t))}function jX(e){return(t,n,r)=>!r[0].length||(e(kX(r.input,r.index))!=I.Word||e(AX(r.input,r.index))!=I.Word)&&(e(AX(r.input,r.index+r[0].length))!=I.Word||e(kX(r.input,r.index+r[0].length))!=I.Word)}var MX=class extends SX{nextMatch(e,t,n){let r=OX(this.spec,e,n,e.doc.length).next();return r.done&&(r=OX(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=OX(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=OX(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=OX(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},NX=w.define(),PX=w.define(),FX=l.define({create(e){return new IX(JX(e).create(),null)},update(e,t){for(let n of t.effects)n.is(NX)?e=new IX(n.value.create(),e.panel):n.is(PX)&&(e=new IX(e.query,n.value?qX:null));return e},provide:e=>Se.from(e,e=>e.panel)}),IX=class{constructor(e,t){this.query=e,this.panel=t}},LX=T.mark({class:`cm-searchMatch`}),RX=T.mark({class:`cm-searchMatch cm-searchMatch-selected`}),zX=_e.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(FX))}update(e){let t=e.state.field(FX);(t!=e.startState.field(FX)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return T.none;let{view:n}=this,r=new o;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?RX:LX)})}return r.finish()}},{decorations:e=>e.decorations});function BX(e){return t=>{let n=t.state.field(FX,!1);return n&&n.query.spec.valid?e(t,n):ZX(t)}}var VX=BX((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=k.single(r.from,r.to),a=e.state.facet(bX);return e.dispatch({selection:i,effects:[iZ(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),XX(e),!0}),HX=BX((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=k.single(i.from,i.to),o=e.state.facet(bX);return e.dispatch({selection:a,effects:[iZ(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),XX(e),!0}),UX=BX((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:k.create(n.map(e=>k.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),WX=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new QY(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(k.range(t.value.from,t.value.to))}return t(e.update({selection:k.create(a,o),userEvent:`select.search.matches`})),!0},GX=BX((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),u.push(f.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=k.single(o.from,o.to).map(d),u.push(iZ(e,o)),u.push(n.facet(bX).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),KX=BX((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:f.announce.of(r),userEvent:`input.replace.all`}),!0});function qX(e){return e.state.facet(bX).createPanel(e)}function JX(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(bX);return new xX({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function YX(e){let t=b(e,qX);return t&&t.dom.querySelector(`[main-field]`)}function XX(e){let t=YX(e);t&&t==e.root.activeElement&&t.select()}var ZX=e=>{let t=e.state.field(FX,!1);if(t&&t.panel){let n=YX(e);if(n&&n!=e.root.activeElement){let r=JX(e.state,t.query.spec);r.valid&&e.dispatch({effects:NX.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[PX.of(!0),t?NX.of(JX(e.state,t.query.spec)):w.appendConfig.of(oZ)]});return!0},QX=e=>{let t=e.state.field(FX,!1);if(!t||!t.panel)return!1;let n=b(e,qX);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:PX.of(!1)}),!0},$X=[{key:`Mod-f`,run:ZX,scope:`editor search-panel`},{key:`F3`,run:VX,shift:HX,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:VX,shift:HX,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:QX,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:WX},{key:`Mod-Alt-g`,run:sX},{key:`Mod-d`,run:yX,preventDefault:!0}],eZ=class{constructor(e){this.view=e;let t=this.query=e.state.field(FX).query.spec;this.commit=this.commit.bind(this),this.searchField=ne(`input`,{value:t.search,placeholder:tZ(e,`Find`),"aria-label":tZ(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=ne(`input`,{value:t.replace,placeholder:tZ(e,`Replace`),"aria-label":tZ(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=ne(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=ne(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=ne(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return ne(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=ne(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>VX(e),[tZ(e,`next`)]),n(`prev`,()=>HX(e),[tZ(e,`previous`)]),n(`select`,()=>UX(e),[tZ(e,`all`)]),ne(`label`,null,[this.caseField,tZ(e,`match case`)]),ne(`label`,null,[this.reField,tZ(e,`regexp`)]),ne(`label`,null,[this.wordField,tZ(e,`by word`)]),...e.state.readOnly?[]:[ne(`br`),this.replaceField,n(`replace`,()=>GX(e),[tZ(e,`replace`)]),n(`replaceAll`,()=>KX(e),[tZ(e,`replace all`)])],ne(`button`,{name:`close`,onclick:()=>QX(e),"aria-label":tZ(e,`close`),type:`button`},[`×`])])}commit(){let e=new xX({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:NX.of(e)}))}keydown(e){P(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?HX:VX)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),GX(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(NX)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(bX).top}};function tZ(e,t){return e.state.phrase(t)}var nZ=30,rZ=/[\s\.,:;?!]/;function iZ(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-nZ),o=Math.min(i,n+nZ),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<nZ;e++)if(!rZ.test(s[e+1])&&rZ.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-nZ;e--)if(!rZ.test(s[e-1])&&rZ.test(s[e])){s=s.slice(0,e);break}}return f.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var aZ=f.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),oZ=[FX,Oe.low(zX),aZ],sZ=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},cZ=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(SZ).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),s=new o,c=[],l=0,u=r.doc.iter(),d=0,f=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!c.length)break;let n,r;if(c.length)n=l,r=c.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>f)break;r=t.to,c.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))c.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,f);let i=!1;if(c.some(e=>e.from==n&&(e.to==r||r==f))&&(i=n==r,!i&&r-n<10)){let e=n-(d+u.value.length);e>0&&(u.next(e),d=n);for(let e=n;;){if(e>=r){i=!0;break}if(!u.lineBreak&&d+u.value.length>e)break;e=d+u.value.length,d+=u.value.length,u.next()}}let o=NZ(c);if(i)s.add(n,n,T.widget({widget:new EZ(o),diagnostics:c.slice()}));else{let e=c.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);s.add(n,r,T.mark({class:`cm-lintRange cm-lintRange-`+o+e,diagnostics:c.slice(),inclusiveEnd:c.some(e=>e.to>r)}))}if(l=r,l==f)break;for(let e=0;e<c.length;e++)c[e].to<=l&&c.splice(e--,1)}let p=s.finish();return new e(p,n,lZ(p))}};function lZ(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new sZ(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new sZ(r.from,n,r.diagnostic)}),r}function uZ(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(SZ).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(fZ))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function dZ(e,t){return e.field(hZ,!1)?t:t.concat(w.appendConfig.of(PZ))}var fZ=w.define(),pZ=w.define(),mZ=w.define(),hZ=l.define({create(){return new cZ(T.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=lZ(n,e.selected.diagnostic,i)||lZ(n,null,i)}!n.size&&i&&t.state.facet(SZ).autoPanel&&(i=null),e=new cZ(n,i,r)}for(let n of t.effects)if(n.is(fZ)){let r=t.state.facet(SZ).autoPanel?n.value.length?OZ.open:null:e.panel;e=cZ.init(n.value,r,t.state)}else n.is(pZ)?e=new cZ(e.diagnostics,n.value?OZ.open:null,e.selected):n.is(mZ)&&(e=new cZ(e.diagnostics,e.panel,n.value));return e},provide:e=>[Se.from(e,e=>e.panel),f.decorations.from(e,e=>e.diagnostics)]}),gZ=T.mark({class:`cm-lintRange cm-lintRange-active`});function _Z(e,t,n){let{diagnostics:r}=e.state.field(hZ),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(SZ).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:vZ(e,i)}}}:null}function vZ(e,t){return ne(`ul`,{class:`cm-tooltip-lint`},t.map(t=>TZ(e,t,!1)))}var yZ=e=>{let t=e.state.field(hZ,!1);(!t||!t.panel)&&e.dispatch({effects:dZ(e.state,[pZ.of(!0)])});let n=b(e,OZ.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},bZ=e=>{let t=e.state.field(hZ,!1);return!t||!t.panel?!1:(e.dispatch({effects:pZ.of(!1)}),!0)},xZ=[{key:`Mod-Shift-m`,run:yZ,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(hZ,!1);if(!t)return!1;let n=e.state.selection.main,r=lZ(t.diagnostics,null,n.to+1);return!r&&(r=lZ(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],SZ=ke.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...se(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:CZ,tooltipFilter:CZ,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function CZ(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function wZ(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function TZ(e,t,n){let r=n?wZ(t.actions):[];return ne(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},ne(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=lZ(e.state.field(hZ).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),ne(`u`,s.slice(c,c+1)),s.slice(c+1)];return ne(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&ne(`div`,{class:`cm-diagnosticSource`},t.source))}var EZ=class extends d{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return ne(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},DZ=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=TZ(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},OZ=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)bZ(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=wZ(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=lZ(this.view.state.field(hZ).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=ne(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=ne(`div`,{class:`cm-panel-lint`},this.list,ne(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>bZ(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(hZ).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(hZ),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new DZ(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new DZ(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=lZ(this.view.state.field(hZ).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:mZ.of(t)})}static open(t){return new e(t)}};function kZ(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function AZ(e){return kZ(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var jZ=f.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:AZ(`#d11`)},".cm-lintRange-warning":{backgroundImage:AZ(`orange`)},".cm-lintRange-info":{backgroundImage:AZ(`#999`)},".cm-lintRange-hint":{backgroundImage:AZ(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function MZ(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function NZ(e){let t=`hint`,n=1;for(let r of e){let e=MZ(r.severity);e>n&&(n=e,t=r.severity)}return t}var PZ=[hZ,f.decorations.compute([hZ],e=>{let{selected:t,panel:n}=e.field(hZ);return!t||!n||t.from==t.to?T.none:T.set([gZ.range(t.from,t.to)])}),ve(_Z,{hideOn:uZ}),jZ],FZ=[j(),xe(),pe(),gq(),re(),E(),O(),we.allowMultipleSelections.of(!0),Te(),i(te,{fallback:!0}),le(),PK(),ZK(),ye(),D(),ee(),uX(),ae.of([...BK,...CY,...$X,...Fq,...Ce,...QK,...xZ])];pe(),gq(),E(),i(te,{fallback:!0}),ae.of([...CY,...Fq]);function IZ(e,[t,n]){return Math.min(n,Math.max(t,e))}function LZ(e){let t=L.useRef({value:e,previous:e});return L.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var RZ=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),zZ=`VisuallyHidden`,BZ=L.forwardRef((e,t)=>(0,R.jsx)(oN.span,{...e,ref:t,style:{...RZ,...e.style}}));BZ.displayName=zZ;var VZ=BZ,HZ=[` `,`Enter`,`ArrowUp`,`ArrowDown`],UZ=[` `,`Enter`],WZ=`Select`,[GZ,KZ,qZ]=DR(WZ),[JZ,Yte]=ZM(WZ,[qZ,nI]),YZ=nI(),[XZ,ZZ]=JZ(WZ),[QZ,$Z]=JZ(WZ),eQ=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=YZ(t),[g,_]=L.useState(null),[v,y]=L.useState(null),[b,x]=L.useState(!1),S=kR(l),[C,w]=AI({prop:r,defaultProp:i??!1,onChange:a,caller:WZ}),[T,E]=AI({prop:o,defaultProp:s,onChange:c,caller:WZ}),D=L.useRef(null),O=g?m||!!g.closest(`form`):!0,[k,A]=L.useState(new Set),j=Array.from(k).map(e=>e.props.value).join(`;`);return(0,R.jsx)(vI,{...h,children:(0,R.jsxs)(XZ,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:LN(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,R.jsx)(GZ.Provider,{scope:t,children:(0,R.jsx)(QZ,{scope:e.__scopeSelect,onNativeOptionAdd:L.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:L.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,R.jsxs)(YQ,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,R.jsx)(`option`,{value:``}):null,Array.from(k)]},j):null]})})};eQ.displayName=WZ;var tQ=`SelectTrigger`,nQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=YZ(n),o=ZZ(tQ,n),s=o.disabled||r,c=XM(t,o.onTriggerChange),l=KZ(n),u=L.useRef(`touch`),[d,f,p]=ZQ(e=>{let t=l().filter(e=>!e.disabled),n=QQ(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,R.jsx)(yI,{asChild:!0,...a,children:(0,R.jsx)(oN.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":XQ(o.value)?``:void 0,...i,ref:c,onClick:qM(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:qM(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:qM(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&HZ.includes(e.key)&&(m(),e.preventDefault())})})})});nQ.displayName=tQ;var rQ=`SelectValue`,iQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=ZZ(rQ,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=XM(t,c.onValueNodeChange);return PN(()=>{l(u)},[l,u]),(0,R.jsx)(oN.span,{...s,ref:d,style:{pointerEvents:`none`},children:XQ(c.value)?(0,R.jsx)(R.Fragment,{children:o}):a})});iQ.displayName=rQ;var aQ=`SelectIcon`,oQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,R.jsx)(oN.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});oQ.displayName=aQ;var sQ=`SelectPortal`,cQ=e=>(0,R.jsx)(CI,{asChild:!0,...e});cQ.displayName=sQ;var lQ=`SelectContent`,uQ=L.forwardRef((e,t)=>{let n=ZZ(lQ,e.__scopeSelect),[r,i]=L.useState();if(PN(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Ma.createPortal((0,R.jsx)(fQ,{scope:e.__scopeSelect,children:(0,R.jsx)(GZ.Slot,{scope:e.__scopeSelect,children:(0,R.jsx)(`div`,{children:e.children})})}),t):null}return(0,R.jsx)(gQ,{...e,ref:t})});uQ.displayName=lQ;var dQ=10,[fQ,pQ]=JZ(lQ),mQ=`SelectContentImpl`,hQ=$M(`SelectContent.RemoveScroll`),gQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=ZZ(lQ,n),[y,b]=L.useState(null),[x,S]=L.useState(null),C=XM(t,e=>b(e)),[w,T]=L.useState(null),[E,D]=L.useState(null),O=KZ(n),[k,A]=L.useState(!1),j=L.useRef(!1);L.useEffect(()=>{if(y)return VI(y)},[y]),SN();let M=L.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),N=L.useCallback(()=>M([w,y]),[M,w,y]);L.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:F}=v;L.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||P(!1),document.removeEventListener(`pointermove`,t),F.current=null};return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,P,F]),L.useEffect(()=>{let e=()=>P(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[ee,te]=ZQ(e=>{let t=O().filter(e=>!e.disabled),n=QQ(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=L.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(j.current=!0))},[v.value]),re=L.useCallback(()=>y?.focus(),[y]),I=L.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),ie=r===`popper`?bQ:vQ,ae=ie===bQ?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,R.jsx)(fQ,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ne,selectedItem:w,onItemLeave:re,itemTextRefCallback:I,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:k,searchRef:ee,children:(0,R.jsx)(XL,{as:hQ,allowPinchZoom:!0,children:(0,R.jsx)(DN,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:qM(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,R.jsx)(gN,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,R.jsx)(ie,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...ae,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:qM(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});gQ.displayName=mQ;var _Q=`SelectItemAlignedPosition`,vQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=ZZ(lQ,n),o=pQ(lQ,n),[s,c]=L.useState(null),[l,u]=L.useState(null),d=XM(t,e=>u(e)),f=KZ(n),p=L.useRef(!1),m=L.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=L.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-dQ,d=IZ(a,[dQ,Math.max(dQ,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-dQ,d=IZ(a,[dQ,Math.max(dQ,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-dQ*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-dQ,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${dQ}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);PN(()=>y(),[y]);let[b,x]=L.useState();return PN(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,R.jsx)(xQ,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:L.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,R.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,R.jsx)(oN.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});vQ.displayName=_Q;var yQ=`SelectPopperPosition`,bQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=dQ,...a}=e,o=YZ(n);return(0,R.jsx)(bI,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});bQ.displayName=yQ;var[xQ,SQ]=JZ(lQ,{}),CQ=`SelectViewport`,wQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=pQ(CQ,n),o=SQ(CQ,n),s=XM(t,a.onViewportChange),c=L.useRef(0);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,R.jsx)(GZ.Slot,{scope:n,children:(0,R.jsx)(oN.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:qM(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-dQ*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});wQ.displayName=CQ;var TQ=`SelectGroup`,[EQ,DQ]=JZ(TQ),OQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=LN();return(0,R.jsx)(EQ,{scope:n,id:i,children:(0,R.jsx)(oN.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});OQ.displayName=TQ;var kQ=`SelectLabel`,AQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=DQ(kQ,n);return(0,R.jsx)(oN.div,{id:i.id,...r,ref:t})});AQ.displayName=kQ;var jQ=`SelectItem`,[MQ,NQ]=JZ(jQ),PQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=ZZ(jQ,n),c=pQ(jQ,n),l=s.value===r,[u,d]=L.useState(a??``),[f,p]=L.useState(!1),m=XM(t,e=>c.itemRefCallback?.(e,r,i)),h=LN(),g=L.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,R.jsx)(MQ,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:L.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,R.jsx)(GZ.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,R.jsx)(oN.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:qM(o.onFocus,()=>p(!0)),onBlur:qM(o.onBlur,()=>p(!1)),onClick:qM(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:qM(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:qM(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:qM(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qM(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:qM(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(UZ.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});PQ.displayName=jQ;var FQ=`SelectItemText`,IQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=ZZ(FQ,n),s=pQ(FQ,n),c=NQ(FQ,n),l=$Z(FQ,n),[u,d]=L.useState(null),f=XM(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=L.useMemo(()=>(0,R.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return PN(()=>(h(m),()=>g(m)),[h,g,m]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(oN.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ma.createPortal(a.children,o.valueNode):null]})});IQ.displayName=FQ;var LQ=`SelectItemIndicator`,RQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return NQ(LQ,n).isSelected?(0,R.jsx)(oN.span,{"aria-hidden":!0,...r,ref:t}):null});RQ.displayName=LQ;var zQ=`SelectScrollUpButton`,BQ=L.forwardRef((e,t)=>{let n=pQ(zQ,e.__scopeSelect),r=SQ(zQ,e.__scopeSelect),[i,a]=L.useState(!1),o=XM(t,r.onScrollButtonChange);return PN(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(UQ,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});BQ.displayName=zQ;var VQ=`SelectScrollDownButton`,HQ=L.forwardRef((e,t)=>{let n=pQ(VQ,e.__scopeSelect),r=SQ(VQ,e.__scopeSelect),[i,a]=L.useState(!1),o=XM(t,r.onScrollButtonChange);return PN(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(UQ,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});HQ.displayName=VQ;var UQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=pQ(`SelectScrollButton`,n),o=L.useRef(null),s=KZ(n),c=L.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return L.useEffect(()=>()=>c(),[c]),PN(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,R.jsx)(oN.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qM(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:qM(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:qM(i.onPointerLeave,()=>{c()})})}),WQ=`SelectSeparator`,GQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,R.jsx)(oN.div,{"aria-hidden":!0,...r,ref:t})});GQ.displayName=WQ;var KQ=`SelectArrow`,qQ=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=YZ(n),a=ZZ(KQ,n),o=pQ(KQ,n);return a.open&&o.position===`popper`?(0,R.jsx)(xI,{...i,...r,ref:t}):null});qQ.displayName=KQ;var JQ=`SelectBubbleInput`,YQ=L.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=L.useRef(null),a=XM(r,i),o=LZ(t);return L.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,R.jsx)(oN.select,{...n,style:{...RZ,...n.style},ref:a,defaultValue:t})});YQ.displayName=JQ;function XQ(e){return e===``||e===void 0}function ZQ(e){let t=cN(e),n=L.useRef(``),r=L.useRef(0),i=L.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=L.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return L.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function QQ(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=$Q(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function $Q(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var e$=eQ,t$=nQ,n$=iQ,r$=oQ,i$=cQ,a$=uQ,o$=wQ,s$=PQ,c$=IQ,l$=GQ,[u$,Xte]=ZM(`Tooltip`,[nI]),d$=nI(),f$=`TooltipProvider`,p$=700,m$=`tooltip.open`,[h$,g$]=u$(f$),_$=e=>{let{__scopeTooltip:t,delayDuration:n=p$,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=L.useRef(!0),s=L.useRef(!1),c=L.useRef(0);return L.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,R.jsx)(h$,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:L.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:L.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:L.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};_$.displayName=f$;var v$=`Tooltip`,[y$,b$]=u$(v$),x$=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=g$(v$,e.__scopeTooltip),l=d$(t),[u,d]=L.useState(null),f=LN(),p=L.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=L.useRef(!1),[_,v]=AI({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(m$))):c.onClose(),a?.(e)},caller:v$}),y=L.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=L.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=L.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=L.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return L.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,R.jsx)(vI,{...l,children:(0,R.jsx)(y$,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:L.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:L.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};x$.displayName=v$;var S$=`TooltipTrigger`,C$=L.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=b$(S$,n),a=g$(S$,n),o=d$(n),s=XM(t,L.useRef(null),i.onTriggerChange),c=L.useRef(!1),l=L.useRef(!1),u=L.useCallback(()=>c.current=!1,[]);return L.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,R.jsx)(yI,{asChild:!0,...o,children:(0,R.jsx)(oN.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:qM(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:qM(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:qM(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:qM(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:qM(e.onBlur,i.onClose),onClick:qM(e.onClick,i.onClose)})})});C$.displayName=S$;var w$=`TooltipPortal`,[T$,E$]=u$(w$,{forceMount:void 0}),D$=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=b$(w$,t);return(0,R.jsx)(T$,{scope:t,forceMount:n,children:(0,R.jsx)(TI,{present:n||a.open,children:(0,R.jsx)(CI,{asChild:!0,container:i,children:r})})})};D$.displayName=w$;var O$=`TooltipContent`,k$=L.forwardRef((e,t)=>{let n=E$(O$,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=b$(O$,e.__scopeTooltip);return(0,R.jsx)(TI,{present:r||o.open,children:o.disableHoverableContent?(0,R.jsx)(P$,{side:i,...a,ref:t}):(0,R.jsx)(A$,{side:i,...a,ref:t})})}),A$=L.forwardRef((e,t)=>{let n=b$(O$,e.__scopeTooltip),r=g$(O$,e.__scopeTooltip),i=L.useRef(null),a=XM(t,i),[o,s]=L.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=L.useCallback(()=>{s(null),d(!1)},[d]),p=L.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=R$(r,L$(r,n.getBoundingClientRect())),a=z$(t.getBoundingClientRect());s(V$([...i,...a])),d(!0)},[d]);return L.useEffect(()=>()=>f(),[f]),L.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),L.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!B$(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,R.jsx)(P$,{...e,ref:a})}),[j$,M$]=u$(v$,{isInside:!1}),N$=nN(`TooltipContent`),P$=L.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=b$(O$,n),l=d$(n),{onClose:u}=c;return L.useEffect(()=>(document.addEventListener(m$,u),()=>document.removeEventListener(m$,u)),[u]),L.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,R.jsx)(gN,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,R.jsxs)(bI,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,R.jsx)(N$,{children:r}),(0,R.jsx)(j$,{scope:n,isInside:!0,children:(0,R.jsx)(VZ,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});k$.displayName=O$;var F$=`TooltipArrow`,I$=L.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=d$(n);return M$(F$,n).isInside?null:(0,R.jsx)(xI,{...i,...r,ref:t})});I$.displayName=F$;function L$(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function R$(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function z$(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function B$(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function V$(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),H$(t)}function H$(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var U$=_$,W$=x$,G$=C$,K$=D$,q$=k$,J$=I$,Y$=L.forwardRef(({title:e,children:t},n)=>{let r=Id(YO);return L.createElement(U$,{delayDuration:100},L.createElement(W$,null,L.createElement(G$,{ref:n,asChild:!0},L.createElement(`span`,{className:J.tooltipTrigger},t)),L.createElement(K$,{container:r?.current},L.createElement(q$,{className:(0,vj.default)(J.tooltipContent),sideOffset:10},e))))}),X$=L.forwardRef(({children:e,className:t,...n},r)=>L.createElement(s$,{...n,ref:r,className:(0,vj.default)(t,J.selectItem)},L.createElement(c$,null,e))),Z$=({title:e,placeholder:t,className:n})=>{let[r,i]=Ld(wO,fk);return L.createElement(Y$,{title:e},L.createElement(t$,{"aria-label":t,className:(0,vj.default)(J.selectTrigger,n),"data-toolbar-item":!0,disabled:r},L.createElement(n$,{placeholder:t}),L.createElement(r$,{className:J.selectDropdownArrow},i(`arrow_drop_down`))))},Q$=({children:e,className:t=J.selectContainer})=>{let n=Id(YO);return L.createElement(i$,{container:n?.current},L.createElement(a$,{className:(0,vj.default)(t,`mdxeditor-select-content`),onCloseAutoFocus:e=>{e.preventDefault()},position:`popper`},L.createElement(o$,{"data-editor-dropdown":!0,style:{maxHeight:`var(--radix-select-content-available-height)`}},e)))},$$=e=>L.createElement(e$,{value:e.value||``,onValueChange:e.onChange,disabled:e.disabled},L.createElement(Z$,{title:e.triggerTitle,placeholder:e.placeholder}),L.createElement(Q$,null,e.items.map((e,t)=>e===`separator`?L.createElement(l$,{key:t}):L.createElement(X$,{key:t,value:e.value},e.label)))),e1=({language:e,nodeKey:t,code:n,focusEmitter:r})=>{let i=Bk(),{parentEditor:a,lexicalNode:o}=eG(),[s,c,l,u,d]=Ld(wO,o1,s1,fk,i1),p=TY(t,`codeblock`,e,r),{setCode:m}=eG(),h=L.useRef(null),g=L.useRef(null),{value:_,items:v}=L.useMemo(()=>r1(d,e),[d,e]),y=L.useRef(m);return y.current=m,p.current={getCodemirror:()=>h.current},L.useEffect(()=>{let t=g.current;return(async()=>{let r=[...c,FZ,XY,j(),ae.of([wY]),f.lineWrapping,f.updateListener.of(({state:e})=>{y.current(e.doc.toString())}),f.domEventHandlers({focus:()=>{a.update(()=>{j_(null)})}})];if(s&&r.push(we.readOnly.of(!0)),e!==``){let t=d.keyMap[e]??e,n=d.supportMap[t];if(n)r.push(n.extension);else if(l){let t=DY.find(t=>t.name===e||t.alias.includes(e)||t.extensions.includes(e));if(t)try{let e=await t.load();r.push(e.extension)}catch{console.warn(`failed to load language support for`,e)}}}t.innerHTML=``,h.current=new f({parent:t,state:we.create({doc:n,extensions:r})}),t.addEventListener(`keydown`,t1)})(),()=>{var e;(e=h.current)==null||e.destroy(),h.current=null,t.removeEventListener(`keydown`,t1)}},[s,e,...c]),L.createElement(`div`,{className:J.codeMirrorWrapper},L.createElement(`div`,{className:J.codeMirrorToolbar},L.createElement($$,{disabled:s,value:_,onChange:e=>{a.update(()=>{o.setLanguage(e===`__EMPTY_VALUE__`?``:e),setTimeout(()=>{a.update(()=>{o.getLatest().select()})})})},triggerTitle:i(`codeBlock.selectLanguage`,`Select code block language`),placeholder:i(`codeBlock.inlineLanguage`,`Language`),items:v}),L.createElement(`button`,{className:J.iconButton,type:`button`,disabled:s,title:i(`codeblock.delete`,`Delete code block`),onClick:e=>{e.preventDefault(),a.update(()=>{o.remove()})}},u(`delete_small`))),L.createElement(`div`,{ref:g}))};function t1(e){e.stopPropagation()}function n1(e){let t=[],n={},r={};if(Array.isArray(e))for(let i of e){let e=i.alias?.[0]??i.name.toLowerCase(),a=e||`__EMPTY_VALUE__`;if(t.push({value:a,label:i.name}),n[e]=a,i.alias)for(let e of i.alias)n[e]=a;if(i.extensions)for(let e of i.extensions)n[e]=a;n[i.name.toLowerCase()]=a,i.support&&(r[a]=i.support)}else{let r={};for(let[i,a]of Object.entries(e))a in r||(r[a]=i,t.push({value:i||`__EMPTY_VALUE__`,label:a})),n[i]=r[a]||`__EMPTY_VALUE__`}return{items:t,keyMap:n,supportMap:r}}function r1(e,t){let n=e.keyMap[t]??t;return!n||e.items.some(e=>e.value===n)?{value:n,items:e.items}:{value:n,items:[...e.items,{value:n,label:t}]}}var i1=B(n1({js:`JavaScript`,ts:`TypeScript`,tsx:`TypeScript (React)`,jsx:`JavaScript (React)`,css:`CSS`})),a1=Md(e=>{e.link(e.pipe(a1,zd(({language:e,code:t})=>({code:t,language:e,meta:``}))),cG)}),o1=B([]),s1=B(!0),c1=Gd({update(e,t){e.pubIn({[i1]:n1(t?.codeBlockLanguages??{}),[o1]:t?.codeMirrorExtensions??[],[s1]:t?.autoLoadLanguageSupport??!0})},init(e,t){let n=n1(t?.codeBlockLanguages??{});e.pubIn({[i1]:n,[o1]:t?.codeMirrorExtensions??[],[lG]:l1(),[s1]:t?.autoLoadLanguageSupport??!0})}});function l1(e){return{match(e,t){return!t},priority:1,Editor:e1}}function u1({url:e,title:t,text:n,onSubmit:r,onCancel:i,linkAutocompleteSuggestions:a,showLinkTitleField:o,showAnchorTextField:s}){let{register:c,handleSubmit:l,control:u,setValue:d,reset:f}=QV({values:{url:e,title:t,text:n}}),p=Bk();return L.createElement(`form`,{onSubmit:e=>{l(r)(e),e.stopPropagation(),e.preventDefault()},onReset:e=>{e.stopPropagation(),i()},onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),i())},className:(0,vj.default)(J.multiFieldForm,J.linkDialogEditForm)},L.createElement(`div`,{className:J.formField},L.createElement(`label`,{htmlFor:`link-url`},p(`createLink.url`,`URL`)),L.createElement(VW,{register:c,initialInputValue:e,inputName:`url`,suggestions:a,setValue:d,control:u,placeholder:p(`createLink.urlPlaceholder`,`Select or paste an URL`),autofocus:!0})),s?L.createElement(`div`,{className:J.formField},L.createElement(`label`,{htmlFor:`link-text`,title:p(`createLink.textTooltip`,`The text to be displayed for the link`)},p(`createLink.text`,`Anchor text`)),L.createElement(`input`,{id:`link-text`,className:J.textInput,size:40,...c(`text`)})):null,o?L.createElement(`div`,{className:J.formField},L.createElement(`label`,{htmlFor:`link-title`,title:p(`createLink.titleTooltip`,`The link's title attribute, shown on hover`)},p(`createLink.title`,`Link title`)),L.createElement(`input`,{id:`link-title`,className:J.textInput,size:40,...c(`title`)})):null,L.createElement(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:`var(--spacing-2)`}},L.createElement(`button`,{type:`submit`,title:p(`createLink.saveTooltip`,`Set URL`),"aria-label":p(`createLink.saveTooltip`,`Set URL`),className:(0,vj.default)(J.primaryButton)},p(`dialogControls.save`,`Save`)),L.createElement(`button`,{type:`reset`,title:p(`createLink.cancelTooltip`,`Cancel change`),"aria-label":p(`createLink.cancelTooltip`,`Cancel change`),className:(0,vj.default)(J.secondaryButton)},p(`dialogControls.cancel`,`Cancel`))))}var d1=()=>{let[e,t,n,r,i,a,o]=Ld(YO,xO,fk,h1,x1,S1,T1),s=Rd(m1),c=Rd(g1),l=Rd(_1),u=Rd(v1),d=Rd(y1);L.useEffect(()=>{let e=()=>{t?.getEditorState().read(()=>{s(!0)})};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e)}},[t,s]);let[f,p]=L.useState(!1),m=Bk();if(r.type===`inactive`)return null;let h=r.rectangle,g=r.type===`preview`&&r.url.startsWith(`http`);return L.createElement(SR,{open:!0},L.createElement(CR,{"data-visible":r.type===`edit`,className:J.linkDialogAnchor,style:{top:`${h.top}px`,left:`${h.left}px`,width:`${h.width}px`,height:`${h.height}px`}}),L.createElement(wR,{container:e?.current},L.createElement(TR,{className:(0,vj.default)(J.linkDialogPopoverContent),sideOffset:5,onOpenAutoFocus:e=>{e.preventDefault()},key:r.linkNodeKey},r.type===`edit`&&L.createElement(u1,{url:r.url,title:r.title,text:r.text,onSubmit:c,onCancel:l.bind(null),linkAutocompleteSuggestions:i,showLinkTitleField:o,showAnchorTextField:r.withAnchorText}),r.type===`preview`&&L.createElement(L.Fragment,null,L.createElement(`a`,{className:J.linkDialogPreviewAnchor,href:r.url,...g?{target:`_blank`,rel:`noreferrer`}:{},onClick:e=>{a!==null&&(e.preventDefault(),a(r.url))},title:g?m(`linkPreview.open`,`Open {{url}} in new window`,{url:r.url}):r.url},L.createElement(`span`,null,r.url),g&&n(`open_in_new`)),L.createElement(f1,{onClick:()=>{u()},title:m(`linkPreview.edit`,`Edit link URL`),"aria-label":m(`linkPreview.edit`,`Edit link URL`)},n(`edit`)),L.createElement(U$,null,L.createElement(W$,{open:f},L.createElement(G$,{asChild:!0},L.createElement(f1,{title:m(`linkPreview.copyToClipboard`,`Copy to clipboard`),"aria-label":m(`linkPreview.copyToClipboard`,`Copy to clipboard`),onClick:()=>{window.navigator.clipboard.writeText(r.url).then(()=>{p(!0),setTimeout(()=>{p(!1)},1e3)})}},n(f?`check`:`content_copy`))),L.createElement(K$,{container:e?.current},L.createElement(q$,{className:(0,vj.default)(J.tooltipContent),sideOffset:5},m(`linkPreview.copied`,`Copied!`),L.createElement(J$,null))))),L.createElement(f1,{title:m(`linkPreview.remove`,`Remove link`),"aria-label":m(`linkPreview.remove`,`Remove link`),onClick:()=>{d()}},n(`link_off`))),L.createElement(ER,{className:J.popoverArrow}))))},f1=L.forwardRef(({className:e,...t},n)=>L.createElement(`button`,{className:(0,vj.default)(J.actionButton,e),ref:n,...t}));function p1(e){if(!e)return null;let t=fj(e);if(t===null)return null;let n=t.getParent();return hA(n)?n:hA(t)?t:null}var m1=Md(),h1=B({type:`inactive`},e=>{e.pub(gk,t=>t.registerCommand(um,()=>e.getValue(h1).type===`preview`?(e.pub(h1,{type:`inactive`}),!0):!1,1)),e.sub(e.pipe(Nk),t=>{t!==`rich-text`&&e.pub(h1,{type:`inactive`})}),e.pub(gk,t=>t.registerCommand(tm,t=>t.key===`k`&&(Oj?t.metaKey:t.ctrlKey)&&!e.getValue(wO)&&U(W())?(e.pub(b1),t.stopPropagation(),t.preventDefault(),!0):!1,3)),e.sub(e.pipe(v1,Bd(h1,xO)),([,t,n])=>{if(t.type===`preview`)setTimeout(()=>{n?.getEditorState().read(()=>{let n=C_(t.linkNodeKey),r=hA(n)?n.getTextContent().length>0&&n.getChildrenSize()<=1:!1,i=r&&n?n.getTextContent():``;e.pub(h1,{type:`edit`,initialUrl:t.url,url:t.url,title:t.title,text:i,withAnchorText:r,linkNodeKey:t.linkNodeKey,rectangle:t.rectangle})})});else throw Error(`Cannot switch to edit mode when not in preview mode`)}),e.sub(e.pipe(g1,Bd(xO,h1,MO)),([t,n,r,i])=>{let a=t.text?.trim()??``,o=t.url?.trim()??``,s=t.title?.trim()??``;if(o!==``){if(i?.isCollapsed()){let e=a||s||o;n?.update(()=>{let t=p1(i);if(!t){let t=mA(o,{title:s});t.append(Eh(e)),ig([t]),t.select()}else if(vA(t)){let e=mA(o,{title:s});e.append(Eh(a)),t.replace(e),e.select()}else t.setURL(o),t.setTitle(s),w1(t.getFirstChild(),a)},{discrete:!0})}else n?.update(()=>{w1(i?.anchor.getNode(),a)}),n?.dispatchCommand(yA,{url:o,title:s});e.pub(h1,{type:`preview`,linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:s,url:o})}else r.type===`edit`&&r.initialUrl!==``&&n?.dispatchCommand(yA,null),e.pub(h1,{type:`inactive`})}),e.link(e.pipe(_1,Bd(h1,xO),zd(([,e,t])=>{if(e.type===`edit`)return t?.focus(),e.initialUrl===``?{type:`inactive`}:{type:`preview`,url:e.initialUrl,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw Error(`Cannot cancel edit when not in edit mode`)})),h1),e.link(e.pipe(e.combine(MO,m1),Bd(xO,h1,wO),zd(([[e],t,n,r])=>{if(U(e)&&t&&!r){let n=p1(e);if(!e.isCollapsed())return{type:`inactive`};if(n){let e=gj(t);return e?{type:`preview`,url:n.getURL(),linkNodeKey:n.getKey(),title:n.getTitle(),rectangle:e}:{type:`inactive`}}else return{type:`inactive`}}else return{type:`inactive`}})),h1)}),g1=Md(),_1=Nd();Nd();var v1=Nd(),y1=Nd(e=>{e.sub(e.pipe(y1,Bd(xO)),([,e])=>{e?.dispatchCommand(yA,null)})}),b1=Nd(e=>{e.sub(e.pipe(b1,Bd(MO,xO),Vd(([,e])=>U(e))),([,t,n])=>{n?.focus(()=>{setTimeout(()=>{n.getEditorState().read(()=>{let r=p1(t),i=gj(n),a=r?.getURL()??``,o=r?.getURL()??``,s=r?.getTitle()??``,c=r?.getKey()??``,l=r?r.getTextContent().length>0&&r.getChildrenSize()<=1:!!t?.isCollapsed(),u=l&&r?r.getTextContent():``;e.pub(h1,{type:`edit`,initialUrl:a,url:o,title:s,text:u,withAnchorText:l,linkNodeKey:c,rectangle:i})})})})})}),x1=B([]),S1=B(null),C1=B(null,e=>{e.pub(gk,t=>{function n(n){let[r,i]=e.getValues([wO,C1]);!r||i===null||t.update(()=>{let e=E_(n.target);if(e!==null){let t=rb(e,e=>e instanceof fA);t!==null&&i(n,t,t.getURL())}})}return t.registerRootListener((e,t)=>{e&&e.addEventListener(`click`,n),t&&t.removeEventListener(`click`,n)})})});function w1(e,t){H(e)&&t&&(e.setTextContent(t),e.selectStart())}var T1=B(!0),E1=Gd({init(e,t){e.pub(yk,t?.LinkDialog??d1),e.pub(S1,t?.onClickLinkCallback??null),e.pub(C1,t?.onReadOnlyClickLinkCallback??null),e.pub(T1,t?.showLinkTitleField??!0)},update(e,t={}){e.pub(x1,t.linkAutocompleteSuggestions??[])}});function D1(e,t){return L.forwardRef((n,r)=>{let i=(0,vj.default)(t.className,n.className);return L.createElement(e,{...t,...n,className:i,ref:r})})}function O1(e){return({title:t,children:n,...r})=>L.createElement(e,{"aria-label":t,...r},L.createElement(Y$,{title:t},n))}var k1=({readOnly:e,children:t,className:n})=>L.createElement(zz,{className:(0,vj.default)(`mdxeditor-toolbar`,J.toolbarRoot,{[J.readOnlyToolbarRoot]:e},n),...e?{tabIndex:-1}:{}},t),A1=O1(D1(Vz,{className:J.toolbarButton,"data-toolbar-item":!0})),j1=D1(Uz,{className:J.toolbarToggleItem,"data-toolbar-item":!0});D1(Hz,{type:`single`,className:J.toolbarToggleSingleGroup});var M1=L.forwardRef(({on:e,title:t,children:n,disabled:r,...i},a)=>L.createElement(Hz,{type:`single`,className:J.toolbarToggleSingleGroup,...i,value:e?`on`:`off`,ref:a},L.createElement(j1,{"aria-label":t,value:`on`,disabled:r},L.createElement(Y$,{title:t},n)))),N1=({items:e})=>L.createElement(`div`,{className:J.toolbarGroupOfGroups},e.map((e,t)=>L.createElement(M1,{key:t,title:e.title,on:e.active,onValueChange:t=>{e.onChange(t===`on`)},disabled:e.disabled},e.contents))),P1=({value:e,onChange:t,className:n,ggClassName:r,items:i,disabled:a})=>{let o=Bk();return L.createElement(`div`,{className:(0,vj.default)(J.toolbarGroupOfGroups,r)},L.createElement(Hz,{"aria-label":o(`toolbar.toggleGroup`,`toggle group`),type:`single`,className:(0,vj.default)(J.toolbarToggleSingleGroup,n),onValueChange:t,value:e||``,disabled:a,onFocus:e=>{e.preventDefault()}},i.map((e,t)=>L.createElement(j1,{key:t,"aria-label":e.title,value:e.value},L.createElement(Y$,{title:e.title},e.contents)))))},F1=B(()=>null),I1=B(``),L1=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",R1=Gd({init(e,t){let n=t?.toolbarPosition===`bottom`?Ck:xk;e.pubIn({[F1]:t?.toolbarContents??L1,[I1]:t?.toolbarClassName??``,[n]:()=>{let[e,t,n]=Ld(F1,wO,I1);return L.createElement(k1,{className:n,readOnly:t},e())}})},update(e,t){e.pub(F1,t?.toolbarContents??L1),e.pub(I1,t?.toolbarClassName??``)}});Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend(`clike`,{"class-name":[Prism.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),Prism.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined(`script`,`javascript`),Prism.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside[`attr-value`].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside[`internal-subset`].inside=Prism.languages.markup,Prism.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&/,`&`))}),Object.defineProperty(Prism.languages.markup.tag,`addInlined`,{value:function(e,t){var n={};n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r[`language-`+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore(`markup`,`cdata`,i)}}),Object.defineProperty(Prism.languages.markup.tag,`addAttribute`,{value:function(e,t){Prism.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend(`markup`,{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,(function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(l(t.content),s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var c=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=c,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(c);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}});var o=RegExp(e.languages.markup.tag.pattern.source,`gi`),s={amp:`&`,lt:`<`,gt:`>`,quot:`"`},c=String.fromCodePoint||String.fromCharCode;function l(e){var t=e.replace(o,``);return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){return t=t.toLowerCase(),t[0]===`#`?c(t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1))):s[t]||e}),t}e.languages.md=e.languages.markdown})(Prism),Prism.languages.c=Prism.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(Prism),Prism.languages.objectivec=Prism.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec[`class-name`],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python[`string-interpolation`].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift}),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(Prism);function z1(e,t){for(let n of e.childNodes){if(_v(n)&&n.tagName===t)return!0;z1(n,t)}return!1}var B1=`data-language`,V1=`data-highlight-language`,H1=`data-theme`,U1=class e extends Pg{static getType(){return`code`}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=document.createElement(`code`);$y(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(B1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(V1,n));let r=this.getTheme();r&&t.setAttribute(H1,r);let i=this.getStyle();return i&&t.setAttribute(`style`,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(B1,r):i&&t.removeAttribute(B1);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(V1,r):t.removeAttribute(V1):a&&r&&t.setAttribute(V1,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(H1,o):s&&t.removeAttribute(H1);let c=this.__style,l=e.__style;return c?c!==l&&t.setAttribute(`style`,c):l&&t.removeAttribute(`style`),!1}exportDOM(e){let t=document.createElement(`pre`);$y(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(B1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(V1,n));let r=this.getTheme();r&&t.setAttribute(H1,r);let i=this.getStyle();return i&&t.setAttribute(`style`,i),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||z1(e,`BR`))?{conversion:K1,priority:1}:null,div:()=>({conversion:q1,priority:1}),pre:()=>({conversion:K1,priority:0}),table:e=>Z1(e)?{conversion:J1,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&Z1(n)?{conversion:Y1,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&Z1(t)?{conversion:Y1,priority:3}:null}}}static importJSON(e){return W1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){let n=this.getChildren(),r=n.length;if(r>=2&&n[r-1].getTextContent()===`
|
|
129
|
+
`&&n[r-2].getTextContent()===`
|
|
130
|
+
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();let e=Yg();return this.insertAfter(e,t),e}let{anchor:i,focus:a}=e,o=(i.isBefore(a)?i:a).getNode();if(H(o)){let e=r0(o),t=[];for(;;)if(Ah(e))t.push(kh()),e=e.getNextSibling();else{if(!t0(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&r[n]===` `;)n++;if(n!==0&&t.push(e0(` `.repeat(n))),n!==i)break;e=e.getNextSibling()}}let n=o.splitText(i.offset)[0],r=i.offset===0?0:1,a=n.getIndexWithinParent()+r,s=o.getParentOrThrow(),c=[ch(),...t];s.splice(a,0,c);let l=t[t.length-1];l?l.select():i.offset===0?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(G1(o)){let{offset:t}=e.anchor;o.splice(t,0,[ch()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){let e=Yg();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function W1(e,t){return Nv(U1).setLanguage(e).setTheme(t)}function G1(e){return e instanceof U1}function K1(e){return{node:W1(e.getAttribute(B1))}}function q1(e){let t=e,n=X1(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(X1(t))return!0;t=t.parentElement}return!1}(t)?{node:n?W1():null}:{node:null}}function J1(){return{node:W1()}}function Y1(){return{node:null}}function X1(e){return e.style.fontFamily.match(`monospace`)!==null}function Z1(e){return e.classList.contains(`js-file-line-container`)}var Q1=class e extends _h{constructor(e=``,t,n){super(e,n),this.__highlightType=t}static getType(){return`code-highlight`}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return $y(t,$1(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=$1(n.theme,e.__highlightType),a=$1(n.theme,this.__highlightType);return i!==a&&(i&&eb(t,i),a&&$y(t,a)),r}static importJSON(e){return e0().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return W1()}};function $1(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function e0(e=``,t){return lv(new Q1(e,t))}function t0(e){return e instanceof Q1}function n0(e,t){let n=e;for(let r=Jv(e,t);r&&(t0(r.origin)||Ah(r.origin));r=dee(r))n=r.origin;return n}function r0(e){return n0(e,`previous`)}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":`-`,"deleted-arrow":`<`,"inserted-sign":`+`,"inserted-arrow":`>`,unchanged:` `,diff:`!`};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),n===`diff`&&i.push(`bold`),e.languages.diff[n]={pattern:RegExp(`^(?:[`+r+`].*(?:\r
|
|
131
|
+
?|
|
|
132
|
+
|(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,`PREFIXES`,{value:t})})(Prism),globalThis.Prism||window.Prism;function i0(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function a0(e){let t=i0(e,(e=>e.type));return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var o0=/[!-/:-@[-`{-~\s]/;function s0(e){return H(e)&&!e.hasFormat(`code`)}function c0(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function l0(e,t,n){let r=n.length;for(let i=t;i>=r;i--){let t=i-r;if(u0(e,t,n,0,r)&&e[t+r]!==` `)return t}return-1}function u0(e,t,n,r,i){for(let a=0;a<i;a++)if(e[t+a]!==n[r+a])return!1;return!0}function d0(e,t=H0){let n=a0(t),r=i0(n.textFormat,(({tag:e})=>e[e.length-1])),i=i0(n.textMatch,(({trigger:e})=>e));for(let n of t){let t=n.type;if(t===`element`||t===`text-match`||t===`multiline-element`){let t=n.dependencies;for(let n of t)e.hasNode(n)||c0(173,n.getType())}}let a=(e,t,a)=>{(function(e,t,n,r){if(!cv(e.getParent())||e.getFirstChild()!==t)return!1;let i=t.getTextContent();if(i[n-1]!==` `)return!1;for(let{regExp:a,replace:o}of r){let r=i.match(a);if(r&&r[0].length===(r[0].endsWith(` `)?n:n-1)){let i=t.getNextSiblings(),[a,s]=t.splitText(n);if(!1!==o(e,s?[s,...i]:i,r,!1))return a.remove(),!0}}return!1})(e,t,a,n.element)||function(e,t,n,r){if(!cv(e.getParent())||e.getFirstChild()!==t)return!1;let i=t.getTextContent();if(i[n-1]!==` `)return!1;for(let{regExpStart:a,replace:o,regExpEnd:s}of r){if(s&&!(`optional`in s)||s&&`optional`in s&&!s.optional)continue;let r=i.match(a);if(r&&r[0].length===(r[0].endsWith(` `)?n:n-1)){let i=t.getNextSiblings(),[a,s]=t.splitText(n);if(!1!==o(e,s?[s,...i]:i,r,null,null,!1))return a.remove(),!0}}return!1}(e,t,a,n.multilineElement)||function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(i==null)return!1;t<r.length&&(r=r.slice(0,t));for(let t of i){if(!t.replace||!t.regExp)continue;let n=r.match(t.regExp);if(n===null)continue;let i=n.index||0,a=i+n[0].length,o;return i===0?[o]=e.splitText(a):[,o]=e.splitText(i,a),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,a,i)||function(e,t,n){let r=e.getTextContent(),i=t-1,a=r[i],o=n[a];if(!o)return!1;for(let t of o){let{tag:n}=t,o=n.length,s=i-o+1;if(o>1&&!u0(r,s,n,0,o)||r[s-1]===` `)continue;let c=r[i+1];if(!1===t.intraword&&c&&!o0.test(c))continue;let l=e,u=l,d=l0(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!lh(f);)if(H(f)){if(f.hasFormat(`code`))continue;let e=f.getTextContent();u=f,d=l0(e,e.length,n)}if(d<0||u===l&&d+o===s)continue;let p=u.getTextContent();if(d>0&&p[d-1]===a)continue;let m=p[d-1];if(!1===t.intraword&&m&&!o0.test(m))continue;let h=l.getTextContent(),g=h.slice(0,s)+h.slice(i+1);l.setTextContent(g);let _=u===l?g:p;u.setTextContent(_.slice(0,d)+_.slice(d+o));let v=W(),y=Jh();j_(y);let b=i-o*(u===l?2:1)+1;y.anchor.set(u.__key,d,`text`),y.focus.set(l.__key,b,`text`);for(let e of t.format)y.hasFormat(e)||y.formatText(e);y.anchor.set(y.focus.key,y.focus.offset,y.focus.type);for(let e of t.format)y.hasFormat(e)&&y.toggleFormat(e);return U(v)&&(y.format=v.format),!0}}(t,a,r)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(`collaboration`)||t.has(`historic`)||e.isComposing())return;let o=r.read(W),s=i.read(W);if(!U(s)||!U(o)||!o.isCollapsed()||o.is(s))return;let c=o.anchor.key,l=o.anchor.offset,u=r._nodeMap.get(c);!H(u)||!n.has(c)||l!==1&&l>s.anchor.offset+1||e.update((()=>{if(!s0(u))return;let e=u.getParent();e===null||G1(e)||a(e,u,o.anchor.offset)}))}))}var f0=/^(\s*)(\d{1,})\.\s/,p0=/^(\s*)[-*+]\s/,m0=/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,h0=/^(#{1,6})\s/,g0=/^>\s/,_0=/^[ \t]*```([\w-]+)?/,v0=/[ \t]*```$/,y0=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)},b0=e=>(t,n,r,i)=>{let a=t.getPreviousSibling(),o=t.getNextSibling(),s=WA(e===`check`?r[3]===`x`:void 0);if(QA(o)&&o.getListType()===e){let e=o.getFirstChild();e===null?o.append(s):e.insertBefore(s),t.remove()}else if(QA(a)&&a.getListType()===e)a.append(s),t.remove();else{let n=ZA(e,e===`number`?Number(r[2]):void 0);n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0);let c=function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);c&&s.setIndent(c)},x0=(e,t,n)=>{let r=[],i=e.getChildren(),a=0;for(let o of i)if(GA(o)){if(o.getChildrenSize()===1){let e=o.getFirstChild();if(QA(e)){r.push(x0(e,t,n+1));continue}}let i=` `.repeat(4*n),s=e.getListType(),c=s===`number`?`${e.getStart()+a}. `:s===`check`?`- [${o.getChecked()?`x`:` `}] `:`- `;r.push(i+c+t(o)),a++}return r.join(`
|
|
133
|
+
`)},S0={dependencies:[rx],export:(e,t)=>{if(!cx(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:h0,replace:y0((e=>sx(`h`+e[1].length))),type:`element`},C0={dependencies:[ex],export:(e,t)=>{if(!nx(e))return null;let n=t(e).split(`
|
|
134
|
+
`),r=[];for(let e of n)r.push(`> `+e);return r.join(`
|
|
135
|
+
`)},regExp:g0,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(nx(n))return n.splice(n.getChildrenSize(),0,[ch(),...t]),void e.remove()}let i=tx();i.append(...t),e.replace(i),r||i.select(0,0)},type:`element`},w0={dependencies:[U1],export:e=>{if(!G1(e))return null;let t=e.getTextContent();return"```"+(e.getLanguage()||``)+(t?`
|
|
136
|
+
`+t:``)+"\n```"},regExpEnd:{optional:!0,regExp:v0},regExpStart:_0,replace:(e,t,n,r,i,a)=>{let o,s;if(!t&&i){if(i.length===1)r?(o=W1(),s=n[1]+i[0]):(o=W1(n[1]),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{if(o=W1(n[1]),i[0].trim().length===0)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(` `)?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();s=i.join(`
|
|
137
|
+
`)}let t=Eh(s);o.append(t),e.append(o)}else t&&y0((e=>W1(e?e[1]:void 0)))(e,t,n,a)},type:`multiline-element`},T0={dependencies:[KA,VA],export:(e,t)=>QA(e)?x0(e,t,0):null,regExp:p0,replace:b0(`bullet`),type:`element`},E0={dependencies:[KA,VA],export:(e,t)=>QA(e)?x0(e,t,0):null,regExp:m0,replace:b0(`check`),type:`element`},D0={dependencies:[KA,VA],export:(e,t)=>QA(e)?x0(e,t,0):null,regExp:f0,replace:b0(`number`),type:`element`},O0={format:[`code`],tag:"`",type:`text-format`},k0={format:[`highlight`],tag:`==`,type:`text-format`},A0={format:[`bold`,`italic`],tag:`***`,type:`text-format`},j0={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},M0={format:[`bold`],tag:`**`,type:`text-format`},N0={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},P0={format:[`strikethrough`],tag:`~~`,type:`text-format`},F0={format:[`italic`],tag:`*`,type:`text-format`},I0={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`},L0={dependencies:[fA],export:(e,t,n)=>{if(!hA(e)||vA(e))return null;let r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[(.*?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.*?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{let[,n,r,i]=t,a=mA(r,{title:i}),o=n.split(`[`).length-1,s=n.split(`]`).length-1,c=n,l=``;if(o<s)return;if(o>s){let e=n.split(`[`);l=`[`+e[0],c=e.slice(1).join(`[`)}let u=Eh(c);return u.setFormat(e.getFormat()),a.append(u),e.replace(a),l&&a.insertBefore(Eh(l)),u},trigger:`)`,type:`text-match`},R0=[S0,C0,T0,D0],z0=[w0],B0=[O0,A0,j0,M0,N0,k0,F0,I0,P0],V0=[L0],H0=[...R0,...z0,...B0,...V0],U0=[{dependencies:[Vj],export:e=>Wj(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=Uj();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},...H0];function W0({transformers:e=U0}){let[t]=Yd();return(0,L.useEffect)((()=>d0(t,e)),[t,e]),null}var G0=Gd({init(e){let t=e.getValue(Fk),n=Y0(t,t.includes(`headings`)?e.getValue(Fj):[]),r=n.filter(e=>!J0.has(e));e.pubIn({[yk]:()=>L.createElement(W0,{transformers:n}),[Tk]:()=>L.createElement(W0,{transformers:n}),[Dk]:()=>L.createElement(W0,{transformers:r})})}}),K0=e=>(t,n,r)=>{let i=e(r);i.append(...n),t.replace(i),i.select(0,0)},q0={dependencies:[Vj],export:e=>Wj(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=Uj();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},J0=new Set([D0,T0,E0]);function Y0(e,t){let n=[A0,j0,M0,N0,O0,F0,I0];if(e.includes(`headings`)){let e=Math.min(...t),r=Math.max(...t),i=RegExp(`^(#{${e},${r}})\\s`),a={dependencies:[rx],export:(e,t)=>{if(!cx(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:i,replace:K0(e=>sx(`h${e[1].length}`)),type:`element`};n.push(a)}if(e.includes(`thematicBreak`)&&n.push(q0),e.includes(`quote`)&&n.push(C0),e.includes(`link`)&&n.push(L0),e.includes(`lists`)&&n.push(D0,T0,E0),e.includes(`codeblock`)){let e={...w0,dependencies:[ZW],replace:(e,t,n)=>{let r=nG({code:``,language:n[1]??``,meta:``});e.selectPrevious(),e.replace(r),setTimeout(()=>{r.select()},80)}};n.push(e)}return n}var X0=()=>{let e=Rd(jk),t=Id(Ak),n=Id(Fk),r=n.includes(`quote`),i=n.includes(`headings`),a=Bk();if(!r&&!i)return null;let o=[{label:a(`toolbar.blockTypes.paragraph`,`Paragraph`),value:`paragraph`}];if(r&&o.push({label:a(`toolbar.blockTypes.quote`,`Quote`),value:`quote`}),i){let e=Id(Fj);o.push(...e.map(e=>({label:a(`toolbar.blockTypes.heading`,`Heading {{level}}`,{level:e}),value:`h${e}`})))}return L.createElement($$,{value:t,onChange:t=>{switch(t){case`quote`:e(()=>tx());break;case`paragraph`:e(()=>Yg());break;case``:break;default:if(t.startsWith(`h`))e(()=>sx(t));else throw Error(`Unknown block type: ${t}`)}},triggerTitle:a(`toolbar.blockTypeSelect.selectBlockTypeTooltip`,`Select block type`),placeholder:a(`toolbar.blockTypeSelect.placeholder`,`Block type`),items:o})},Z0=({format:e,addTitle:t,removeTitle:n,icon:r,formatName:i})=>{let[a,o]=Ld(OO,fk),s=Rd(jO),c=(a&e)!==0;return L.createElement(M1,{title:c?n:t,on:c,onValueChange:()=>{s(i)}},o(r))},Q0=({options:e})=>{let t=Bk(),n=e===void 0;return L.createElement(`div`,{className:J.toolbarGroupOfGroups},n||e.includes(`Bold`)?L.createElement(Z0,{format:1,addTitle:t(`toolbar.bold`,`Bold`),removeTitle:t(`toolbar.removeBold`,`Remove bold`),icon:`format_bold`,formatName:`bold`}):null,n||e.includes(`Italic`)?L.createElement(Z0,{format:2,addTitle:t(`toolbar.italic`,`Italic`),removeTitle:t(`toolbar.removeItalic`,`Remove italic`),icon:`format_italic`,formatName:`italic`}):null,n||e.includes(`Underline`)?L.createElement(Z0,{format:8,addTitle:t(`toolbar.underline`,`Underline`),removeTitle:t(`toolbar.removeUnderline`,`Remove underline`),icon:`format_underlined`,formatName:`underline`}):null)},$0=()=>{let[e,t]=Ld(OO,fk),n=Rd(jO),r=Bk(),i=(e&16)!=0,a=i?r(`toolbar.removeInlineCode`,`Remove code format`):r(`toolbar.inlineCode`,`Inline code format`);return L.createElement(N1,{items:[{title:a,contents:t(`code`),active:i,onChange:n.bind(null,`code`)}]})},e2=()=>{let e=Rd(b1),t=Id(fk),n=Bk();return L.createElement(A1,{"aria-label":n(`toolbar.link`,`Create link`),title:n(`toolbar.link`,`Create link`),onClick:t=>{e()}},t(`link`))},t2=()=>{let e=Rd(cG),t=Id(fk),n=Bk();return L.createElement(A1,{title:n(`toolbar.codeBlock`,`Insert Code Block`),onClick:()=>{e({})}},t(`frame_source`))},n2=()=>{let e=Id(fk),t=Rd(dB),n=Bk(),r=Id(Ok);return L.createElement(A1,{title:n(`toolbar.table`,`Insert Table`),onClick:()=>{t({rows:3,columns:3})},...r?{"aria-disabled":!0,"data-disabled":!0,disabled:!0}:{}},e(`table`))},r2=()=>{let e=Rd(Jj),t=Id(fk),n=Bk();return L.createElement(A1,{title:n(`toolbar.thematicBreak`,`Insert thematic break`),onClick:()=>{e()}},t(`horizontal_rule`))},i2={bullet:`format_list_bulleted`,number:`format_list_numbered`,check:`format_list_checked`},a2=({options:e=[`bullet`,`number`,`check`]})=>{let[t,n,r]=Ld(mM,fk,Ok),i=Rd(hM),a=Bk(),o={bullet:a(`toolbar.bulletedList`,`Bulleted list`),number:a(`toolbar.numberedList`,`Numbered list`),check:a(`toolbar.checkList`,`Check list`)},s=e.map(e=>({value:e,title:o[e],contents:n(i2[e])}));return L.createElement(P1,{value:t||``,items:s,onChange:i,disabled:r})},o2=()=>{let[e,t]=Ld(fk,xO),[n,r]=L.useState(!1),[i,a]=L.useState(!1),o=Bk();return L.useEffect(()=>{if(t)return Xy(t.registerCommand(Em,e=>(r(e),!1),4),t.registerCommand(Tm,e=>(a(e),!1),4))},[t]),L.createElement(N1,{items:[{title:o(`toolbar.undo`,`Undo {{shortcut}}`,{shortcut:Oj?`⌘Z`:`Ctrl+Z`}),disabled:!n,contents:e(`undo`),active:!1,onChange:()=>t?.dispatchCommand($p,void 0)},{title:o(`toolbar.redo`,`Redo {{shortcut}}`,{shortcut:Oj?`⌘Y`:`Ctrl+Y`}),disabled:!i,contents:e(`redo`),active:!1,onChange:()=>t?.dispatchCommand(em,void 0)}]})},s2=900,c2={txt:`Text`,text:`Text`,plaintext:`Plain Text`,md:`Markdown`,ts:`TypeScript`,tsx:`TSX`,js:`JavaScript`,json:`JSON`,css:`CSS`,bash:`Bash`,sh:`Shell`,shell:`Shell`,yaml:`YAML`,yml:`YAML`,toml:`TOML`,cron:`Cron`},l2=(0,L.memo)((0,L.forwardRef)(function({documentKey:e,initialMarkdown:t,onPersist:n,onSaveStateChange:r,readOnly:i=!1},a){let o=(0,L.useRef)(null),s=(0,L.useRef)(e),c=(0,L.useRef)(t),l=(0,L.useRef)(t),u=(0,L.useRef)(null),d=(0,L.useRef)(null),f=(0,L.useRef)(!0),[p,m]=(0,L.useState)(`rich`),[h,g]=(0,L.useState)(t),_=(0,L.useCallback)(()=>{d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),v=(0,L.useCallback)(async()=>{if(i){r(`saved`);return}u.current&&await u.current;let e=c.current;if(e===l.current){r(`saved`);return}r(`saving`);let t=(async()=>{await n(e),l.current=e})();u.current=t;try{if(await t,c.current===l.current){r(`saved`);return}await v()}catch{throw r(`error`),Error(`Autosave failed`)}finally{u.current===t&&(u.current=null)}},[n,r,i]),y=(0,L.useCallback)(()=>{i||(_(),d.current=window.setTimeout(()=>{d.current=null,v()},s2))},[_,v,i]),b=(0,L.useCallback)(e=>{if(f.current){f.current=!1,c.current=e,l.current=e,g(e),r(`saved`);return}if(c.current=e,i){r(`saved`);return}r(`idle`),y()},[r,i,y]),x=(0,L.useMemo)(()=>[Ij(),gM(),KW(),Yj(),PB(),E1(),fB(),uG({defaultCodeBlockLanguage:`txt`,codeBlockEditorDescriptors:[{priority:-10,match:()=>!0,Editor:e1}]}),c1({codeBlockLanguages:c2}),G0(),R1({toolbarContents:()=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(o2,{}),(0,R.jsx)(Q0,{}),(0,R.jsx)($0,{}),(0,R.jsx)(X0,{}),(0,R.jsx)(a2,{}),(0,R.jsx)(e2,{}),(0,R.jsx)(n2,{}),(0,R.jsx)(r2,{}),(0,R.jsx)(t2,{})]})})],[]);return(0,L.useImperativeHandle)(a,()=>({flushSave:async()=>{_(),await v()},getMarkdown:()=>c.current})),(0,L.useEffect)(()=>()=>_(),[_]),(0,L.useEffect)(()=>{let n=s.current!==e,i=t!==l.current;!n&&!i||(s.current=e,_(),u.current=null,c.current=t,l.current=t,f.current=!0,g(t),m(`rich`),r(`saved`))},[e,t,r,_]),p===`plain`||i?(0,R.jsxs)(`div`,{className:`context-files-plain-fallback`,children:[(0,R.jsx)(`p`,{className:`context-files-plain-fallback__notice`,children:i?`This document is read-only. Create a managed copy to edit it.`:`The rich editor could not safely load this document. You are editing raw markdown.`}),(0,R.jsx)(`textarea`,{className:`context-files-plain-fallback__textarea`,value:i?t:h,readOnly:i,onChange:e=>{if(i)return;let t=e.currentTarget.value;g(t),c.current=t,r(`idle`),y()},spellCheck:!1})]}):(0,R.jsx)(Dj,{ref:o,markdown:t,onChange:b,onError:e=>{console.error(`MDXEditor error`,e),g(c.current),m(`plain`)},contentEditableClassName:`context-files-mdx-content`,readOnly:i,plugins:x},e)}));function u2({agentProfiles:e,selectedFileKey:t}){let n=(0,L.useMemo)(()=>[...new Set(e)].sort((e,t)=>e.localeCompare(t)),[e]),r=(0,L.useRef)(null),i=(0,L.useRef)(`saved`),[a,o]=(0,L.useState)([]),[s,c]=(0,L.useState)(null),[l,u]=(0,L.useState)(null),[d,f]=(0,L.useState)([]),[p,m]=(0,L.useState)(null),[h,g]=(0,L.useState)(`saved`),[_,v]=(0,L.useState)(null),[y,b]=(0,L.useState)(null),[x,S]=(0,L.useState)(!0),[C,w]=(0,L.useState)(!1),[T,E]=(0,L.useState)(``),[D,O]=(0,L.useState)(`global`),[k,A]=(0,L.useState)(``),[j,M]=(0,L.useState)(``);(0,L.useEffect)(()=>{i.current=h},[h]);let N=(0,L.useCallback)(async e=>{if(u(e),c(e.key),v(null),b(null),!e.managed){f([]),m(null);return}let[t,n]=await Promise.all([Fs(e.key),e.sourceRef?Is(e.key).catch(()=>null):Promise.resolve(null)]);f(t.revisions),m(n)},[]),P=(0,L.useCallback)(async()=>{let e=await Os();o(e),c(t=>t??e[0]?.key??null)},[]),F=(0,L.useCallback)(async e=>{await N(await ks(e))},[N]);(0,L.useEffect)(()=>{P().catch(e=>b(e instanceof Error?e.message:String(e))).finally(()=>S(!1))},[P]),(0,L.useEffect)(()=>{if(!s){u(null);return}F(s).catch(e=>b(e instanceof Error?e.message:String(e)))},[s,F]),(0,L.useEffect)(()=>{let e=new EventSource(`/api/context-files/events`);return e.addEventListener(`pibo-product`,e=>{let t=b2(e);if(!t?.type.startsWith(`context-file.`))return;P().catch(e=>b(e instanceof Error?e.message:String(e)));let n=t.payload?.key;if(!(!n||n!==s)&&t.source!==`web`){if(i.current===`idle`||i.current===`saving`){v(`This file changed on disk while you had local edits. Review before saving again.`);return}F(n).catch(e=>b(e instanceof Error?e.message:String(e)))}}),e.onerror=()=>{b(`Live context-file updates disconnected.`)},()=>e.close()},[F,P,s]);let ee=(0,L.useMemo)(()=>a.find(e=>e.key===s)??null,[a,s]);(0,L.useEffect)(()=>{M(l?.agentProfileName??``)},[l?.agentProfileName,l?.key]),(0,L.useEffect)(()=>{D!==`agent`||k||n.length===0||A(n[0])},[n,k,D]);let te=(0,L.useCallback)(async e=>{try{await r.current?.flushSave(),await F(e)}catch(e){b(e instanceof Error?e.message:String(e))}},[F]);(0,L.useEffect)(()=>{if(!t||t===s)return;let e=!1;return(async()=>{try{await r.current?.flushSave(),e||c(t)}catch(t){e||b(t instanceof Error?t.message:String(t))}})(),()=>{e=!0}},[t,s]);let ne=(0,L.useCallback)(async()=>{try{let e=await As({label:T.trim()||void 0,scope:D,agentProfileName:D===`agent`?k.trim():void 0,markdown:``});E(``),A(``),await N(e),await P(),b(null)}catch(e){b(e instanceof Error?e.message:String(e))}},[k,T,D,N,P]),re=(0,L.useCallback)(async e=>{if(l)try{await N(await Ms(l.key,{markdown:e,expectedVersion:l.version})),await P(),v(null),b(null)}catch(e){if(x2(e)){await N(e.data.file),v(`This file changed on disk before your save completed. Reload the latest version and retry.`);return}throw b(e instanceof Error?e.message:String(e)),e}},[l,N,P]),I=(0,L.useCallback)(async()=>{s&&(await F(s),await P())},[F,P,s]),ie=(0,L.useCallback)(async()=>{if(ee?.removable)try{await Ps(ee.key,!0),c(null),u(null),await P(),b(null)}catch(e){b(e instanceof Error?e.message:String(e))}},[P,ee]),ae=(0,L.useCallback)(async e=>{if(l?.managed){w(!0);try{await N(await Ns(l.key,{scope:e,agentProfileName:e===`agent`&&j.trim()||void 0})),await P(),b(null)}catch(e){b(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[l,N,j,P]),oe=(0,L.useCallback)(e=>{M(e),!(!l?.managed||!e||l.scope===`agent`&&e===(l.agentProfileName??``))&&(w(!0),Ns(l.key,{scope:`agent`,agentProfileName:e}).then(async e=>{await N(e),await P(),b(null)}).catch(e=>b(e instanceof Error?e.message:String(e))).finally(()=>w(!1)))},[l,N,P]),se=(0,L.useCallback)(async()=>{if(!(!ee||ee.source!==`plugin`)){w(!0);try{let e=await js(ee.key);await P(),await N(e),b(null)}catch(e){b(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[N,P,ee]),ce=(0,L.useCallback)(async()=>{if(!(!l?.managed||!l.sourceRef)){w(!0);try{let e=await Ls(l.key);await P(),await N(e)}catch(e){b(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[l,N,P]),le=(0,L.useCallback)(async()=>{if(!(!l?.managed||l.linkState!==`linked-stale`)){w(!0);try{let e=await Rs(l.key);await P(),await N(e)}catch(e){b(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[l,N,P]),ue=(0,L.useCallback)(async e=>{if(l?.managed){w(!0);try{let t=await zs(l.key,e);await P(),await N(t)}catch(e){b(e instanceof Error?e.message:String(e))}finally{w(!1)}}},[l,N,P]);return(0,R.jsxs)(`div`,{className:`context-files-view grid h-full min-h-0 grid-cols-[minmax(0,1fr)_300px] max-[1120px]:grid-cols-[minmax(0,1fr)_260px]`,children:[(0,R.jsxs)(`main`,{className:`flex min-h-0 flex-col bg-[#101d22]`,children:[(0,R.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-slate-800 bg-[#151f24] px-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:ee?g2(ee):`Context File`}),(0,R.jsx)(`h2`,{className:`truncate text-base font-semibold text-slate-100`,children:l?.label||l?.key||`No file selected`}),l?(0,R.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,children:l.path}):null]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 border px-2.5 text-xs ${p2(h)}`,children:[(0,R.jsx)(ss,{size:14}),f2(h)]}),(0,R.jsx)(`button`,{className:`inline-flex h-8 w-8 items-center justify-center border border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#7dd3fc]`,type:`button`,title:`Reload`,onClick:()=>void I(),children:(0,R.jsx)(as,{size:15})}),(0,R.jsx)(`button`,{className:`inline-flex h-8 w-8 items-center justify-center border border-slate-700 text-slate-400 hover:border-red-500 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-45`,type:`button`,title:`Remove managed file`,disabled:!ee?.removable,onClick:()=>void ie(),children:(0,R.jsx)(ds,{size:15})})]})]}),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-4`,children:[y?(0,R.jsx)(d2,{tone:`error`,text:y}):null,_?(0,R.jsx)(d2,{tone:`warning`,text:_}):null,l?(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border border-slate-800 bg-[#151f24] px-3 py-2 text-xs text-slate-400`,children:[(0,R.jsxs)(`div`,{children:[`State: `,(0,R.jsx)(`span`,{className:`text-slate-100`,children:v2(l.linkState)})]}),l.sourceRef?(0,R.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500`,children:l.sourceRef}):null,l.sourceHash?(0,R.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500`,children:l.sourceHash}):null]}):null,l?.source===`plugin`?(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border border-slate-800 bg-[#151f24] p-3 text-xs text-slate-400`,children:[(0,R.jsx)(`div`,{children:`Plugin context files are immutable in Pibo. Create a managed copy before editing.`}),(0,R.jsx)(`button`,{className:`inline-flex h-8 items-center justify-center border border-[#11a4d4] bg-[#11a4d4]/10 px-3 text-xs uppercase tracking-wider text-[#7dd3fc] disabled:opacity-45`,type:`button`,disabled:C,onClick:()=>void se(),children:`Create Managed Copy`})]}):null,l?.managed?(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border border-slate-800 bg-[#151f24] p-3 text-xs text-slate-400`,children:[(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(`button`,{type:`button`,className:`inline-flex h-8 items-center justify-center border px-3 uppercase tracking-wider ${l.scope===`global`?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 text-slate-400 hover:border-slate-600 hover:text-slate-300`}`,onClick:()=>void ae(`global`),disabled:C,children:`Global`}),(0,R.jsx)(`button`,{type:`button`,className:`inline-flex h-8 items-center justify-center border px-3 uppercase tracking-wider ${l.scope===`agent`?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 text-slate-400 hover:border-slate-600 hover:text-slate-300`}`,onClick:()=>void ae(`agent`),disabled:C||!j.trim(),children:`Agent`})]}),(0,R.jsx)(m2,{value:j,options:h2(n,j),placeholder:`Select agent`,disabled:C,onChange:oe,compact:!0}),l.sourceRef?(0,R.jsx)(`button`,{className:`inline-flex h-8 items-center justify-center border border-[#11a4d4] bg-[#11a4d4]/10 px-3 uppercase tracking-wider text-[#7dd3fc] disabled:opacity-45`,type:`button`,disabled:C,onClick:()=>void ce(),children:`Reset To Source`}):null,l.linkState===`linked-stale`?(0,R.jsx)(`button`,{className:`inline-flex h-8 items-center justify-center border border-amber-400/70 bg-amber-400/10 px-3 uppercase tracking-wider text-amber-100 disabled:opacity-45`,type:`button`,disabled:C,onClick:()=>void le(),children:`Adopt Source`}):null]}):null,l?.exists?(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto border border-slate-800 bg-[#151f24]`,children:(0,R.jsx)(l2,{ref:r,documentKey:`${l.key}:${l.version??l.updatedAt??``}`,initialMarkdown:l.markdown,onPersist:re,onSaveStateChange:g,readOnly:!l.editable})}):(0,R.jsxs)(`div`,{className:`flex items-center gap-2 border border-dashed border-slate-700 bg-[#151f24] px-4 py-5 text-sm text-slate-400`,children:[(0,R.jsx)(fs,{size:18}),l?`The selected file is missing on disk.`:`Select or create a context file.`]}),l?.managed&&d.length>0?(0,R.jsxs)(`div`,{className:`border border-slate-800 bg-[#151f24] p-3`,children:[(0,R.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Revisions`}),(0,R.jsx)(`div`,{className:`space-y-2`,children:d.map(e=>(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border border-slate-800 bg-[#101d22] px-3 py-2 text-xs text-slate-400`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`text-slate-100`,children:[e.kind,` `,e.active?`(active)`:``]}),(0,R.jsx)(`div`,{children:e.note??e.id}),(0,R.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500`,children:e.createdAt})]}),e.active?null:(0,R.jsx)(`button`,{className:`inline-flex h-8 items-center justify-center border border-slate-700 px-3 uppercase tracking-wider text-slate-300 hover:border-[#11a4d4] hover:text-[#7dd3fc] disabled:opacity-45`,type:`button`,disabled:C,onClick:()=>void ue(e.id),children:`Restore`})]},e.id))})]}):null,l?.managed&&p?(0,R.jsxs)(`div`,{className:`border border-slate-800 bg-[#151f24] p-3`,children:[(0,R.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Diff`}),(0,R.jsx)(`div`,{className:`space-y-1 overflow-auto`,children:p.chunks.map((e,t)=>(0,R.jsx)(`pre`,{className:`overflow-auto border px-3 py-2 text-xs ${e.type===`add`?`border-emerald-500/60 bg-emerald-500/10 text-emerald-100`:e.type===`remove`?`border-red-500/60 bg-red-500/10 text-red-100`:`border-slate-800 bg-[#101d22] text-slate-300`}`,children:e.lines.map(t=>`${e.type===`add`?`+`:e.type===`remove`?`-`:` `} ${t}`).join(`
|
|
138
|
+
`)},`${e.type}-${t}`))})]}):null]})]}),(0,R.jsxs)(`aside`,{className:`min-h-0 overflow-auto border-l border-slate-800 bg-[#1a262b]`,children:[(0,R.jsxs)(`div`,{className:`border-b border-slate-800 px-4 py-3`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Context`}),(0,R.jsx)(`h1`,{className:`mt-1 text-sm font-semibold text-slate-100`,children:`Context Files`})]}),(0,R.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,R.jsxs)(`section`,{className:`space-y-2 border border-slate-800 bg-[#151f24] p-3`,children:[(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsxs)(`button`,{className:`inline-flex h-8 items-center justify-center gap-1.5 border px-3 text-xs uppercase tracking-wider ${D===`global`?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 text-slate-400 hover:border-slate-600 hover:text-slate-300`}`,type:`button`,onClick:()=>O(`global`),children:[(0,R.jsx)(Uo,{size:14}),`Global`]}),(0,R.jsxs)(`button`,{className:`inline-flex h-8 items-center justify-center gap-1.5 border px-3 text-xs uppercase tracking-wider ${D===`agent`?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 text-slate-400 hover:border-slate-600 hover:text-slate-300`}`,type:`button`,onClick:()=>O(`agent`),children:[(0,R.jsx)(Wo,{size:14}),`Agent`]})]}),(0,R.jsx)(`input`,{className:`h-9 w-full border border-slate-700 bg-[#0e1116] px-3 text-sm text-slate-200 outline-none placeholder:text-slate-500 focus:border-[#11a4d4]`,value:T,onChange:e=>E(e.currentTarget.value),placeholder:`Context file name`}),D===`agent`?(0,R.jsx)(m2,{value:k,options:n,placeholder:`Select agent`,onChange:A}):null,(0,R.jsx)(`button`,{className:`inline-flex h-9 items-center justify-center border border-[#11a4d4] bg-[#11a4d4] px-3 text-sm font-medium text-white disabled:cursor-not-allowed disabled:opacity-45`,type:`button`,disabled:!T.trim()||D===`agent`&&!k.trim(),onClick:()=>void ne(),children:`Create File`})]}),(0,R.jsxs)(`section`,{className:`space-y-2`,"aria-label":`Context files`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:[(0,R.jsx)(Wo,{size:13}),(0,R.jsxs)(`span`,{children:[a.length,` Files`]})]}),x?(0,R.jsx)(`div`,{className:`border border-dashed border-slate-700 px-3 py-4 text-xs text-slate-500`,children:`Loading`}):null,(0,R.jsx)(`div`,{className:`space-y-1`,children:a.map(e=>(0,R.jsxs)(`button`,{type:`button`,className:`block w-full border px-3 py-2 text-left ${e.key===s?`border-[#11a4d4] bg-[#101d22]`:`border-transparent text-slate-300 hover:border-slate-700 hover:bg-[#101d22]`}`,onClick:()=>void te(e.key),children:[(0,R.jsx)(`div`,{className:`truncate text-sm font-medium text-slate-100`,children:e.label||e.key}),(0,R.jsx)(`div`,{className:`mt-0.5 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-[11px] text-slate-500`,children:e.path}),(0,R.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex border px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${_2(e)}`,children:g2(e)}),(0,R.jsx)(`span`,{className:`inline-flex border px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${y2(e.linkState)}`,children:v2(e.linkState)}),e.exists?null:(0,R.jsx)(`span`,{className:`inline-flex border border-amber-400/70 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-amber-200`,children:`Missing`})]})]},e.key))}),!x&&a.length===0?(0,R.jsx)(`div`,{className:`border border-dashed border-slate-700 px-3 py-4 text-xs text-slate-500`,children:`No context files registered`}):null]})]})]})]})}function d2({tone:e,text:t}){return(0,R.jsx)(`div`,{className:`border px-3 py-2 text-sm ${e===`error`?`border-red-500/80 bg-red-500/10 text-red-200`:`border-amber-400/80 bg-amber-400/10 text-amber-100`}`,children:t})}function f2(e){return e===`saving`?`Saving`:e===`saved`?`Saved`:e===`error`?`Error`:`Unsaved`}function p2(e){return e===`saving`?`border-orange-400/80 bg-orange-400/10 text-orange-100`:e===`saved`?`border-emerald-500/80 bg-emerald-500/10 text-emerald-100`:e===`error`?`border-red-500/80 bg-red-500/10 text-red-200`:`border-amber-400/80 bg-amber-400/10 text-amber-100`}function m2({value:e,options:t,placeholder:n,disabled:r=!1,onChange:i,compact:a=!1}){return(0,R.jsxs)(`div`,{className:`relative ${a?`min-w-[16rem] flex-1`:``}`,children:[(0,R.jsxs)(`select`,{className:`w-full appearance-none border border-slate-700 bg-[#0e1116] pr-9 text-slate-200 outline-none focus:border-[#11a4d4] disabled:cursor-not-allowed disabled:opacity-60 ${a?`h-8 px-3 text-xs`:`h-9 px-3 text-sm`}`,value:e,disabled:r||t.length===0,onChange:e=>i(e.currentTarget.value),children:[e?null:(0,R.jsx)(`option`,{value:``,children:n}),t.length===0?(0,R.jsx)(`option`,{value:``,children:n}):null,t.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]}),(0,R.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 right-3 inline-flex items-center text-slate-500`,children:(0,R.jsx)(No,{size:14})})]})}function h2(e,t){return!t||e.includes(t)?e:[t,...e]}function g2(e){return e.source===`plugin`?`Plugin Global`:e.scope===`agent`?e.agentProfileName?`Agent ${e.agentProfileName}`:`Agent Local`:`Global`}function _2(e){return e.source===`plugin`?`border-cyan-500/70 text-cyan-200`:e.scope===`agent`?`border-fuchsia-500/70 text-fuchsia-200`:`border-[#11a4d4]/80 text-[#7dd3fc]`}function v2(e){return e===`plugin-only`?`Plugin Only`:e===`linked-clean`?`Linked Clean`:e===`linked-dirty`?`Linked Dirty`:e===`linked-stale`?`Linked Stale`:e===`orphaned`?`Orphaned`:`Managed Unlinked`}function y2(e){return e===`plugin-only`?`border-cyan-500/70 text-cyan-200`:e===`linked-clean`?`border-emerald-500/70 text-emerald-200`:e===`linked-dirty`?`border-orange-400/70 text-orange-100`:e===`linked-stale`?`border-amber-400/70 text-amber-100`:e===`orphaned`?`border-red-500/70 text-red-200`:`border-slate-600 text-slate-300`}function b2(e){try{let t=JSON.parse(e.data);return t&&typeof t.type==`string`?t:void 0}catch{return}}function x2(e){return typeof e==`object`&&!!e&&`status`in e&&e.status===409&&`data`in e&&typeof e.data==`object`&&e.data?.file!==void 0}function S2(){let[e,t]=(0,L.useState)(null),[n,r]=(0,L.useState)(`library`),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(`saved`),[c,l]=(0,L.useState)(!0),[u,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(null),m=(0,L.useCallback)(async()=>{l(!0);try{let e=await xs();t(e),r(e.effectiveMode),a(e.custom.exists?e.custom.markdown:e.library.markdown),s(`saved`),p(null)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(!1)}},[]);(0,L.useEffect)(()=>{m()},[m]);let h=(0,L.useMemo)(()=>e?n===`library`?e.library.markdown:i:``,[i,e,n]),g=(0,L.useCallback)(async e=>{d(!0);try{let n=await Ss(e);t(n),r(e),a(n.custom.exists?n.custom.markdown:n.library.markdown),s(`saved`),p(null)}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}},[]),_=(0,L.useCallback)(async()=>{d(!0),s(`saving`);try{let e=await Cs(i);t(e),r(`custom`),a(e.custom.markdown),s(`saved`),p(null)}catch(e){s(`error`),p(e instanceof Error?e.message:String(e))}finally{d(!1)}},[i]),v=e?.effectiveMode===`custom`;return(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[#101d22]`,children:[(0,R.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-slate-800 bg-[#151f24] px-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Base Prompt`}),(0,R.jsx)(`h2`,{className:`truncate text-base font-semibold text-slate-100`,children:e?.effectiveMode===`custom`?`Custom Base Prompt`:`Library Base Prompt`}),(0,R.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,children:e?e.effectiveMode===`custom`?e.custom.path:e.library.path:`loading`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 border px-2.5 text-xs ${v?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 bg-[#101d22] text-slate-300`}`,children:[(0,R.jsx)(Oo,{size:14}),`Active: `,e?.effectiveMode??`library`]}),(0,R.jsx)(`button`,{type:`button`,title:`Reload`,onClick:()=>void m(),className:`inline-flex h-8 w-8 items-center justify-center border border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#7dd3fc]`,children:(0,R.jsx)(as,{size:15})})]})]}),(0,R.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[250px_minmax(0,1fr)] max-[980px]:grid-cols-1`,children:[(0,R.jsxs)(`aside`,{className:`border-r border-slate-800 bg-[#151f24] p-3 max-[980px]:border-b max-[980px]:border-r-0`,children:[(0,R.jsx)(`div`,{className:`mb-3 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Source`}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r(`library`),className:`mb-2 w-full border p-2 text-left ${n===`library`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#101d22] hover:border-slate-700`}`,children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`block text-sm text-slate-200`,children:`Library`}),v?null:(0,R.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-[#7dd3fc]`,children:`Active`})]}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`read-only`})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r(`custom`),className:`mb-4 w-full border p-2 text-left ${n===`custom`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#101d22] hover:border-slate-700`}`,children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`block text-sm text-slate-200`,children:`Custom`}),v?(0,R.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-[#7dd3fc]`,children:`Active`}):null]}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:e?.custom.exists?`editable`:`not-created`})]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(C2,{checked:v,disabled:u||!e,onToggle:()=>void g(v?`library`:`custom`)}),(0,R.jsxs)(`button`,{type:`button`,disabled:u||n!==`custom`,onClick:()=>void _(),className:`inline-flex h-8 w-full items-center justify-center gap-2 border border-slate-700 bg-[#101d22] px-3 text-xs uppercase tracking-wider text-slate-300 hover:border-[#11a4d4] hover:text-[#7dd3fc] disabled:cursor-not-allowed disabled:opacity-45`,children:[(0,R.jsx)(ss,{size:14}),o===`saving`?`Saving`:`Save Custom`]})]})]}),(0,R.jsxs)(`main`,{className:`flex min-h-0 flex-col gap-3 p-4`,children:[f?(0,R.jsx)(`div`,{className:`border border-red-500/50 bg-red-500/10 px-3 py-2 text-sm text-red-200`,children:f}):null,c?(0,R.jsx)(`div`,{className:`border border-slate-800 bg-[#151f24] p-4 text-sm text-slate-400`,children:`Loading base prompt...`}):(0,R.jsx)(`textarea`,{value:h,readOnly:n===`library`,onChange:e=>{a(e.target.value),s(`idle`)},spellCheck:!1,className:`min-h-0 flex-1 resize-none border border-slate-800 bg-[#0e1116] p-4 font-mono text-xs leading-5 text-slate-200 outline-none focus:border-[#11a4d4] read-only:text-slate-400`})]})]})]})}function C2({checked:e,disabled:t,onToggle:n}){return(0,R.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":e,onClick:n,className:`flex w-full items-center gap-2 border border-slate-800 bg-[#101d22] p-2 text-left text-sm text-slate-300 hover:border-slate-700 hover:text-slate-100 disabled:cursor-not-allowed disabled:opacity-60`,children:[(0,R.jsx)(w2,{checked:e,disabled:t}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate`,children:`Use custom base prompt`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:e?`custom active`:`library active`})]})]})}function w2({checked:e,disabled:t}){return(0,R.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border ${e?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-600 text-transparent`} ${t?`opacity-70`:``}`,children:e?(0,R.jsx)(Mo,{size:12}):null})}function T2(){let[e,t]=(0,L.useState)(null),[n,r]=(0,L.useState)(`library`),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(`saved`),[c,l]=(0,L.useState)(!0),[u,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(null),m=(0,L.useCallback)(async()=>{l(!0);try{let e=await ws();t(e),r(e.effectiveMode),a(e.custom.exists?e.custom.markdown:e.library.markdown),s(`saved`),p(null)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(!1)}},[]);(0,L.useEffect)(()=>{m()},[m]);let h=(0,L.useMemo)(()=>e?n===`library`?e.library.markdown:i:``,[i,e,n]),g=(0,L.useCallback)(async e=>{d(!0);try{let n=await Ts(e);t(n),r(e),a(n.custom.exists?n.custom.markdown:n.library.markdown),s(`saved`),p(null)}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}},[]),_=(0,L.useCallback)(async()=>{d(!0),s(`saving`);try{let e=await Es(i);t(e),r(`custom`),a(e.custom.markdown),s(`saved`),p(null)}catch(e){s(`error`),p(e instanceof Error?e.message:String(e))}finally{d(!1)}},[i]),v=e?.effectiveMode===`custom`;return(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[#101d22]`,children:[(0,R.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-slate-800 bg-[#151f24] px-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Compaction Prompt`}),(0,R.jsx)(`h2`,{className:`truncate text-base font-semibold text-slate-100`,children:e?.effectiveMode===`custom`?`Custom Compaction Prompt`:`Library Compaction Prompt`}),(0,R.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,children:e?e.effectiveMode===`custom`?e.custom.path:e.library.path:`loading`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 border px-2.5 text-xs ${v?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#7dd3fc]`:`border-slate-700 bg-[#101d22] text-slate-300`}`,children:[(0,R.jsx)(Ao,{size:14}),`Active: `,e?.effectiveMode??`library`]}),(0,R.jsx)(`button`,{type:`button`,title:`Reload`,onClick:()=>void m(),className:`inline-flex h-8 w-8 items-center justify-center border border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#7dd3fc]`,children:(0,R.jsx)(as,{size:15})})]})]}),(0,R.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[250px_minmax(0,1fr)] max-[980px]:grid-cols-1`,children:[(0,R.jsxs)(`aside`,{className:`border-r border-slate-800 bg-[#151f24] p-3 max-[980px]:border-b max-[980px]:border-r-0`,children:[(0,R.jsx)(`div`,{className:`mb-3 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Source`}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r(`library`),className:`mb-2 w-full border p-2 text-left ${n===`library`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#101d22] hover:border-slate-700`}`,children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`block text-sm text-slate-200`,children:`Library`}),v?null:(0,R.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-[#7dd3fc]`,children:`Active`})]}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`read-only`})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r(`custom`),className:`mb-4 w-full border p-2 text-left ${n===`custom`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#101d22] hover:border-slate-700`}`,children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`block text-sm text-slate-200`,children:`Custom`}),v?(0,R.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-[#7dd3fc]`,children:`Active`}):null]}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:e?.custom.exists?`editable`:`not-created`})]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(E2,{checked:v,disabled:u||!e,onToggle:()=>void g(v?`library`:`custom`)}),(0,R.jsxs)(`button`,{type:`button`,disabled:u||n!==`custom`,onClick:()=>void _(),className:`inline-flex h-8 w-full items-center justify-center gap-2 border border-slate-700 bg-[#101d22] px-3 text-xs uppercase tracking-wider text-slate-300 hover:border-[#11a4d4] hover:text-[#7dd3fc] disabled:cursor-not-allowed disabled:opacity-45`,children:[(0,R.jsx)(ss,{size:14}),o===`saving`?`Saving`:`Save Custom`]})]})]}),(0,R.jsxs)(`main`,{className:`flex min-h-0 flex-col gap-3 p-4`,children:[f?(0,R.jsx)(`div`,{className:`border border-red-500/50 bg-red-500/10 px-3 py-2 text-sm text-red-200`,children:f}):null,c?(0,R.jsx)(`div`,{className:`border border-slate-800 bg-[#151f24] p-4 text-sm text-slate-400`,children:`Loading compaction prompt...`}):(0,R.jsx)(`textarea`,{value:h,readOnly:n===`library`,onChange:e=>{a(e.target.value),s(`idle`)},spellCheck:!1,className:`min-h-0 flex-1 resize-none border border-slate-800 bg-[#0e1116] p-4 font-mono text-xs leading-5 text-slate-200 outline-none focus:border-[#11a4d4] read-only:text-slate-400`})]})]})]})}function E2({checked:e,disabled:t,onToggle:n}){return(0,R.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":e,onClick:n,className:`flex w-full items-center gap-2 border border-slate-800 bg-[#101d22] p-2 text-left text-sm text-slate-300 hover:border-slate-700 hover:text-slate-100 disabled:cursor-not-allowed disabled:opacity-60`,children:[(0,R.jsx)(D2,{checked:e,disabled:t}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate`,children:`Use custom compaction prompt`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:e?`custom active`:`library active`})]})]})}function D2({checked:e,disabled:t}){return(0,R.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border ${e?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-600 text-transparent`} ${t?`opacity-70`:``}`,children:e?(0,R.jsx)(Mo,{size:12}):null})}function O2(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var k2=/[ \t\n\f\r]/g;function A2(e){return typeof e==`object`?e.type===`text`?j2(e.value):!1:j2(e)}function j2(e){return e.replace(k2,``)===``}var M2=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};M2.prototype.normal={},M2.prototype.property={},M2.prototype.space=void 0;function N2(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new M2(n,r,t)}function P2(e){return e.toLowerCase()}var F2=class{constructor(e,t){this.attribute=t,this.property=e}};F2.prototype.attribute=``,F2.prototype.booleanish=!1,F2.prototype.boolean=!1,F2.prototype.commaOrSpaceSeparated=!1,F2.prototype.commaSeparated=!1,F2.prototype.defined=!1,F2.prototype.mustUseProperty=!1,F2.prototype.number=!1,F2.prototype.overloadedBoolean=!1,F2.prototype.property=``,F2.prototype.spaceSeparated=!1,F2.prototype.space=void 0;var I2=e({boolean:()=>R2,booleanish:()=>z2,commaOrSpaceSeparated:()=>U2,commaSeparated:()=>H2,number:()=>$,overloadedBoolean:()=>B2,spaceSeparated:()=>V2}),L2=0,R2=W2(),z2=W2(),B2=W2(),$=W2(),V2=W2(),H2=W2(),U2=W2();function W2(){return 2**++L2}var G2=Object.keys(I2),K2=class extends F2{constructor(e,t,n,r){let i=-1;if(super(e,t),q2(this,`space`,r),typeof n==`number`)for(;++i<G2.length;){let e=G2[i];q2(this,G2[i],(n&I2[e])===I2[e])}}};K2.prototype.defined=!0;function q2(e,t,n){n&&(e[t]=n)}function J2(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new K2(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[P2(r)]=r,n[P2(a.attribute)]=r}return new M2(t,n,e.space)}var Y2=J2({properties:{ariaActiveDescendant:null,ariaAtomic:z2,ariaAutoComplete:null,ariaBusy:z2,ariaChecked:z2,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:V2,ariaCurrent:null,ariaDescribedBy:V2,ariaDetails:null,ariaDisabled:z2,ariaDropEffect:V2,ariaErrorMessage:null,ariaExpanded:z2,ariaFlowTo:V2,ariaGrabbed:z2,ariaHasPopup:null,ariaHidden:z2,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V2,ariaLevel:$,ariaLive:null,ariaModal:z2,ariaMultiLine:z2,ariaMultiSelectable:z2,ariaOrientation:null,ariaOwns:V2,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:z2,ariaReadOnly:z2,ariaRelevant:null,ariaRequired:z2,ariaRoleDescription:V2,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:z2,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function X2(e,t){return t in e?e[t]:t}function Z2(e,t){return X2(e,t.toLowerCase())}var Q2=J2({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:H2,acceptCharset:V2,accessKey:V2,action:null,allow:null,allowFullScreen:R2,allowPaymentRequest:R2,allowUserMedia:R2,alt:null,as:null,async:R2,autoCapitalize:null,autoComplete:V2,autoFocus:R2,autoPlay:R2,blocking:V2,capture:null,charSet:null,checked:R2,cite:null,className:V2,cols:$,colSpan:null,content:null,contentEditable:z2,controls:R2,controlsList:V2,coords:$|H2,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R2,defer:R2,dir:null,dirName:null,disabled:R2,download:B2,draggable:z2,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R2,formTarget:null,headers:V2,height:$,hidden:B2,high:$,href:null,hrefLang:null,htmlFor:V2,httpEquiv:V2,id:null,imageSizes:null,imageSrcSet:null,inert:R2,inputMode:null,integrity:null,is:null,isMap:R2,itemId:null,itemProp:V2,itemRef:V2,itemScope:R2,itemType:V2,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R2,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:R2,muted:R2,name:null,nonce:null,noModule:R2,noValidate:R2,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:R2,optimum:$,pattern:null,ping:V2,placeholder:null,playsInline:R2,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R2,referrerPolicy:null,rel:V2,required:R2,reversed:R2,rows:$,rowSpan:$,sandbox:V2,scope:null,scoped:R2,seamless:R2,selected:R2,shadowRootClonable:R2,shadowRootDelegatesFocus:R2,shadowRootMode:null,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:z2,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:R2,useMap:null,value:z2,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V2,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R2,declare:R2,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:R2,noHref:R2,noShade:R2,noWrap:R2,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:z2,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:R2,disableRemotePlayback:R2,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:Z2}),$2=J2({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:U2,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:V2,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:R2,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:H2,g2:H2,glyphName:H2,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:U2,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V2,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:U2,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:U2,rev:U2,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:U2,requiredFeatures:U2,requiredFonts:U2,requiredFormats:U2,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:U2,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:U2,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:U2,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:X2}),e4=J2({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),t4=J2({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Z2}),n4=J2({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),r4={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},i4=/[A-Z]/g,a4=/-[a-z]/g,o4=/^data[-\w.:]+$/i;function s4(e,t){let n=P2(t),r=t,i=F2;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&o4.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(a4,l4);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!a4.test(e)){let n=e.replace(i4,c4);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=K2}return new i(r,t)}function c4(e){return`-`+e.toLowerCase()}function l4(e){return e.charAt(1).toUpperCase()}var u4=N2([Y2,Q2,e4,t4,n4],`html`),d4=N2([Y2,$2,e4,t4,n4],`svg`);function f4(e){return e.join(` `).trim()}var p4=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
139
|
+
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),m4=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(p4());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),h4=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),g4=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(m4()),r=h4();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),_4=y4(`end`),v4=y4(`start`);function y4(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function b4(e){let t=v4(e),n=_4(e);if(t&&n)return{start:t,end:n}}var x4=t(g4(),1),S4={}.hasOwnProperty,C4=new Map,w4=/[A-Z]/g,T4=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),E4=new Set([`td`,`th`]),D4=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function O4(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=z4(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=R4(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?d4:u4,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=k4(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function k4(e,t,n){if(t.type===`element`)return A4(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return j4(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return N4(e,t,n);if(t.type===`mdxjsEsm`)return M4(e,t);if(t.type===`root`)return P4(e,t,n);if(t.type===`text`)return F4(e,t)}function A4(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=d4,e.schema=i),e.ancestors.push(t);let a=G4(e,t.tagName,!1),o=B4(e,t),s=H4(e,t);return T4.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!A2(e):!0})),I4(e,o,a,t),L4(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function j4(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}K4(e,t.position)}function M4(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);K4(e,t.position)}function N4(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=d4,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:G4(e,t.name,!0),o=V4(e,t),s=H4(e,t);return I4(e,o,a,t),L4(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function P4(e,t,n){let r={};return L4(r,H4(e,t)),e.create(t,e.Fragment,r,n)}function F4(e,t){return t.value}function I4(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function L4(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function R4(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function z4(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=v4(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function B4(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&S4.call(t.properties,i)){let a=U4(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&E4.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function V4(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else K4(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else K4(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function H4(e,t){let n=[],r=-1,i=e.passKeys?new Map:C4;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=k4(e,a,o);s!==void 0&&n.push(s)}return n}function U4(e,t,n){let r=s4(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?O2(n):f4(n)),r.property===`style`){let t=typeof n==`object`?n:W4(e,String(n));return e.stylePropertyNameCase===`css`&&(t=q4(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?r4[r.property]||r.property:r.attribute,n]}}function W4(e,t){try{return(0,x4.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new uS("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=D4+`#cannot-parse-style-attribute`,r}}function G4(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=OC(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=OC(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return S4.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);K4(e)}function K4(e,t){let n=new uS("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=D4+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function q4(e){let t={},n;for(n in e)S4.call(e,n)&&(t[J4(n)]=e[n]);return t}function J4(e){let t=e.replace(w4,Y4);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Y4(e){return`-`+e.toLowerCase()}var X4={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]};function Z4(e){let t=this;t.parser=n;function n(n){return ID(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Q4(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function $4(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
140
|
+
`}]}function e3(e,t){let n=t.value?t.value+`
|
|
141
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function t3(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function n3(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function r3(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=_E(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function i3(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function a3(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function o3(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function s3(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return o3(e,t);let i={src:_E(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function c3(e,t){let n={src:_E(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function l3(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function u3(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return o3(e,t);let i={href:_E(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function d3(e,t){let n={href:_E(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function f3(e,t,n){let r=e.all(t),i=n?p3(n):m3(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
142
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
143
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function p3(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=m3(n[r])}return t}function m3(e){return e.spread??e.children.length>1}function h3(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function g3(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _3(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function v3(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function y3(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=v4(t.children[1]),o=_4(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function b3(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function x3(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var S3=9,C3=32;function w3(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(T3(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(T3(t.slice(i),i>0,!1)),a.join(``)}function T3(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===S3||t===C3;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===S3||t===C3;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function E3(e,t){let n={type:`text`,value:w3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function D3(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var O3={blockquote:Q4,break:$4,code:e3,delete:t3,emphasis:n3,footnoteReference:r3,heading:i3,html:a3,imageReference:s3,image:c3,inlineCode:l3,linkReference:u3,link:d3,listItem:f3,list:h3,paragraph:g3,root:_3,strong:v3,table:y3,tableCell:x3,tableRow:b3,text:E3,thematicBreak:D3,toml:k3,yaml:k3,definition:k3,footnoteDefinition:k3};function k3(){}var A3=typeof self==`object`?self:globalThis,j3=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new A3[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new A3[a](o),i)};return r},M3=e=>j3(new Map,e)(0),N3=``,{toString:P3}={},{keys:F3}=Object,I3=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=P3.call(e).slice(8,-1);switch(n){case`Array`:return[1,N3];case`Object`:return[2,N3];case`Date`:return[3,N3];case`RegExp`:return[4,N3];case`Map`:return[5,N3];case`Set`:return[6,N3];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},L3=([e,t])=>e===0&&(t===`function`||t===`symbol`),R3=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=I3(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of F3(r))(e||!L3(I3(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(L3(I3(n))||L3(I3(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!L3(I3(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},z3=(e,{json:t,lossy:n}={})=>{let r=[];return R3(!(t||n),!!t,new Map,r)(e),r},B3=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?M3(z3(e,t)):structuredClone(e):(e,t)=>M3(z3(e,t));function V3(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function H3(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function U3(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||V3,r=e.options.footnoteBackLabel||H3,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=_E(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...B3(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
144
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
145
|
+
`}]}}var W3={}.hasOwnProperty,G3={};function K3(e,t){let n=t||G3,r=new Map,i=new Map,a={all:s,applyData:J3,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...O3,...n.handlers},one:o,options:n,patch:q3,wrap:X3};return Hw(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(W3.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=B3(n);return r.children=a.all(e),r}return B3(e)}return(a.options.unknownHandler||Y3)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Z3(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Z3(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function q3(e,t){e.position&&(t.position=b4(e))}function J3(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,B3(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Y3(e,t){let n=t.data||{},r=`value`in t&&!(W3.call(n,`hProperties`)||W3.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function X3(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
146
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
147
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
148
|
+
`}),n}function Z3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Q3(e,t){let n=K3(e,t),r=n.one(e,void 0),i=U3(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
149
|
+
`},i)),a}function $3(e,t){return e&&`run`in e?async function(n,r){let i=Q3(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Q3(n,{file:r,...e||t})}}function e6(e){if(e)throw e}var t6=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function n6(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function r6(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?i6(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function i6(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var a6={basename:o6,dirname:s6,extname:c6,join:l6,sep:`/`};function o6(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);f6(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function s6(e){if(f6(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function c6(e){f6(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function l6(...e){let t=-1,n;for(;++t<e.length;)f6(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:u6(n)}function u6(e){f6(e);let t=e.codePointAt(0)===47,n=d6(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function d6(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function f6(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var p6={cwd:m6};function m6(){return`/`}function h6(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function g6(e){if(typeof e==`string`)e=new URL(e);else if(!h6(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return _6(e)}function _6(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var v6=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],y6=class{constructor(e){let t;t=e?h6(e)?{path:e}:typeof e==`string`||C6(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:p6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<v6.length;){let e=v6[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)v6.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?a6.basename(this.path):void 0}set basename(e){x6(e,`basename`),b6(e,`basename`),this.path=a6.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?a6.dirname(this.path):void 0}set dirname(e){S6(this.basename,`dirname`),this.path=a6.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?a6.extname(this.path):void 0}set extname(e){if(b6(e,`extname`),S6(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=a6.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){h6(e)&&(e=g6(e)),x6(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?a6.basename(this.path,this.extname):void 0}set stem(e){x6(e,`stem`),b6(e,`stem`),this.path=a6.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new uS(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function b6(e,t){if(e&&e.includes(a6.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+a6.sep+"`")}function x6(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function S6(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function C6(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var w6=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),T6=t(t6(),1),E6={}.hasOwnProperty,D6=new class e extends w6{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=r6()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,T6.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(A6(`data`,this.frozen),this.namespace[e]=t,this):E6.call(this.namespace,e)&&this.namespace[e]||void 0:e?(A6(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=N6(e),n=this.parser||this.Parser;return O6(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),O6(`process`,this.parser||this.Parser),k6(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=N6(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);F6(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),O6(`processSync`,this.parser||this.Parser),k6(`processSync`,this.compiler||this.Compiler),this.process(e,r),M6(`processSync`,`process`,t),n;function r(e,r){t=!0,e6(e),n=r}}run(e,t,n){j6(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=N6(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),M6(`runSync`,`run`,n),r;function i(e,t){e6(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=N6(t),r=this.compiler||this.Compiler;return k6(`stringify`,r),j6(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(A6(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,T6.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];n6(o)&&n6(r)&&(r=(0,T6.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function O6(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function k6(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function A6(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function j6(e){if(!n6(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function M6(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function N6(e){return P6(e)?e:new y6(e)}function P6(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function F6(e){return typeof e==`string`||I6(e)}function I6(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var L6=[],R6={allowDangerousHtml:!0},z6=/^(https?|ircs?|mailto|xmpp)$/i,B6=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function V6(e){let t=H6(e),n=U6(e);return W6(t.runSync(t.parse(n),n),e)}function H6(e){let t=e.rehypePlugins||L6,n=e.remarkPlugins||L6,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...R6}:R6;return D6().use(Z4).use(n).use($3,r).use(t)}function U6(e){let t=e.children||``,n=new y6;return typeof t==`string`?n.value=t:``+t,n}function W6(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||G6;for(let e of B6)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Hw(e,l),O4(e,{Fragment:R.Fragment,components:i,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in X4)if(Object.hasOwn(X4,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=X4[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function G6(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||z6.test(e.slice(0,t))?e:``}function K6(e,t,n){let r=jw((n||{}).ignore||[]),i=q6(t),a=-1;for(;++a<i.length;)Bw(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function q6(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([J6(e[0]),Y6(e[1])])}return t}function J6(e){return typeof e==`string`?new RegExp(UW(e),`g`):e}function Y6(e){return typeof e==`function`?e:function(){return e}}var X6=`phrasing`,Z6=[`autolink`,`link`,`image`,`label`];function Q6(){return{transforms:[o8],enter:{literalAutolink:e8,literalAutolinkEmail:t8,literalAutolinkHttp:t8,literalAutolinkWww:t8},exit:{literalAutolink:a8,literalAutolinkEmail:i8,literalAutolinkHttp:n8,literalAutolinkWww:r8}}}function $6(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:X6,notInConstruct:Z6},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:X6,notInConstruct:Z6},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:X6,notInConstruct:Z6}]}}function e8(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function t8(e){this.config.enter.autolinkProtocol.call(this,e)}function n8(e){this.config.exit.autolinkProtocol.call(this,e)}function r8(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function i8(e){this.config.exit.autolinkEmail.call(this,e)}function a8(e){this.exit(e)}function o8(e){K6(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,s8],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,c8]],{ignore:[`link`,`linkReference`]})}function s8(e,t,n,r,i){let a=``;if(!d8(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!l8(n)))return!1;let o=u8(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function c8(e,t,n,r){return!d8(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function l8(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function u8(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Gx(e,`(`),a=Gx(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function d8(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Ex(n)||Tx(n))&&(!t||n!==47)}x8.peek=b8;function f8(){this.buffer()}function p8(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function m8(){this.buffer()}function h8(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function g8(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gE(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _8(e){this.exit(e)}function v8(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gE(this.sliceSerialize(e)).toLowerCase(),n.label=t}function y8(e){this.exit(e)}function b8(){return`[`}function x8(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function S8(){return{enter:{gfmFootnoteCallString:f8,gfmFootnoteCall:p8,gfmFootnoteDefinitionLabelString:m8,gfmFootnoteDefinition:h8},exit:{gfmFootnoteCallString:g8,gfmFootnoteCall:_8,gfmFootnoteDefinitionLabelString:v8,gfmFootnoteDefinition:y8}}}function C8(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:x8},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
150
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?T8:w8))),s(),o}}function w8(e,t,n){return t===0?e:T8(e,t,n)}function T8(e,t,n){return(n?``:` `)+e}function E8(){return[Q6(),S8(),Mx(),CM(),cM()]}function D8(e){return{extensions:[$6(),C8(e),Nx(),jM(e),lM()]}}var O8={tokenize:H8,partial:!0},k8={tokenize:U8,partial:!0},A8={tokenize:W8,partial:!0},j8={tokenize:G8,partial:!0},M8={tokenize:K8,partial:!0},N8={name:`wwwAutolink`,tokenize:B8,previous:q8},P8={name:`protocolAutolink`,tokenize:V8,previous:J8},F8={name:`emailAutolink`,tokenize:z8,previous:Y8},I8={};function L8(){return{text:I8}}for(var R8=48;R8<123;)I8[R8]=F8,R8++,R8===58?R8=65:R8===91&&(R8=97);I8[43]=F8,I8[45]=F8,I8[46]=F8,I8[95]=F8,I8[72]=[F8,P8],I8[104]=[F8,P8],I8[87]=[F8,N8],I8[119]=[F8,N8];function z8(e,t,n){let r=this,i,a;return o;function o(t){return!X8(t)||!Y8.call(r,r.previous)||Z8(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return X8(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(M8,u,l)(t):t===45||t===95||_x(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&gx(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function B8(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!q8.call(r,r.previous)||Z8(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(O8,e.attempt(k8,e.attempt(A8,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function V8(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&J8.call(r,r.previous)&&!Z8(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(gx(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||yx(t)||Cx(t)||Ex(t)||Tx(t)?n(t):e.attempt(k8,e.attempt(A8,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function H8(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function U8(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(j8,c,s)(t):t===null||Cx(t)||Ex(t)||t!==45&&Tx(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function W8(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(j8,t,a)(o):o===null||Cx(o)||Ex(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function G8(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Cx(o)||Ex(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Cx(e)||Ex(e)?t(e):r(e)}function a(e){return gx(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):gx(t)?(e.consume(t),o):n(t)}}function K8(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return _x(e)?n(e):t(e)}}function q8(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Cx(e)}function J8(e){return!gx(e)}function Y8(e){return!(e===47||X8(e))}function X8(e){return e===43||e===45||e===46||e===95||_x(e)}function Z8(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Q8={tokenize:o5,partial:!0};function $8(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:r5,continuation:{tokenize:i5},exit:a5}},text:{91:{name:`gfmFootnoteCall`,tokenize:n5},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:e5,resolveTo:t5}}}}function e5(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=gE(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function t5(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function n5(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Cx(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(gE(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Cx(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function r5(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Cx(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=gE(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Cx(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),kC(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function i5(e,t,n){return e.check(AE,t,e.attempt(Q8,t,n))}function a5(e){e.exit(`gfmFootnoteDefinition`)}function o5(e,t,n){let r=this;return kC(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function s5(e){return pE([L8(),$8(),Ax(e),FM(),aM()])}var c5={};function l5(e){let t=this,n=e||c5,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(s5(n)),a.push(E8()),o.push(D8(n))}(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(Prism),Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},Prism.languages.webmanifest=Prism.languages.json,(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(Prism);var u5=[`p`,`br`,`strong`,`em`,`a`,`ul`,`ol`,`li`,`blockquote`,`code`,`pre`,`h1`,`h2`,`h3`,`h4`,`hr`,`table`,`thead`,`tbody`,`tr`,`th`,`td`,`input`,`del`],d5={a({href:e,children:t}){return(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:t})},code({className:e,children:t,node:n,...r}){let i=f5(e),a=String(t).replace(/\n$/,``);if(!i)return(0,R.jsx)(`code`,{className:e,...r,children:t});let o=yd.languages[i];return o?(0,R.jsx)(`code`,{className:`language-${i}`,dangerouslySetInnerHTML:{__html:yd.highlight(a,o,i)},...r}):(0,R.jsx)(`code`,{className:e,...r,children:t})},th({children:e}){return(0,R.jsx)(`th`,{children:e})},td({children:e}){return(0,R.jsx)(`td`,{children:e})},input({checked:e,node:t,...n}){return(0,R.jsx)(`input`,{type:`checkbox`,checked:!!e,readOnly:!0,disabled:!0,...n})}};function f5(e){let t=/language-(\S+)/.exec(e??``);if(!t)return;let n=t[1].toLowerCase();return n===`sh`||n===`shell`?`bash`:n===`js`?`javascript`:n===`ts`?`typescript`:n===`md`?`markdown`:n===`yml`?`yaml`:n}var p5=(e,t,n)=>{if(n.tagName!==`a`||t!==`href`)return``;let r=G6(e);if(!r)return``;if(r.startsWith(`/`)||r.startsWith(`#`))return r;try{let e=new URL(r);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`mailto:`?r:``}catch{return``}};function m5({children:e}){return(0,R.jsx)(V6,{allowedElements:u5,components:d5,remarkPlugins:[l5],skipHtml:!0,urlTransform:p5,children:e})}function h5({tools:e}){return(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[#101d22]`,children:[(0,R.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-slate-800 bg-[#151f24] px-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Context`}),(0,R.jsx)(`h2`,{className:`truncate text-base font-semibold text-slate-100`,children:`Pibo Tools`}),(0,R.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,children:`Installed tool hints injected into agent context`})]}),(0,R.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 border border-slate-700 bg-[#101d22] px-2.5 text-xs text-slate-300`,children:[(0,R.jsx)(hs,{size:14,className:`text-[#11a4d4]`}),e.length,` installed`]})]}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:e.length===0?(0,R.jsx)(`div`,{className:`border border-dashed border-slate-700 bg-[#151f24] px-4 py-5 text-sm text-slate-500`,children:`No curated Pibo Tools are currently installed.`}):(0,R.jsxs)(`div`,{className:`grid gap-3`,children:[(0,R.jsx)(`div`,{className:`border border-slate-800 bg-[#151f24] px-4 py-3 text-sm text-slate-400`,children:`These are the short hints injected into agent context for installed curated CLI tools. The CLI remains the source of truth for the full workflow.`}),e.map(e=>(0,R.jsxs)(`section`,{className:`border border-slate-800 bg-[#151f24]`,children:[(0,R.jsxs)(`div`,{className:`border-b border-slate-800 px-4 py-3`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Installed Tool`}),(0,R.jsx)(`h3`,{className:`truncate text-sm font-semibold text-slate-100`,children:e.name}),(0,R.jsx)(`p`,{className:`mt-1 text-xs text-slate-500`,children:e.description})]}),(0,R.jsx)(`div`,{className:`px-4 py-4`,children:(0,R.jsx)(`div`,{className:`model-response-markdown text-sm`,children:(0,R.jsx)(m5,{children:e.snippet})})})]},e.name))]})})]})}function g5({servers:e,selectedServerName:t,onServerSaved:n}){let[r,i]=(0,L.useState)({}),[a,o]=(0,L.useState)(null),[s,c]=(0,L.useState)(null),l=(0,L.useMemo)(()=>t?[...e].sort((e,n)=>e.name===t?-1:n.name===t?1:e.name.localeCompare(n.name)):e,[t,e]);(0,L.useEffect)(()=>{i(t=>{let n={...t};for(let t of e)t.name in n||(n[t.name]=t.description??``);return n})},[e]);let u=async e=>{if(!e.editable)return;let t=(r[e.name]??``).trim();if(!t){c(`MCP tool context is required.`);return}o(e.name);try{let r=await Us(e.name,t);i(t=>({...t,[e.name]:r.server.description??``})),n(r.server),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(null)}};return(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[#101d22]`,children:[(0,R.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-slate-800 bg-[#151f24] px-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`Context`}),(0,R.jsx)(`h2`,{className:`truncate text-base font-semibold text-slate-100`,children:`MCP Tools`}),(0,R.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,children:`MCP server hints injected into agent context`})]}),(0,R.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 border border-slate-700 bg-[#101d22] px-2.5 text-xs text-slate-300`,children:[(0,R.jsx)(ls,{size:14,className:`text-[#11a4d4]`}),e.length,` configured`]})]}),(0,R.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:[s?(0,R.jsx)(`div`,{className:`mb-3 border border-red-500/60 bg-red-500/10 px-3 py-2 text-sm text-red-200`,children:s}):null,l.length===0?(0,R.jsx)(`div`,{className:`border border-dashed border-slate-700 bg-[#151f24] px-4 py-5 text-sm text-slate-500`,children:`No MCP servers are configured.`}):(0,R.jsxs)(`div`,{className:`grid gap-3`,children:[(0,R.jsx)(`div`,{className:`border border-slate-800 bg-[#151f24] px-4 py-3 text-sm text-slate-400`,children:`These short descriptions become the model-visible MCP context. Configure the server itself through the MCP CLI.`}),l.map(e=>{let n=r[e.name]??e.description??``,o=n.trim()!==(e.description??``);return(0,R.jsxs)(`section`,{className:`border bg-[#151f24] ${e.name===t?`border-[#11a4d4]`:e.hasDescription?`border-slate-800`:`border-[#f59e0b]/60`}`,children:[(0,R.jsx)(`div`,{className:`border-b border-slate-800 px-4 py-3`,children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-[#11a4d4]`,children:`MCP Tool Context`}),(0,R.jsx)(`h3`,{className:`truncate text-sm font-semibold text-slate-100`,children:e.name}),(0,R.jsxs)(`div`,{className:`mt-1 font-mono text-[10px] text-slate-500`,children:[e.transport,e.descriptionSource?` / ${e.descriptionSource}`:``]})]}),e.hasDescription?null:(0,R.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 border border-[#f59e0b]/60 bg-[#f59e0b]/10 px-2 py-1 text-xs text-amber-100`,children:[(0,R.jsx)(fs,{size:13}),`Missing`]})]})}),(0,R.jsxs)(`div`,{className:`grid gap-2 px-4 py-4`,children:[(0,R.jsx)(`textarea`,{value:n,maxLength:480,disabled:!e.editable,onChange:t=>i(n=>({...n,[e.name]:t.target.value})),className:`min-h-[92px] min-w-0 resize-y border border-slate-700 bg-[#0e1116] px-3 py-2 text-sm text-slate-200 outline-none focus:border-[#11a4d4] disabled:opacity-60`,placeholder:`Short agent-facing MCP context`}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,R.jsx)(`div`,{className:`text-xs text-slate-500`,children:e.editable?`Stored as Pibo MCP metadata.`:`Registry-provided context is read-only.`}),(0,R.jsx)(`button`,{type:`button`,disabled:!e.editable||a===e.name||!o||!n.trim(),onClick:()=>void u(e),title:`Save MCP Tool Context`,"aria-label":`Save MCP Tool Context`,className:`h-8 w-8 inline-flex items-center justify-center border border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4] disabled:opacity-50`,children:(0,R.jsx)(ss,{size:14})})]})]})]},e.name)})]})]})]})}var _5=[`trace`,`terminal`],v5=`trace`;function y5(e){return typeof e==`string`&&_5.includes(e)}function b5(e){return y5(e)?e:void 0}var x5={"agent.run":{color:`text-[#11a4d4]`,bgColor:`bg-[#11a4d4]/20`,borderColor:`border-[#11a4d4]`,label:`Agent Run`},"tool.call":{color:`text-purple-500`,bgColor:`bg-purple-500/20`,borderColor:`border-purple-500`,label:`Tool Call`},"tool.result":{color:`text-green-500`,bgColor:`bg-green-500/20`,borderColor:`border-green-500`,label:`Tool Result`},"model.request":{color:`text-blue-500`,bgColor:`bg-blue-500/20`,borderColor:`border-blue-500`,label:`Model Request`},"model.response":{color:`text-[#0bda57]`,bgColor:`bg-[#0bda57]/20`,borderColor:`border-[#0bda57]`,label:`Model Response`},"model.reasoning":{color:`text-amber-500`,bgColor:`bg-amber-500/20`,borderColor:`border-amber-500`,label:`Reasoning`},"agent.delegation":{color:`text-orange-500`,bgColor:`bg-orange-500/20`,borderColor:`border-orange-500`,label:`Agent Delegation`},"agent.async":{color:`text-orange-500`,bgColor:`bg-orange-500/20`,borderColor:`border-orange-500`,label:`Async Agent`},"yielded.run":{color:`text-[#11a4d4]`,bgColor:`bg-[#11a4d4]/20`,borderColor:`border-[#11a4d4]`,label:`Yielded Run`},"user.prompt":{color:`text-cyan-500`,bgColor:`bg-cyan-500/20`,borderColor:`border-cyan-500`,label:`User Prompt`},user_input:{color:`text-slate-500`,bgColor:`bg-slate-800`,borderColor:`border-slate-600`,label:`User Input`}},S5=12;function C5(e,t){return t===`all`||e<t}var w5=(0,L.memo)(function e({span:t,startTime:n,depth:r=0,expansionDepth:i,expansionSignal:a,expandThinking:o,onFork:s,onOpenSession:c}){let[l,u]=(0,L.useState)(()=>C5(r,i)),[d,f]=(0,L.useState)(()=>t.spanType===`model.reasoning`?o:C5(r,i));(0,L.useEffect)(()=>{let e=C5(r,i);u(e),f(t.spanType===`model.reasoning`?o:e)},[r,i,a,o,t.spanType]);let p=x5[t.spanType]||x5[`agent.run`],m=t.status===`UNSET`,h=M5(t.status,m),g=t.spanType===`user.prompt`||t.spanType===`user_input`,_=!!t.children?.length,v=F5(t.startTime,n),y=t.durationUs?`${(t.durationUs/1e3).toFixed(1)}ms`:t.endTime?`${((t.endTime-t.startTime)/1e3).toFixed(1)}ms`:null,b=(0,L.useCallback)(()=>{f(e=>!e),_&&u(e=>!e)},[_]);return(0,R.jsx)(`div`,{className:`relative mb-4 group`,style:{marginLeft:r>0?S5:0,width:r>0?`calc(100% - ${S5}px)`:`var(--trace-readable-width)`,maxWidth:`100%`},children:(0,R.jsxs)(`div`,{className:`min-w-0 ${g?`bg-[#11a4d4]/10`:`bg-white dark:bg-[#1a262b]`} border ${h.cardClass} rounded-sm shadow-sm transition-all hover:border-opacity-70 ${m?h.glowClass:``}`,children:[(0,R.jsx)(T5,{span:t,config:p,statusStyles:h,isActive:m,contentExpanded:d,duration:y,relativeTime:v,onToggle:b,onFork:s,onOpenSession:c}),d?(0,R.jsx)(O5,{span:t}):null,_&&l&&d?(0,R.jsx)(`div`,{className:`min-w-0 border-t border-slate-700 bg-slate-900/50 py-4`,children:t.children?.map(t=>(0,R.jsx)(e,{span:t,startTime:n,depth:r+1,expansionDepth:i,expansionSignal:a,expandThinking:o,onFork:s,onOpenSession:c},t.id))}):null]})})});function T5({span:e,config:t,statusStyles:n,isActive:r,contentExpanded:i,duration:a,relativeTime:o,onToggle:s,onFork:c,onOpenSession:l}){let u=e.spanType===`user.prompt`||e.spanType===`user_input`?`bg-[#11a4d4]/10`:n.headerClass;return(0,R.jsx)(`div`,{className:`${i?`border-b ${t.borderColor}/20`:``} ${u}`,children:(0,R.jsxs)(`div`,{className:`box-border flex w-full min-w-0 items-center`,style:{maxWidth:`100%`},children:[(0,R.jsx)(`button`,{type:`button`,className:`min-w-0 flex-1 px-4 py-2 cursor-pointer text-left`,onClick:s,children:(0,R.jsxs)(`span`,{className:`min-w-0 text-xs font-bold ${t.color} uppercase tracking-wider flex items-center gap-2`,children:[i?(0,R.jsx)(No,{size:12}):(0,R.jsx)(Po,{size:12}),(0,R.jsx)(E5,{spanType:e.spanType,config:t,isActive:r}),(0,R.jsx)(`span`,{className:`shrink-0`,children:t.label}),e.name?(0,R.jsxs)(`span`,{className:`min-w-0 truncate font-normal text-slate-500 dark:text-slate-400 normal-case`,children:[`: `,e.name]}):null,r?(0,R.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-[#11a4d4] animate-pulse`}):null]})}),(0,R.jsx)(k5,{forkEntryId:e.pibo?.traceNodeType===`user.message`?e.pibo.entryId:void 0,linkedPiboSessionId:e.pibo?.linkedPiboSessionId,onFork:c,onOpenSession:l}),(0,R.jsx)(D5,{duration:a,relativeTime:o})]})})}function E5({spanType:e,config:t,isActive:n}){return(0,R.jsxs)(`span`,{className:`relative inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full ${t.bgColor} border-2 ${t.borderColor} ${n?`shadow-[0_0_10px_rgba(17,164,212,0.4)]`:``}`,children:[(0,R.jsx)(j5,{type:e,className:t.color}),n?(0,R.jsx)(`span`,{className:`absolute -right-0.5 -top-0.5 h-1.5 w-1.5 rounded-full bg-[#11a4d4] animate-pulse`}):null]})}function D5({duration:e,relativeTime:t}){return(0,R.jsxs)(`div`,{className:`ml-2 mr-4 flex w-36 shrink-0 items-center justify-end gap-2 font-mono tabular-nums`,children:[e?(0,R.jsx)(`span`,{className:`text-[10px] text-slate-500 dark:text-slate-400`,children:e}):null,(0,R.jsx)(`span`,{className:`text-xs text-slate-400 dark:text-slate-500`,children:t})]})}var O5=(0,L.memo)(function({span:e}){let[t,n]=(0,L.useState)(!1),{spanType:r,attributes:i,name:a}=e,o=i.content||i.input||i.output||i.message,s=i.tool_name||i.tool?.name||i[`tool.name`],c=typeof s==`string`?s:null,l=i.output||i.result||i[`tool.result`],u=i.arguments||i.args||i[`tool.arguments`],d=e.status===`ERROR`?(0,R.jsxs)(`div`,{className:`mx-4 mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-sm text-xs`,children:[(0,R.jsx)(`div`,{className:`flex items-center gap-2 font-semibold text-red-500 mb-1`,children:`Error`}),e.statusMessage?(0,R.jsx)(`div`,{className:`font-mono text-red-400 mb-2`,children:e.statusMessage}):null]}):null;if(r===`user.prompt`||r===`user_input`)return(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,R.jsx)(`div`,{className:`min-w-0 break-words p-4 font-mono text-sm text-slate-300 whitespace-pre-wrap`,children:typeof o==`string`?o:JSON.stringify(o)})]});if(r===`model.response`)return(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,R.jsx)(`div`,{className:`model-response-markdown min-w-0 p-4 text-sm text-slate-200 leading-relaxed`,children:typeof o==`string`?(0,R.jsx)(m5,{children:o}):(0,R.jsx)(cd,{value:o})})]});if(r===`tool.result`)return(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,R.jsxs)(`div`,{className:`p-4 bg-green-500/5 border-t border-green-500/20`,children:[(0,R.jsxs)(`div`,{className:`text-xs font-medium text-green-400 mb-2`,children:[`Returned from `,c||a,`:`]}),(0,R.jsx)(cd,{value:l??o})]})]});if(r===`tool.call`){let e=I5(u)?u:{},r=Object.keys(e).length>0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`p-4 bg-[#0e1116] border-b border-slate-800`,children:(0,R.jsx)(A5,{name:c??a,args:e})}),l==null?null:(0,R.jsxs)(`div`,{className:`px-4 py-2 bg-[#1a262b] flex items-center gap-2`,children:[(0,R.jsx)(To,{size:14,className:`text-slate-400`}),(0,R.jsx)(`span`,{className:`text-xs font-mono text-slate-500`,children:`Output:`}),(0,R.jsx)(`code`,{className:`min-w-0 max-w-md truncate text-xs font-mono text-slate-300`,children:typeof l==`string`?l.slice(0,100):JSON.stringify(l).slice(0,100)})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`w-full px-4 py-1.5 flex items-center gap-1.5 text-[11px] font-medium text-slate-400 hover:text-slate-200 bg-slate-900/40 hover:bg-slate-800/60 border-t border-slate-700/40 transition-colors`,children:[t?(0,R.jsx)(Vo,{size:12}):(0,R.jsx)(Ho,{size:12}),t?`Hide Details`:`Show Details`]}),t?(0,R.jsxs)(`div`,{className:`border-t border-slate-700/40 bg-[#0e1116]`,children:[r?(0,R.jsxs)(`div`,{className:`px-4 pt-3 pb-2`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-semibold text-blue-400 uppercase tracking-wider mb-1.5`,children:`Input`}),(0,R.jsx)(cd,{value:e})]}):null,l==null?null:(0,R.jsxs)(`div`,{className:`px-4 pt-2 pb-3 border-t border-slate-700/30`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-semibold text-green-400 uppercase tracking-wider mb-1.5`,children:`Output`}),(0,R.jsx)(cd,{value:l})]})]}):null,d]})}if(r===`yielded.run`){let e=I5(l)?l:I5(o)?o:{};return(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,R.jsxs)(`div`,{className:`p-4 border-b border-[#11a4d4]/20 bg-[#11a4d4]/5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,R.jsx)(Eo,{size:14,className:`text-[#11a4d4]`}),(0,R.jsx)(`span`,{className:`text-sm font-medium text-[#11a4d4]`,children:`Run notification`}),(0,R.jsx)(`span`,{className:`text-xs font-mono text-slate-400`,children:typeof i.content==`string`?i.content:a})]}),(0,R.jsx)(N5,{notification:e})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`w-full px-4 py-1.5 flex items-center gap-1.5 text-[11px] font-medium text-slate-400 hover:text-slate-200 bg-slate-900/40 hover:bg-slate-800/60 border-t border-slate-700/40 transition-colors`,children:[t?(0,R.jsx)(Vo,{size:12}):(0,R.jsx)(Ho,{size:12}),t?`Hide Details`:`Show Details`]}),t?(0,R.jsx)(`div`,{className:`border-t border-slate-700/40 bg-[#0e1116] px-4 py-3`,children:(0,R.jsx)(cd,{value:e})}):null]})}if(r===`model.reasoning`){let e=i.reasoning||i[`model.reasoning`]||o;return(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,R.jsxs)(`div`,{className:`min-w-0 break-words p-4 font-mono text-sm text-slate-300 bg-amber-500/5 leading-relaxed whitespace-pre-wrap`,children:[(0,R.jsx)(`span`,{className:`text-amber-500 opacity-60`,children:`// Model reasoning`}),(0,R.jsx)(`br`,{}),typeof e==`string`?e:JSON.stringify(e,null,2)]})]})}if(r===`agent.delegation`){let e=i[`delegation.target_agent`],t=i[`delegation.query`],n=i[`result.status`];return(0,R.jsxs)(R.Fragment,{children:[d,(0,R.jsxs)(`div`,{className:`p-4 border-b border-orange-500/20 bg-orange-500/5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,R.jsx)(Ko,{size:14,className:`text-orange-500`}),(0,R.jsx)(`span`,{className:`text-sm font-medium text-orange-500`,children:`Delegated to:`}),(0,R.jsxs)(`span`,{className:`text-sm font-semibold text-slate-200`,children:[e||`unknown`,` agent`]}),n?(0,R.jsx)(`span`,{className:`ml-2 px-2 py-0.5 text-[10px] font-bold rounded-sm bg-green-500/20 text-green-500`,children:n.toUpperCase()}):null]}),t?(0,R.jsxs)(`div`,{className:`text-xs text-slate-400 font-mono italic line-clamp-2`,children:[`"`,L5(t),`"`]}):null]})]})}if(r===`agent.async`){let e=i[`async_agent.target_agent`],t=i[`async_agent.query`],n=i[`async_agent.started_by`],r=i.run_id,a=i[`result.status`];return(0,R.jsxs)(R.Fragment,{children:[d,(0,R.jsxs)(`div`,{className:`p-4 border-b border-orange-500/20 bg-orange-500/5`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 mb-2`,children:[(0,R.jsx)(Ko,{size:14,className:`text-orange-500`}),(0,R.jsx)(`span`,{className:`text-sm font-medium text-orange-500`,children:`Async agent started:`}),(0,R.jsxs)(`span`,{className:`text-sm font-semibold text-slate-200`,children:[e||`unknown`,` agent`]}),a?(0,R.jsx)(`span`,{className:`px-2 py-0.5 text-[10px] font-bold rounded-sm bg-orange-500/15 text-orange-400`,children:a.toUpperCase()}):null]}),(0,R.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-x-3 gap-y-1 font-mono text-[11px] text-slate-500`,children:[(0,R.jsxs)(`span`,{children:[`Started by `,n||`pibo_run_start`]}),r?(0,R.jsx)(`span`,{children:r}):null]}),t?(0,R.jsxs)(`div`,{className:`text-xs text-slate-400 font-mono italic line-clamp-2`,children:[`"`,L5(t),`"`]}):null]})]})}return r===`agent.run`?(0,R.jsx)(`div`,{className:`flex flex-col`,children:d}):(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[d,(0,R.jsx)(`div`,{className:`p-4 font-mono text-sm text-slate-300`,children:(0,R.jsx)(cd,{value:i})})]})});function k5({forkEntryId:e,linkedPiboSessionId:t,onFork:n,onOpenSession:r}){let i=e&&n?e:void 0,a=t&&r?t:void 0;return!i&&!a?null:(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[i?(0,R.jsx)(`button`,{type:`button`,onClick:()=>n?.(i),className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border border-slate-700 bg-[#151f24]/80 text-slate-400 transition-colors hover:border-[#11a4d4] hover:text-[#11a4d4]`,title:`Fork user message`,"aria-label":`Fork user message`,children:(0,R.jsx)(Ko,{size:14})}):null,a?(0,R.jsx)(`button`,{type:`button`,onClick:()=>r?.(a),className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border border-slate-700 bg-[#151f24]/80 text-slate-400 transition-colors hover:border-[#11a4d4] hover:text-[#11a4d4]`,title:`Open child session`,"aria-label":`Open child session`,children:(0,R.jsx)(Bo,{size:14})}):null]})}function A5({name:e,args:t}){return(0,R.jsxs)(`code`,{className:`font-mono text-xs text-green-400`,children:[(0,R.jsx)(`span`,{className:`text-purple-400`,children:`def`}),` `,(0,R.jsx)(`span`,{className:`text-yellow-300`,children:e}),(0,R.jsxs)(`span`,{children:[`(`,Object.entries(t).map(([e,t],n)=>(0,R.jsxs)(`span`,{children:[n>0?`, `:null,(0,R.jsx)(`span`,{className:`text-blue-400`,children:e}),`=`,(0,R.jsx)(`span`,{className:`text-green-300`,children:typeof t==`string`?`'${t.slice(0,50)}${t.length>50?`...`:``}'`:L5(t).slice(0,50)})]},e)),`)`]})]})}function j5({type:e,className:t}){let n={size:14,className:t};switch(e){case`agent.run`:return(0,R.jsx)(Ao,{...n});case`tool.call`:return(0,R.jsx)(Do,{...n});case`tool.result`:return(0,R.jsx)(To,{...n});case`model.request`:return(0,R.jsx)(ko,{...n});case`model.response`:return(0,R.jsx)(To,{...n});case`model.reasoning`:return(0,R.jsx)(Yo,{...n});case`agent.delegation`:return(0,R.jsx)(Ko,{...n});case`agent.async`:return(0,R.jsx)(Ko,{...n});case`yielded.run`:return(0,R.jsx)(Eo,{...n});case`user.prompt`:return(0,R.jsx)(es,{...n});case`user_input`:return(0,R.jsx)(ms,{...n});default:return(0,R.jsx)(Mo,{...n})}}function M5(e,t){return e===`ERROR`?{cardClass:`border-[#ff6b00]/50`,headerClass:`bg-[#ff6b00]/5`,glowClass:``}:e===`OK`?{cardClass:`border-[#0bda57]/30`,headerClass:`bg-[#0bda57]/5`,glowClass:``}:t?{cardClass:`border-[#11a4d4]/50`,headerClass:`bg-[#11a4d4]/5`,glowClass:`shadow-[0_0_10px_rgba(17,164,212,0.1)]`}:{cardClass:`border-slate-700`,headerClass:`bg-[#151f24]`,glowClass:``}}function N5({notification:e}){let t=[[`completed`,`text-green-500`,e.completed],[`failed`,`text-red-400`,e.failed],[`cancelled`,`text-slate-400`,e.cancelled],[`running`,`text-[#11a4d4]`,e.running]].map(([e,t,n])=>({name:e,color:t,runs:Array.isArray(n)?n.filter(I5):[]})).filter(e=>e.runs.length>0);return t.length===0?(0,R.jsx)(`div`,{className:`text-xs text-slate-400`,children:`No yielded run updates.`}):(0,R.jsx)(`div`,{className:`grid gap-2`,children:t.map(e=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-wider ${e.color}`,children:e.name}),(0,R.jsx)(`div`,{className:`grid gap-1`,children:e.runs.map((t,n)=>(0,R.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-2 rounded-sm border border-slate-700/60 bg-[#0e1116]/60 px-2 py-1.5`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`truncate font-mono text-xs text-slate-200`,children:P5(t.toolName)||`yielded tool`}),(0,R.jsx)(`div`,{className:`truncate font-mono text-[10px] text-slate-500`,children:P5(t.runId)})]}),(0,R.jsx)(`div`,{className:`font-mono text-[10px] uppercase text-slate-400`,children:P5(t.status)||e.name})]},`${e.name}-${n}`))})]},e.name))})}function P5(e){return typeof e==`string`?e:``}function F5(e,t){let n=(e-t)/1e3,r=Math.floor(n/6e4),i=Math.floor(n%6e4/1e3),a=Math.floor(n%1e3);return`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}.${String(a).padStart(3,`0`)}`}function I5(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function L5(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var R5=e=>e.spanType===`model.request`?!1:(e.spanType,!0);function z5(e){let t=[];for(let n of V5(e))t.push(...B5(n));return t}function B5(e){let t=e.children?z5(e.children):void 0;if(e.spanType===`agent.run`)return t??[];if(e.spanType===`model.response`){let n=e.children?{...e,children:void 0}:e;return V5([...t??[],n])}return R5(e)?t===e.children?[e]:[{...e,children:t}]:t??[]}function V5(e){return[...e].sort(H5)}function H5(e,t){let n=hd(e.pibo?.traceOrder,t.pibo?.traceOrder);return n===0?e.startTime-t.startTime||e.id.localeCompare(t.id):n}var U5={"--trace-readable-width":`min(100%, clamp(36rem, 58vw, 64rem))`},W5=1;function G5({trace:e,isLoading:t=!1,showThinking:n,expandThinking:r,sessionAgentProfile:i,sessionBreadcrumbs:a=[],originSession:o,derivedSessions:s=[],agentProfiles:c=[],sessionProfileChangeDisabled:l=!1,onSessionAgentProfileChange:u,onFork:d,onOpenSession:f}){let p=(0,L.useRef)(null),m=(0,L.useRef)(!0),[h,g]=(0,L.useState)(W5),[_,v]=(0,L.useState)(0),[y,b]=(0,L.useState)(String(W5)),[x,S]=(0,L.useState)(!1),C=(0,L.useMemo)(()=>e?.spans?z5(n7(e.spans,n)):[],[e?.spans,n]),w=(0,L.useMemo)(()=>r7(C),[C]),T=(0,L.useMemo)(()=>w.length?Math.min(...w.map(e=>e.startTime)):0,[w]),E=(0,L.useMemo)(()=>({completed:w.filter(e=>e.status===`OK`).length,error:w.filter(e=>e.status===`ERROR`).length,active:w.filter(e=>e.status===`UNSET`).length}),[w]),D=e?.status===`UNSET`,O=(0,L.useCallback)(()=>{let e=p.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;m.current=t<48,S(t>180)},[]),k=(0,L.useCallback)((e=`smooth`)=>{let t=p.current;t&&(m.current=!0,t.scrollTo({top:t.scrollHeight,behavior:e}),S(!1))},[]);if((0,L.useLayoutEffect)(()=>{m.current=!0;let e=requestAnimationFrame(()=>k(`auto`));return()=>cancelAnimationFrame(e)},[k,e?.id]),(0,L.useLayoutEffect)(()=>{if(!D||!m.current)return;let e=requestAnimationFrame(()=>{p.current&&m.current&&k(`auto`)});return()=>cancelAnimationFrame(e)},[D,k,e?.spans]),!e)return(0,R.jsxs)(`section`,{className:`flex-1 flex flex-col bg-[#0c1214] relative overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`h-14 px-6 border-b border-slate-800 bg-[#1a262b]/80 flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsxs)(`h2`,{className:`text-sm font-bold uppercase tracking-wide flex items-center gap-2`,children:[(0,R.jsx)(Ko,{size:18,className:`text-[#11a4d4]`}),`Execution Flow`]}),o?(0,R.jsx)(q5,{originSession:o,onOpenSession:f}):null,(0,R.jsx)(K5,{sessions:s,onOpenSession:f})]}),(0,R.jsx)(J5,{items:a,onOpenSession:f})]}),(0,R.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-slate-500`,children:t?(0,R.jsx)($5,{}):`No Trace Selected`})]});let A=e=>{g(e),typeof e==`number`&&e>0&&b(String(e)),v(e=>e+1)},j=()=>{let e=Number.parseInt(y,10);A(Number.isFinite(e)&&e>0?e:W5)};return(0,R.jsxs)(`section`,{className:`min-w-0 flex-1 flex flex-col bg-[#0c1214] relative overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`min-h-14 px-6 py-1.5 border-b border-slate-800 bg-[#1a262b]/80 flex items-center justify-between gap-3 sticky top-0 z-20`,children:[(0,R.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[18px_minmax(0,1fr)] items-start gap-x-4 gap-y-1`,children:[(0,R.jsx)(Ko,{size:18,className:`mt-0.5 text-[#11a4d4]`,"aria-label":`Execution flow`}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[t?(0,R.jsx)(Q5,{color:`cyan`,children:`Loading`}):null,E.active>0?(0,R.jsxs)(Q5,{color:`cyan`,children:[E.active,` Active`]}):null,E.completed>0?(0,R.jsxs)(Q5,{color:`green`,children:[E.completed,` Done`]}):null,i?(0,R.jsx)(Q5,{color:`transparent`,children:i}):null,E.error>0?(0,R.jsxs)(Q5,{color:`orange`,children:[E.error,` Errors`]}):null,o?(0,R.jsx)(q5,{originSession:o,onOpenSession:f}):null,(0,R.jsx)(K5,{sessions:s,onOpenSession:f})]}),(0,R.jsx)(`div`,{className:`col-start-2 min-w-0`,children:(0,R.jsx)(J5,{items:a,onOpenSession:f})})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 self-center`,children:[(0,R.jsx)(Z5,{title:`Default expansion`,active:h===W5,onClick:()=>A(W5),children:(0,R.jsx)(os,{size:14})}),(0,R.jsx)(Z5,{title:`Collapse all`,active:h===0,onClick:()=>A(0),children:(0,R.jsx)(Ro,{size:14})}),(0,R.jsx)(Z5,{title:`Expand all`,active:h===`all`,onClick:()=>A(`all`),children:(0,R.jsx)(Io,{size:14})}),(0,R.jsxs)(`form`,{className:`ml-1 flex h-8 items-center overflow-hidden rounded-sm border border-slate-700 bg-[#151f24]/80 focus-within:border-[#11a4d4]`,onSubmit:e=>{e.preventDefault(),j()},children:[(0,R.jsx)(`input`,{type:`number`,min:1,value:y,onChange:e=>b(e.target.value),title:`Nesting level`,"aria-label":`Nesting level`,className:`h-full w-11 bg-transparent px-1 text-center font-mono text-xs text-slate-300 outline-none`}),(0,R.jsx)(`button`,{type:`submit`,title:`Expand to nesting level`,"aria-label":`Expand to nesting level`,className:`inline-flex h-full w-8 items-center justify-center border-l border-slate-700 text-slate-400 hover:text-[#11a4d4]`,children:(0,R.jsx)(Xo,{size:14})})]})]})]}),(0,R.jsx)(`div`,{ref:p,onScroll:O,className:`min-w-0 flex-1 overflow-y-auto overflow-x-hidden`,children:C.length?(0,R.jsxs)(`div`,{className:`relative w-full min-w-0 max-w-full p-6`,style:U5,children:[C.map(e=>(0,R.jsx)(w5,{span:e,startTime:T,expansionDepth:h,expansionSignal:_,expandThinking:r,onFork:d,onOpenSession:f},e.id)),D?(0,R.jsx)(t7,{}):null]}):(0,R.jsx)(e7,{agentProfiles:c,sessionAgentProfile:i,profileChangeDisabled:l,onSelectAgentProfile:u})}),x?(0,R.jsx)(`button`,{type:`button`,onClick:()=>k(),title:`Scroll to latest`,"aria-label":`Scroll to latest`,className:`absolute right-4 bottom-4 z-30 inline-flex h-9 w-9 items-center justify-center rounded-sm border border-[#11a4d4] bg-[#151f24]/95 text-[#11a4d4] shadow-lg shadow-black/30 transition-colors hover:bg-[#11a4d4] hover:text-white`,children:(0,R.jsx)(No,{size:18})}):null]})}function K5({sessions:e,onOpenSession:t}){let[n,r]=(0,L.useState)(!1);return e.length?(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>r(e=>!e),title:`${e.length} fork${e.length===1?``:`s`} from this session`,"aria-label":`${e.length} fork${e.length===1?``:`s`} from this session`,"aria-expanded":n,className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-sm border border-[#a855f7]/50 bg-[#a855f7]/10 text-[#a855f7] transition-colors hover:border-[#a855f7] hover:bg-[#a855f7]/15`,children:(0,R.jsx)(qo,{size:13})}),n?(0,R.jsxs)(`div`,{className:`absolute left-0 top-7 z-50 w-72 overflow-hidden rounded-sm border border-slate-700 bg-[#151f24] shadow-xl shadow-black/40`,children:[(0,R.jsx)(`div`,{className:`border-b border-slate-800 px-3 py-2 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Forks`}),(0,R.jsx)(`div`,{className:`max-h-64 overflow-y-auto p-1`,children:e.map(e=>(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{r(!1),t(e.piboSessionId)},className:`grid w-full grid-cols-[8px_minmax(0,1fr)] items-center gap-2 rounded-sm px-2 py-2 text-left text-slate-300 hover:bg-[#1a262b]`,children:[(0,R.jsx)(`span`,{className:`h-2 w-2 rounded-full ${e.status===`running`?`bg-[#0bda57]`:e.status===`error`?`bg-red-500`:`bg-slate-600`}`}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate text-xs font-semibold text-slate-200`,children:e.label}),(0,R.jsxs)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:[e.profile,` · `,e.piboSessionId]})]})]},e.piboSessionId))})]}):null]}):null}function q5({originSession:e,onOpenSession:t}){return(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(e.piboSessionId),title:`Open origin session: ${e.label}`,"aria-label":`Open origin session: ${e.label}`,className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-sm border border-[#f97316]/50 bg-[#f97316]/10 text-[#f97316] transition-colors hover:border-[#f97316] hover:bg-[#f97316]/15`,children:(0,R.jsx)(qo,{size:13})})}function J5({items:e,onOpenSession:t}){return e.length<=1?null:(0,R.jsx)(`nav`,{"aria-label":`Session hierarchy`,className:`min-w-0`,children:(0,R.jsx)(`ol`,{className:`flex min-w-0 items-center gap-1 overflow-hidden text-[11px] leading-4`,children:Y5(e).map((e,n)=>e.type===`ellipsis`?(0,R.jsxs)(`li`,{className:`inline-flex shrink-0 items-center gap-1`,children:[n>0?(0,R.jsx)(Po,{size:12,className:`shrink-0 text-slate-600`}):null,(0,R.jsx)(`span`,{className:`shrink-0 px-1 font-mono text-slate-500`,children:`...`})]},`ellipsis-${n}`):(0,R.jsxs)(`li`,{className:`inline-flex min-w-0 items-center gap-1`,children:[n>0?(0,R.jsx)(Po,{size:12,className:`shrink-0 text-slate-600`}):null,e.current?(0,R.jsx)(`span`,{className:`block min-w-0 max-w-56 truncate font-mono text-slate-200`,children:e.item.label}):(0,R.jsx)(`a`,{href:`/sessions/${encodeURIComponent(e.item.piboSessionId)}`,className:`block min-w-0 max-w-48 truncate font-mono text-slate-400 transition-colors hover:text-[#11a4d4]`,onClick:n=>{n.preventDefault(),t(e.item.piboSessionId)},children:e.item.label})]},e.item.piboSessionId))})})}function Y5(e){return e.length<=5?e.map((t,n)=>({type:`item`,item:t,current:n===e.length-1})):[{type:`item`,item:e[0],current:!1},{type:`ellipsis`},...e.slice(-2).map((e,t,n)=>({type:`item`,item:e,current:t===n.length-1}))]}function X5({agentProfiles:e,sessionAgentProfile:t,profileChangeDisabled:n,onSelectAgentProfile:r}){return e.length?(0,R.jsxs)(`div`,{className:`mt-8 w-full max-w-3xl`,children:[(0,R.jsx)(`div`,{className:`mb-3 text-[11px] font-bold uppercase tracking-[0.12em] text-slate-500`,children:`Session Agent`}),(0,R.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:e.map(e=>{let i=e.name===t;return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r?.(e.name),disabled:n||i,className:`grid min-h-24 w-full grid-cols-[1fr_auto] gap-3 rounded-sm border px-4 py-3 text-left transition-colors ${i?`border-[#11a4d4] bg-[#11a4d4]/10 text-slate-100`:`border-slate-700 bg-[#151f24] text-slate-300 hover:border-[#11a4d4] hover:text-slate-100`} disabled:cursor-default disabled:opacity-100`,children:[(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate font-mono text-sm text-slate-100`,children:e.name}),(0,R.jsx)(`span`,{className:`mt-2 block text-sm leading-6 text-slate-500`,children:e.description||`Use this profile for the first message in this session.`})]}),(0,R.jsx)(`span`,{className:`mt-0.5 inline-flex h-6 min-w-6 items-center justify-center rounded-full border border-current/30 px-2 text-[10px] font-bold uppercase tracking-wide`,children:i?(0,R.jsx)(Mo,{size:12}):`Set`})]},e.name)})})]}):null}function Z5({title:e,active:t,onClick:n,children:r}){return(0,R.jsx)(`button`,{type:`button`,onClick:n,title:e,"aria-label":e,className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border transition-colors ${t?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-700 bg-[#151f24]/80 text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`}`,children:r})}function Q5({color:e,children:t}){return(0,R.jsx)(`span`,{className:`max-w-52 truncate rounded-sm px-2 py-0.5 text-xs font-bold ${e===`transparent`?``:`uppercase`} ${e===`cyan`?`bg-[#11a4d4]/20 text-[#11a4d4]`:e===`green`?`bg-[#0bda57]/20 text-[#0bda57]`:e===`orange`?`bg-[#ff6b00]/20 text-[#ff6b00]`:`border border-slate-700 text-slate-300`}`,children:t})}function $5(){return(0,R.jsxs)(`div`,{className:`flex items-center gap-3 text-sm text-[#11a4d4]`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)(as,{size:16,className:`animate-spin`}),(0,R.jsx)(`span`,{children:`Loading Trace...`})]})}function e7({agentProfiles:e,sessionAgentProfile:t,profileChangeDisabled:n,onSelectAgentProfile:r}){return(0,R.jsx)(`div`,{className:`flex min-h-full items-center justify-center p-6`,children:(0,R.jsxs)(`div`,{className:`flex w-full max-w-3xl flex-col items-center text-center`,children:[(0,R.jsx)(`div`,{className:`mb-4 flex h-12 w-12 items-center justify-center rounded-sm border border-[#11a4d4]/35 bg-[#11a4d4]/10 text-[#11a4d4]`,children:(0,R.jsx)($o,{size:22})}),(0,R.jsx)(`h3`,{className:`text-2xl font-semibold text-slate-200`,children:`No Traces`}),(0,R.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-slate-500`,children:`Send a message to the agent to start an execution trace.`}),(0,R.jsx)(X5,{agentProfiles:e,sessionAgentProfile:t,profileChangeDisabled:n,onSelectAgentProfile:r})]})})}function t7(){return(0,R.jsx)(`div`,{className:`relative mb-8 w-full`,style:{maxWidth:`var(--trace-readable-width)`},children:(0,R.jsxs)(`div`,{className:`bg-[#1a262b] border border-[#11a4d4]/30 rounded-sm p-4 flex items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[#11a4d4]/20 border-2 border-[#11a4d4] animate-pulse`,children:(0,R.jsx)(as,{size:14,className:`text-[#11a4d4] animate-spin`})}),(0,R.jsx)(`span`,{className:`text-sm text-[#11a4d4]`,children:`Executing...`})]})})}function n7(e,t){return e.flatMap(e=>!t&&e.spanType===`model.reasoning`?[]:[{...e,children:e.children?n7(e.children,t):void 0}])}function r7(e){return e.flatMap(e=>[e,...e.children?r7(e.children):[]])}function i7({selectedTrace:e,isLoading:t,showThinking:n,expandThinking:r,sessionAgentProfile:i,sessionBreadcrumbs:a,originSession:o,derivedSessions:s,agentProfiles:c,sessionProfileChangeDisabled:l,onSessionAgentProfileChange:u,onFork:d,onOpenSession:f}){return(0,R.jsx)(G5,{trace:e,isLoading:t,showThinking:n,expandThinking:r,sessionAgentProfile:i,sessionBreadcrumbs:a,originSession:o,derivedSessions:s,agentProfiles:c,sessionProfileChangeDisabled:l,onSessionAgentProfileChange:u,onFork:d,onOpenSession:f})}function a7(e){if(e==null)return{kind:`empty`};let t=o7(e);return t===void 0?{kind:`json`,value:e}:{kind:`text`,text:t}}function o7(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=e.map(o7).filter(e=>e!==void 0);return t.length===e.length&&t.length>0?t.join(``):void 0}if(!c7(e))return;let t=typeof e.type==`string`?e.type:void 0;if(t===`text`&&typeof e.text==`string`)return e.text;if(t===`text`&&typeof e.content==`string`)return e.content;if(t===`output_text`&&typeof e.text==`string`)return e.text;let n=o7(e.content);if(n!==void 0&&s7(e))return n;let r=c7(e.message)?o7(e.message.content):void 0;if(r!==void 0)return r}function s7(e){let t=Object.keys(e).filter(t=>e[t]!==void 0);return t.length===1&&t[0]===`content`||t.every(e=>e===`content`||e===`type`)||t.every(e=>e===`content`||e===`details`||e===`type`)?!0:typeof e.type==`string`&&e.type.includes(`text`)}function c7(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Zte({row:e,onOpenSession:t}){return(0,R.jsx)(`div`,{className:`mt-2 border border-[#2a2a2a] bg-[#111111] px-3 py-2 text-[12px] text-[#d4d4d4]`,children:e.detailItems?.length?(0,R.jsx)(`div`,{className:`space-y-3`,children:e.detailItems.map(e=>(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-[#d4d4d4]`,children:e.label}),e.linkedPiboSessionId?(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(e.linkedPiboSessionId),className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:`Open Session`}):null]}),(0,R.jsx)(l7,{label:`Input`,value:e.input}),(0,R.jsx)(l7,{label:`Output`,value:e.output}),e.error?(0,R.jsx)(d7,{label:`Error`,value:e.error,tone:`red`}):null]},e.id))}):(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsx)(l7,{label:`Input`,value:e.input}),(0,R.jsx)(l7,{label:`Output`,value:e.output}),e.error?(0,R.jsx)(d7,{label:`Error`,value:e.error,tone:`red`}):null,e.linkedPiboSessionId?(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,R.jsx)(`span`,{className:`text-[#737373]`,children:`Child session`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(e.linkedPiboSessionId),className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:e.linkedPiboSessionId})]}):null]})})}function l7({label:e,value:t}){let n=a7(t);if(n.kind===`empty`)return null;if(n.kind===`text`){let t=f7(n.text);return t?.kind===`json`?(0,R.jsx)(u7,{label:e,value:t.value,meta:t.meta}):t?.kind===`text`?(0,R.jsx)(d7,{label:e,value:t.text}):(0,R.jsx)(d7,{label:e,value:n.text})}return(0,R.jsx)(u7,{label:e,value:n.value})}function u7({label:e,value:t,meta:n}){return(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,R.jsx)(`div`,{className:`text-[11px] font-semibold text-[#737373]`,children:e}),n?(0,R.jsxs)(`div`,{className:`min-w-0 break-words text-[11px] text-[#737373]`,children:[`Status: `,n]}):null]}),(0,R.jsx)(`div`,{className:`compact-terminal-json border border-[#2a2a2a] bg-[#0b0b0b] p-2`,children:(0,R.jsx)(cd,{value:t,showControls:!1})})]})}function d7({label:e,value:t,tone:n=`default`}){return(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`div`,{className:`text-[11px] font-semibold text-[#737373]`,children:e}),(0,R.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words border border-[#2a2a2a] bg-[#0b0b0b] p-2 font-mono text-[12px] leading-[1.45] ${n===`red`?`text-[#ef4444]`:`text-[#d4d4d4]`}`,children:t})]})}function f7(e){let t=e.trim();if(!t)return;let n=m7(t);if(n!==void 0)return p7(n);let r=t.split(/\r?\n/);for(let e=1;e<r.length;e+=1){let t=r.slice(e).join(`
|
|
151
|
+
`).trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))continue;let n=m7(t);if(n!==void 0)return p7(n,r.slice(0,e).join(` `).trim()||void 0)}}function p7(e,t){let n=a7(e);if(n.kind===`text`){let e=f7(n.text);return e?.kind===`json`?{...e,meta:e.meta??t}:{kind:`text`,text:n.text}}return{kind:`json`,value:e,meta:t}}function m7(e){if(!(!e.startsWith(`{`)&&!e.startsWith(`[`)))try{let t=JSON.parse(e);return typeof t==`object`&&t?t:void 0}catch{return}}function Qte({name:e,input:t}){return(0,R.jsxs)(`span`,{className:`compact-terminal-function-call`,children:[(0,R.jsx)(`span`,{className:`text-[#facc15] font-semibold`,children:e}),(0,R.jsx)(`span`,{className:`text-[#d4d4d4]`,children:`(`}),t===void 0?null:(0,R.jsx)($te,{value:t}),(0,R.jsx)(`span`,{className:`text-[#d4d4d4]`,children:`)`})]})}function $te({value:e}){let[t,n]=(0,L.useState)(()=>new Set([`$`])),[r,i]=(0,L.useState)(()=>new Set);return(0,R.jsx)(h7,{value:e,path:`$`,expandedPaths:t,expandedStrings:r,onTogglePath:e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},onToggleString:e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}})}function h7({value:e,path:t,expandedPaths:n,expandedStrings:r,onTogglePath:i,onToggleString:a}){if(Array.isArray(e))return(0,R.jsx)(g7,{value:e,path:t,open:`[`,close:`]`,expandedPaths:n,expandedStrings:r,onTogglePath:i,onToggleString:a});if(tne(e))return(0,R.jsx)(g7,{value:e,path:t,open:`{`,close:`}`,expandedPaths:n,expandedStrings:r,onTogglePath:i,onToggleString:a});if(typeof e==`string`){let n=r.has(t),i=e.length>140&&!n,o=i?`${e.slice(0,140)}...`:e,s=(0,R.jsx)(`span`,{className:`text-[#fb923c]`,children:JSON.stringify(o)});return!i&&e.length<=140?s:(0,R.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a(t)},className:`compact-terminal-json-toggle text-left align-baseline`,title:n?`Collapse string`:`Expand string`,children:s})}return typeof e==`number`||typeof e==`boolean`||e===null?(0,R.jsx)(`span`,{className:`text-[#60a5fa]`,children:String(e)}):(0,R.jsx)(`span`,{className:`text-[#737373]`,children:JSON.stringify(String(e))})}function g7({value:e,path:t,open:n,close:r,expandedPaths:i,expandedStrings:a,onTogglePath:o,onToggleString:s}){let c=Array.isArray(e)?e.map((e,t)=>[String(t),e]):Object.entries(e);return i.has(t)?(0,R.jsxs)(`span`,{children:[(0,R.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o(t)},className:`compact-terminal-json-toggle align-baseline text-[#737373]`,title:`Collapse JSON`,"aria-label":`Collapse JSON at ${t}`,"data-inline-json-path":t,children:[(0,R.jsx)(`span`,{className:`compact-terminal-json-caret`,children:`▾`}),n]}),c.map(([n,r],c)=>{let l=`${t}.${ene(n)}`;return(0,R.jsxs)(`span`,{children:[c>0?(0,R.jsx)(`span`,{className:`text-[#737373]`,children:`, `}):null,Array.isArray(e)?null:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`text-[#d4d4d4]`,children:JSON.stringify(n)}),(0,R.jsx)(`span`,{className:`text-[#737373]`,children:`:`})]}),(0,R.jsx)(h7,{value:r,path:l,expandedPaths:i,expandedStrings:a,onTogglePath:o,onToggleString:s})]},l)}),(0,R.jsx)(`span`,{className:`text-[#737373]`,children:r})]}):(0,R.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o(t)},className:`compact-terminal-json-toggle align-baseline text-[#737373]`,title:`Expand JSON`,"aria-label":`Expand JSON at ${t}`,"data-inline-json-path":t,children:[(0,R.jsx)(`span`,{className:`compact-terminal-json-caret`,children:`▸`}),n,`...`,r]})}function ene(e){return e.replaceAll(`\\`,`\\\\`).replaceAll(`.`,`\\.`)}function tne(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function _7({line:e,status:t}){return(0,R.jsxs)(`div`,{className:`grid grid-cols-[1.9rem_minmax(0,1fr)] gap-2 leading-[1.45]`,children:[(0,R.jsx)(`span`,{className:`whitespace-pre ${rne(e.prefix,t)}`,children:nne(e.prefix)}),(0,R.jsxs)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words`,children:[e.tokens.map((e,t)=>(0,R.jsx)(`span`,{className:ine(e),children:e.text},`${t}:${e.text}`)),e.functionCall?(0,R.jsx)(Qte,{name:e.functionCall.name,input:e.functionCall.input}):null]})]})}function nne(e=`none`){switch(e){case`bullet`:return`•`;case`detail`:return`└`;case`continuation`:return` `;case`prompt`:return`›`;default:return` `}}function rne(e=`none`,t){if(e===`bullet`){if(t===`running`)return`text-[#38bdf8]`;if(t===`error`)return`text-[#ef4444]`;if(t===`done`)return`text-[#22c55e]`}return`text-[#737373]`}function ine(e){return`${e.tone===`dim`?`text-[#737373]`:e.tone===`cyan`?`text-[#38bdf8]`:e.tone===`green`?`text-[#22c55e]`:e.tone===`red`?`text-[#ef4444]`:e.tone===`magenta`?`text-[#d946ef]`:e.tone===`yellow`?`text-[#facc15]`:e.tone===`blue`?`text-[#60a5fa]`:e.tone===`amber`?`text-[#f59e0b]`:`text-[#d4d4d4]`} ${e.weight===`bold`?`font-bold`:e.weight===`semibold`?`font-semibold`:`font-normal`} ${e.italic?`italic`:``}`.trim()}function ane(e,t){return e?yne(v7(e.nodes).flatMap(e=>e.node.type===`agent.turn`||e.node.type===`model.reasoning`&&!t.showThinking?[]:[one(e.node,e.turnId)])).map(e=>e.row):[]}function v7(e,t){let n=[];for(let r of e)r.type!==`agent.turn`&&n.push({node:r,turnId:t}),n.push(...v7(r.children,r.type===`agent.turn`?r.id:t));return n}function one(e,t){let n;switch(e.type){case`user.message`:n={row:cne(e),turnId:t};break;case`assistant.message`:n={row:lne(e),turnId:t};break;case`model.reasoning`:n={row:une(e),turnId:t};break;case`tool.call`:n=dne(e,t);break;case`tool.result`:n={row:fne(e),turnId:t};break;case`agent.delegation`:n={row:pne(e),turnId:t};break;case`agent.async`:n={row:mne(e),turnId:t};break;case`yielded.run`:n={row:hne(e),turnId:t};break;case`execution.command`:n={row:gne(e),turnId:t};break;case`error`:n={row:vne(e),turnId:t};break;case`agent.turn`:n={row:{id:e.id,kind:`error`,status:`neutral`,lines:[],sourceNodeIds:[e.id]},turnId:t};break}return{...n,row:{...n.row,...sne(e)}}}function sne(e){return{eventId:e.eventId,runId:e.runId,orderSource:e.source,orderStreamId:e.orderKey?.streamId,orderStreamFrameIndex:e.orderKey?.streamFrameIndex}}function cne(e){let t=A7(e.output)||A7(e.summary)||e.title;return{id:e.id,kind:`message.user`,status:D7(e.status),lines:[{prefix:`prompt`,tokens:[k7(t)]}],sourceNodeIds:[e.id],forkEntryId:e.entryId,output:t}}function lne(e){return{id:e.id,kind:`message.assistant`,status:D7(e.status),lines:[],sourceNodeIds:[e.id],output:A7(e.output)||A7(e.summary)||``,error:e.error}}function une(e){let t=S7(e.output??e.summary);return{id:e.id,kind:`reasoning`,status:D7(e.status),lines:[{prefix:`bullet`,tokens:[k7(e.status===`running`?`Thinking`:`Thought`,`amber`,`semibold`)]}],sourceNodeIds:[e.id],markdown:t}}function dne(e,t){let n=w7(e.input);if(n&&Cne(e.title))return{row:_ne(e,n),turnId:t,exploring:void 0};let r=x7(e.error??e.output,4,e.error?`red`:`dim`);return{row:{id:e.id,kind:`tool.call`,status:D7(e.status),lines:[{prefix:`bullet`,tokens:[k7(wne(e.status),O7(e.status),`semibold`),k7(` `)],functionCall:{name:e.title,input:e.input}},...r.lines],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error},turnId:t,exploring:xne(e)}}function fne(e){let t=x7(e.error??e.output,4,e.error?`red`:`dim`);return{id:e.id,kind:`tool.call`,status:D7(e.status),lines:[{prefix:`bullet`,tokens:[k7(e.status===`error`?`Tool failed`:`Returned`,O7(e.status),`semibold`),k7(` ${e.title}`)]},...t.lines],sourceNodeIds:[e.id],output:e.output,error:e.error,expandable:e.output!==void 0||!!e.error}}function pne(e){let t=A7(j7(e.input)?e.input.subagentName:void 0)||e.summary||e.title,n=C7((j7(e.input)?e.input.arguments:void 0)??e.input),r=n?[{prefix:`detail`,tokens:[k7(n,`dim`)]}]:[];return{id:e.id,kind:`agent.delegation`,status:D7(e.status),lines:[{prefix:`bullet`,tokens:[k7(Tne(e.status),O7(e.status),`semibold`),k7(` ${t}`,`cyan`)]},...r],sourceNodeIds:[e.id],linkedPiboSessionId:e.linkedPiboSessionId,input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function mne(e){let t=x7(e.error??e.output,4,e.error?`red`:`dim`);return{id:e.id,kind:`agent.async`,status:D7(e.status),lines:[{prefix:`bullet`,tokens:[k7(Ene(e.status),O7(e.status),`semibold`),k7(` ${e.title}`,`cyan`)]},...t.lines],sourceNodeIds:[e.id],linkedPiboSessionId:e.linkedPiboSessionId,input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function hne(e){let t=x7(e.output,4);return{id:e.id,kind:`yielded.run`,status:D7(e.status),lines:[{prefix:`bullet`,tokens:[k7(e.status===`running`?`Waiting on runs`:`Run update`,O7(e.status),`semibold`),k7(e.summary?` ${e.summary}`:``)]},...t.lines],sourceNodeIds:[e.id],output:e.output,error:e.error,expandable:e.output!==void 0||!!e.error}}function gne(e){let t=w7(e.output)??w7(e.input)??e.title,n=x7(e.error??e.output,4,e.error?`red`:`dim`,180);return{id:e.id,kind:`execution.command`,status:D7(e.status),lines:[{prefix:`bullet`,tokens:[k7(`Ran`,O7(e.status),`semibold`),k7(` `),...T7(t)]},...n.lines],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function _ne(e,t){let n=x7(e.error??e.output,4,e.error?`red`:`dim`,180);return{id:e.id,kind:`execution.command`,status:D7(e.status),lines:[{prefix:`bullet`,tokens:[k7(e.status===`running`?`Running`:`Ran`,O7(e.status),`semibold`),k7(` `),...T7(t)]},...n.lines],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function vne(e){return{id:e.id,kind:`error`,status:`error`,lines:[{prefix:`bullet`,tokens:[k7(`Error`,`red`,`bold`),k7(e.error?` ${e.error}`:``,`red`)]}],sourceNodeIds:[e.id],error:e.error,output:e.output,expandable:e.output!==void 0||!!e.error}}function yne(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(!r.exploring){t.push(r);continue}let i=[r],a=n+1;for(;a<e.length&&e[a].exploring&&e[a].turnId===r.turnId;)i.push(e[a]),a+=1;if(i.length===1){t.push(r);continue}t.push({row:bne(i),turnId:r.turnId}),n=a-1}return t}function bne(e){let t=e.map(e=>({id:e.row.id,label:e.exploring?.label??e.row.lines[0]?.tokens.map(e=>e.text).join(``)??e.row.id,status:e.row.status,input:e.row.input,output:e.row.output,error:e.row.error,linkedPiboSessionId:e.row.linkedPiboSessionId})),n=e[0]?.row.id??`exploring`,r=e[e.length-1]?.row.id??n,i=e.some(e=>e.row.status===`running`)?`running`:e.some(e=>e.row.status===`error`)?`error`:`done`;return{id:`group:exploring:${n}:${r}`,kind:`tool.group.exploring`,status:i,lines:[{prefix:`bullet`,tokens:[k7(i===`running`?`Exploring`:i===`error`?`Exploring failed`:`Explored`,O7(i),`semibold`)]},...t.map((e,t)=>({prefix:t===0?`detail`:`continuation`,tokens:[k7(e.label,e.status===`error`?`red`:`dim`)]}))],sourceNodeIds:e.flatMap(e=>e.row.sourceNodeIds),detailItems:t,expandable:t.some(e=>e.input!==void 0||e.output!==void 0||!!e.error)}}function xne(e){let t=e.title.trim().toLowerCase(),n=j7(e.input)?e.input:void 0;if(y7(t,[`read`,`open`]))return{id:e.id,label:`Read ${b7(n)??C7(e.input)}`,status:D7(e.status),input:e.input,output:e.output,error:e.error};if(y7(t,[`list`,`ls`,`glob`]))return{id:e.id,label:`List ${b7(n)??C7(e.input)}`,status:D7(e.status),input:e.input,output:e.output,error:e.error};if(y7(t,[`search`,`find`,`grep`,`rg`])){let t=Sne(n),r=b7(n);return{id:e.id,label:`Search ${t??C7(e.input)}${r?` in ${r}`:``}`,status:D7(e.status),input:e.input,output:e.output,error:e.error}}}function y7(e,t){return t.some(t=>e===t||e.startsWith(`${t}_`)||e.endsWith(`_${t}`)||e.includes(t))}function b7(e){if(e)for(let t of[`path`,`file`,`filePath`,`filepath`,`url`,`uri`,`cwd`,`pattern`,`glob`]){let n=A7(e[t]);if(n)return E7(n,80)}}function Sne(e){if(e)for(let t of[`query`,`pattern`,`text`,`name`,`q`,`regex`]){let n=A7(e[t]);if(n)return E7(n,80)}}function x7(e,t,n=`dim`,r=160){let i=S7(e);if(!i)return{lines:[],truncated:!1};let a=i.split(/\r?\n/).map(e=>e.trimEnd()).filter((e,t,n)=>e.length>0||n.length===1);if(!a.length)return{lines:[],truncated:!1};let o=a.slice(0,t).map((e,t)=>({prefix:t===0?`detail`:`continuation`,tokens:[k7(E7(e,r),n)]}));return a.length>t&&o.push({prefix:`continuation`,tokens:[k7(`+${a.length-t} more lines`,`dim`,`normal`,!0)]}),{lines:o,truncated:a.length>t}}function S7(e){let t=o7(e);if(t!==void 0)return t.trim();if(typeof e==`string`)return e.trim();if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function C7(e){return E7((typeof e==`string`?e:S7(e)).replace(/\s+/g,` `).trim(),96)}function Cne(e){let t=e.trim().toLowerCase();return t===`shell`||t===`bash`||t===`terminal`}function w7(e){if(j7(e))for(let t of[`cmd`,`command`,`script`]){let n=A7(e[t]);if(n)return n}}function T7(e){let t=e.match(/\s+|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^\s]+/g)??[e],n=!1;return t.map(e=>/^\s+$/.test(e)?k7(e):/^(?:&&|\|\||[|;<>]|2>&1)$/.test(e)?k7(e,`red`,`semibold`):e.startsWith(`-`)?k7(e,`magenta`):e.startsWith(`$`)||e.includes(`=`)?k7(e,`yellow`):/^['"]/.test(e)?k7(e,`green`):n?e.includes(`/`)||e.startsWith(`.`)?k7(e,`cyan`):k7(e,`default`):(n=!0,k7(e,`green`,`semibold`)))}function E7(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}function wne(e){return e===`running`?`Calling`:e===`error`?`Call failed`:`Called`}function Tne(e){return e===`running`?`Spawning`:e===`error`?`Spawn failed`:`Spawned`}function Ene(e){return e===`running`?`Waiting for`:`Finished waiting for`}function D7(e){return e===`running`?`running`:e===`error`?`error`:`done`}function O7(e){return e===`running`?`cyan`:e===`error`?`red`:e===`done`?`green`:`default`}function k7(e,t=`default`,n=`normal`,r=!1){return{text:e,tone:t,weight:n,italic:r}}function A7(e){return typeof e==`string`&&e.trim().length?e:void 0}function j7(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Dne({traceView:e,isLoading:t,showThinking:n,expandThinking:r,sessionAgentProfile:i,sessionBreadcrumbs:a,originSession:o,derivedSessions:s,agentProfiles:c,sessionProfileChangeDisabled:l,onSessionAgentProfileChange:u,onFork:d,onOpenSession:f}){let p=(0,L.useMemo)(()=>ane(e,{showThinking:n}),[n,e]),m=(0,L.useRef)(null),h=(0,L.useRef)(!0),[g,_]=(0,L.useState)(!1),[v,y]=(0,L.useState)(new Set),b=p.filter(e=>e.status===`running`).length,x=p.filter(e=>e.status===`error`).length,S=b>0;(0,L.useEffect)(()=>{y(e=>{let t=new Set;for(let n of p)e.has(n.id)&&t.add(n.id),r&&n.kind===`reasoning`&&n.expandable&&t.add(n.id);return One(e,t)?e:t})},[r,p]);let C=()=>{let e=m.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;h.current=t<48,_(t>180)},w=(e=`smooth`)=>{let t=m.current;t&&(h.current=!0,t.scrollTo({top:t.scrollHeight,behavior:e}),_(!1))};return(0,L.useLayoutEffect)(()=>{h.current=!0;let e=requestAnimationFrame(()=>w(`auto`));return()=>cancelAnimationFrame(e)},[e?.piboSessionId]),(0,L.useLayoutEffect)(()=>{if(!S||!h.current)return;let e=requestAnimationFrame(()=>w(`auto`));return()=>cancelAnimationFrame(e)},[S,p]),(0,R.jsxs)(`section`,{className:`min-w-0 flex-1 flex flex-col overflow-hidden bg-[#0b0b0b] text-[#d4d4d4]`,children:[(0,R.jsxs)(`div`,{className:`border-b border-[#2a2a2a] bg-[#111111] px-4 py-2 text-[11px]`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[t?(0,R.jsx)(M7,{tone:`cyan`,children:`Loading`}):null,b>0?(0,R.jsxs)(M7,{tone:`cyan`,children:[b,` running`]}):null,x>0?(0,R.jsxs)(M7,{tone:`red`,children:[x,` errors`]}):null,i?(0,R.jsx)(M7,{tone:`neutral`,children:i}):null,o?(0,R.jsxs)(`button`,{type:`button`,onClick:()=>f(o.piboSessionId),className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:[`Origin `,o.label]}):null,s.map(e=>(0,R.jsxs)(`button`,{type:`button`,onClick:()=>f(e.piboSessionId),className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:[`Derived `,e.label]},e.piboSessionId))]}),a.length?(0,R.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1 text-[#737373]`,children:a.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0?(0,R.jsx)(Po,{size:12,className:`text-[#525252]`}):null,(0,R.jsx)(`button`,{type:`button`,onClick:()=>f(e.piboSessionId),className:`hover:text-[#38bdf8]`,children:e.label})]},e.piboSessionId))}):null]}),(0,R.jsx)(`div`,{ref:m,onScroll:C,className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden`,children:e?p.length?(0,R.jsxs)(`div`,{className:`px-4 py-3 font-mono text-[12px] leading-[1.45]`,children:[p.map(e=>{let t=v.has(e.id);return(0,R.jsxs)(`div`,{className:e.kind===`message.user`?`group border-b border-[#141414] bg-[#11a4d4]/10 py-2 last:border-b-0 hover:bg-[#11a4d4]/15`:`group border-b border-[#141414] py-2 last:border-b-0 hover:bg-[#161616]`,"data-pibo-terminal-row":`true`,"data-row-id":e.id,"data-row-kind":e.kind,"data-row-status":e.status,"data-trace-node-id":e.sourceNodeIds.join(` `),"data-event-id":e.eventId,"data-run-id":e.runId,"data-order-source":e.orderSource,"data-order-stream-id":e.orderStreamId,"data-order-frame-index":e.orderStreamFrameIndex,children:[(0,R.jsxs)(`div`,{className:`flex gap-3`,children:[(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.kind===`message.assistant`?(0,R.jsx)(`div`,{className:`ml-[1.9rem] min-w-0`,children:(0,R.jsx)(`div`,{className:`compact-terminal-markdown`,children:(0,R.jsx)(m5,{children:typeof e.output==`string`?e.output:``})})}):e.kind===`reasoning`&&e.markdown?(0,R.jsxs)(R.Fragment,{children:[e.lines.map((t,n)=>(0,R.jsx)(_7,{line:t,status:e.status},`${e.id}:${n}`)),(0,R.jsx)(`div`,{className:`ml-[1.9rem] min-w-0`,children:(0,R.jsx)(`div`,{className:`compact-terminal-markdown compact-terminal-reasoning`,children:(0,R.jsx)(m5,{children:e.markdown})})})]}):e.lines.map((t,n)=>(0,R.jsx)(_7,{line:t,status:e.status},`${e.id}:${n}`))}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-start gap-1 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100`,children:[e.linkedPiboSessionId?(0,R.jsx)(N7,{label:`Open linked session`,onClick:()=>f(e.linkedPiboSessionId),children:`Open`}):null,e.forkEntryId?(0,R.jsx)(N7,{label:`Fork from this message`,onClick:()=>d(e.forkEntryId),children:`Fork`}):null,e.expandable?(0,R.jsx)(N7,{label:t?`Collapse details`:`Expand details`,onClick:()=>y(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:t?`Hide`:`Details`}):null]})]}),t?(0,R.jsx)(Zte,{row:e,onOpenSession:f}):null]},e.id)}),S?(0,R.jsx)(`div`,{className:`pt-2 text-[#737373]`,children:`• Working`}):null]}):(0,R.jsx)(P7,{isLoading:t,agentProfiles:c,disabled:l,onSelectAgentProfile:u,message:`No visible trace rows yet.`}):(0,R.jsx)(P7,{isLoading:t,agentProfiles:c,disabled:l,onSelectAgentProfile:u})}),g?(0,R.jsx)(`button`,{type:`button`,onClick:()=>w(),className:`absolute right-4 bottom-4 border border-[#38bdf8] bg-[#111111] px-2 py-1 font-mono text-[11px] text-[#38bdf8] hover:bg-[#161616]`,children:`Latest`}):null]})}function M7({tone:e,children:t}){return(0,R.jsx)(`span`,{className:`border px-2 py-0.5 ${e===`cyan`?`border-[#1f4960] text-[#38bdf8]`:e===`red`?`border-[#5f2222] text-[#ef4444]`:`border-[#3a3a3a] text-[#d4d4d4]`}`,children:t})}function N7({label:e,onClick:t,children:n}){return(0,R.jsx)(`button`,{type:`button`,onClick:t,"aria-label":e,title:e,className:`min-h-7 min-w-7 border border-[#3a3a3a] px-2 text-[11px] text-[#737373] hover:border-[#38bdf8] hover:text-[#38bdf8]`,children:n})}function P7({isLoading:e,agentProfiles:t,disabled:n,onSelectAgentProfile:r,message:i}){return(0,R.jsxs)(`div`,{className:`flex min-h-full flex-col items-center justify-center gap-4 px-6 py-10 text-center text-[12px] text-[#737373]`,children:[(0,R.jsx)(`div`,{children:e?`Loading trace…`:i??`No trace selected.`}),t.length?(0,R.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:t.map(e=>(0,R.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>r(e.name),className:`border border-[#3a3a3a] px-2 py-1 text-[#d4d4d4] hover:border-[#38bdf8] hover:text-[#38bdf8] disabled:opacity-50`,children:e.name},e.name))}):null]})}function One(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var F7=[{id:`trace`,label:`Trace`,description:`Existing nested execution flow view.`,render:e=>(0,R.jsx)(i7,{...e})},{id:`terminal`,label:`Terminal`,description:`Compact Codex-style terminal transcript.`,render:e=>(0,R.jsx)(Dne,{...e})}],I7=new Map(F7.map(e=>[e.id,e]));function kne(){return F7}function Ane(e){return I7.get(e)??I7.get(`trace`)}var jne=3e4,Mne=30*6e4,Nne=30*6e4;function L7(e,t=!1,n){return[`chat`,`bootstrap`,e??``,t?`archived`:`active`,n??``]}function Pne(e=!1,t){return[`chat`,`sessions`,e?`archived`:`active`,t??``]}function R7(e,t={}){return[`chat`,`trace`,e,t.includeRawEvents?`raw`:`compact`,t.rawEventsLimit??80]}function Fne(e){return{roomId:e.selectedRoomId,piboSessionId:e.selectedPiboSessionId,rooms:e.rooms,sessions:e.sessions}}function z7(e,t,n=!1,r){e(Pne(n,r??t.selectedRoomId),Fne(t))}function Ine(e){return[`chat`,`trace`,e]}function Lne(e){return!!(e&&typeof e==`object`&&`piboSessionId`in e&&`nodes`in e)}var B7=`pibo.chat.lastSelection`,V7=`pibo.chat.sessionView`,H7=`Delete this session`;async function Rne(e,t){let n=L7(t.piboSessionId,t.includeArchived,t.roomId);if(t.markRead){let r=await vs(t.piboSessionId,t.includeArchived,t.roomId,!0);return e.setQueryData(n,r),z7(e.setQueryData.bind(e),r,t.includeArchived,t.roomId),r}t.force&&await e.invalidateQueries({queryKey:n,exact:!0,refetchType:`none`});let r=await e.fetchQuery({queryKey:n,queryFn:()=>vs(t.piboSessionId,t.includeArchived,t.roomId,!1),staleTime:jne,gcTime:Mne});return z7(e.setQueryData.bind(e),r,t.includeArchived,t.roomId),r}async function zne(e,t,n={}){let r=R7(t,n),i=e.getQueryData(r),a=await ys(t,{includeRawEvents:n.includeRawEvents,rawEventsLimit:n.rawEventsLimit,knownVersion:i?.version});if(a.notModified&&i)return i;if(!a.trace)throw Error(`Trace response missing payload.`);return a.trace}function Bne({route:e}){let t=Aa(),n=Yt(),r=e.area,i=e.area===`sessions`?e.roomId:void 0,a=e.area===`sessions`?e.piboSessionId:void 0,o=e.area===`sessions`?e.sessionViewId:void 0,s=e.area===`settings`?e.panel??`general`:`general`,[c,l]=(0,L.useState)(null),[u,d]=(0,L.useState)(null),[f,p]=(0,L.useState)(null),[m,h]=(0,L.useState)(null),[g,_]=(0,L.useState)(()=>localStorage.getItem(`pibo.chat.showThinking`)!==`false`),[v,y]=(0,L.useState)(()=>localStorage.getItem(`pibo.chat.expandThinking`)!==`false`),[b,x]=(0,L.useState)(()=>localStorage.getItem(`pibo.chat.showRawEvents`)===`true`),[S,C]=(0,L.useState)(()=>localStorage.getItem(`pibo.chat.showArchived`)===`true`),[w,T]=(0,L.useState)(()=>localStorage.getItem(`pibo.chat.showArchivedRooms`)===`true`),[E,D]=(0,L.useState)(()=>localStorage.getItem(`pibo.chat.newSessionProfile`)??``),[O,k]=(0,L.useState)(()=>o??Y9()),[A,j]=(0,L.useState)(``),[M,N]=(0,L.useState)(0),[P,F]=(0,L.useState)(!1),[ee,te]=(0,L.useState)(`context-files`),[ne,re]=(0,L.useState)(null),[I,ie]=(0,L.useState)(null),[ae,oe]=(0,L.useState)(!1),[se,ce]=(0,L.useState)(null),[le,ue]=(0,L.useState)(``),[de,fe]=(0,L.useState)(!1),[pe,me]=(0,L.useState)(null),[he,ge]=(0,L.useState)(``),[_e,ve]=(0,L.useState)(!1),ye=(0,L.useRef)(S),be=(0,L.useRef)(0),xe=f??c?.selectedRoomId??null,Se=xe&&c?e9(c.rooms,xe)??c.room:void 0,Ce=Se?r9(Se):!1;(0,L.useEffect)(()=>{ye.current=S},[S]),(0,L.useEffect)(()=>{if(r!==`sessions`)return;let e=o??Y9();k(t=>t===e?t:e)},[r,o]),(0,L.useEffect)(()=>{Bre(O)},[O]);let we=(0,L.useCallback)((e,n=!1,r=O)=>{let i={view:r};if(e.area===`agents`){t({to:`/agents`,replace:n});return}if(e.area===`context`){t({to:`/context`,replace:n});return}if(e.area===`settings`){t({to:e.panel===`pi-packages`?`/settings/pi-packages`:`/settings`,replace:n});return}if(e.roomId&&e.piboSessionId){t({to:`/rooms/$roomId/sessions/$piboSessionId`,params:{roomId:e.roomId,piboSessionId:e.piboSessionId},search:i,replace:n});return}if(e.roomId){t({to:`/rooms/$roomId`,params:{roomId:e.roomId},search:i,replace:n});return}if(e.piboSessionId){t({to:`/sessions/$piboSessionId`,params:{piboSessionId:e.piboSessionId},search:i,replace:n});return}t({to:`/`,search:i,replace:n})},[t,O]),Te=(0,L.useCallback)((e,t,n=!1)=>{if(!t){we({area:`sessions`,...e?{roomId:e}:{}},n);return}we({area:`sessions`,...e?{roomId:e}:{},piboSessionId:t},n)},[we]),Ee=(0,L.useCallback)(e=>{re(e),te(`context-files`),we({area:`context`})},[we]),De=(0,L.useCallback)(e=>{ie(e),te(`mcp-tools`),we({area:`context`})},[we]),Oe=(0,L.useCallback)(e=>{l(t=>t&&{...t,agentCatalog:t.agentCatalog?{...t.agentCatalog,mcpServers:t.agentCatalog.mcpServers.map(t=>t.name===e.name?e:t)}:t.agentCatalog})},[]),ke=(0,L.useCallback)(e=>{let t=t=>{if(!t?.agentCatalog)return t;let n=t.agentCatalog.piPackages.filter(t=>t.id!==e.id);return{...t,agentCatalog:{...t.agentCatalog,piPackages:[...n,e].sort((e,t)=>e.name.localeCompare(t.name))}}};l(e=>t(e)??null),n.setQueriesData({queryKey:[`chat`,`bootstrap`]},e=>t(e)??void 0)},[n]),Ae=(0,L.useCallback)(e=>{let t=t=>t?.agentCatalog?{...t,agentCatalog:{...t.agentCatalog,piPackages:t.agentCatalog.piPackages.filter(t=>t.id!==e.id)}}:t;l(e=>t(e)??null),n.setQueriesData({queryKey:[`chat`,`bootstrap`]},e=>t(e)??void 0)},[n]),je=(0,L.useCallback)(async(e,t=ye.current,r,i={})=>{let a=be.current+1;be.current=a;let o=L7(e,t,r),s=n.getQueryData(o);s&&a===be.current&&(z7(n.setQueryData.bind(n),s,t,r),l(s),i.selectSession!==!1&&d(s.selectedPiboSessionId),p(s.selectedRoomId));let c=await Rne(n,{piboSessionId:e,includeArchived:t,roomId:r,markRead:i.selectSession!==!1,force:i.force});return a===be.current?(l(c),i.selectSession!==!1&&d(c.selectedPiboSessionId),p(c.selectedRoomId),c):c},[n]);(0,L.useEffect)(()=>{let t=q9(),n=i?t.sessionsByRoom?.[i]:t.piboSessionId,r=e.area===`sessions`?i??(a?void 0:t.roomId):t.roomId,o=e.area===`sessions`?a??(a?void 0:n):t.piboSessionId,s=(t,n=!0)=>{e.area===`sessions`&&t.selectedPiboSessionId&&(e.roomId===t.selectedRoomId&&e.piboSessionId===t.selectedPiboSessionId||Te(t.selectedRoomId,t.selectedPiboSessionId,n))};je(o,ye.current,r).then(e=>{s(e),h(null)}).catch(t=>{if(e.area===`sessions`&&i&&!a&&o){J9(i),je(void 0,ye.current,i).then(e=>{s(e),h(null)}).catch(e=>h(e instanceof Error?e.message:String(e)));return}if(e.area===`sessions`&&(i||a)||!o&&!r){h(t instanceof Error?t.message:String(t));return}Vre(),je().then(e=>{s(e),h(null)}).catch(e=>h(e instanceof Error?e.message:String(e)))})},[je,Te,e.area,a,i]),(0,L.useEffect)(()=>{!f&&!u||zre({roomId:f??void 0,piboSessionId:u??void 0})},[u,f]);let Me=(0,L.useMemo)(()=>kne(),[]),Ne=(0,L.useMemo)(()=>Ane(O),[O]);(0,L.useEffect)(()=>{if(!c?.agents.length)return;let e=E||c.session.profile;if(K9(c.agents,e)){E!==e&&(D(e),localStorage.setItem(`pibo.chat.newSessionProfile`,e));return}let t=K9(c.agents,c.session.profile)?c.session.profile:c.agents[0].name;D(t),localStorage.setItem(`pibo.chat.newSessionProfile`,t)},[c,E]);let Pe=(0,L.useCallback)(e=>{D(e),localStorage.setItem(`pibo.chat.newSessionProfile`,e)},[]),Fe=(0,L.useCallback)(async e=>{await n.invalidateQueries({queryKey:[`chat`,`trace`,e],refetchType:`none`}),await n.refetchQueries({queryKey:[`chat`,`trace`,e],type:`active`})},[n]),Ie=(0,L.useCallback)(()=>u?Fe(u):Promise.resolve(),[Fe,u]),Le=(0,L.useCallback)(()=>je(u??void 0,ye.current,f??void 0,{force:!0}),[je,u,f]),Re=(0,L.useCallback)(async e=>{if(!(!u||!c||e===c.session.profile))try{await Xs(u,{profile:e}),Pe(e);let t=await je(u,ye.current,f??void 0);r===`sessions`&&Te(t.selectedRoomId,t.selectedPiboSessionId),await Fe(u),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},[r,c,je,Te,Fe,u,f,Pe]),ze=(0,L.useMemo)(()=>{let e=(c?.capabilities.actions??[]).flatMap(e=>e.slashCommands.filter(e=>e!==`tree`).map(t=>({slash:`/${t}`,action:e.name,description:e.description??e.name})));return e.push({slash:`/thinking-show`,action:`thinking-show`,description:`Toggle historical thinking display in this browser.`}),e},[c]),Be=(0,L.useCallback)(async e=>{d(e);let t=await je(e);Te(t.selectedRoomId,t.selectedPiboSessionId)},[je,Te]),Ve=(0,L.useCallback)(async e=>{let t=q9().sessionsByRoom?.[e];p(e),d(t??null);try{let n=await je(t,ye.current,e);Te(n.selectedRoomId,n.selectedPiboSessionId)}catch(n){if(!t)throw n;J9(e),d(null);let r=await je(void 0,ye.current,e);Te(r.selectedRoomId,r.selectedPiboSessionId)}},[je,Te]),He=async(e=E)=>{if(!(P||Ce)){F(!0);try{let t=await bs(e||void 0,f??void 0);d(t.session.id);let n=await je(t.session.id,ye.current,f??void 0);Te(n.selectedRoomId,n.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{F(!1)}}},Ue=async()=>{let e=!S;C(e),localStorage.setItem(`pibo.chat.showArchived`,String(e));try{let t=await je(u??void 0,e,f??void 0);r===`sessions`&&Te(t.selectedRoomId,t.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},We=async(e,t)=>{try{await Xs(e,{title:t});let n=await je(u??void 0,ye.current,f??void 0);r===`sessions`&&await Fe(n.selectedPiboSessionId),r===`sessions`&&Te(n.selectedRoomId,n.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},Ge=async(e,t)=>{try{await Xs(e,{archived:t});let n=await je(t&&!S&&u===e?void 0:u??void 0,ye.current,f??void 0);r===`sessions`&&Te(n.selectedRoomId,n.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},Ke=e=>{me(e),ge(``)},qe=async()=>{if(pe){ve(!0);try{let e=await Zs(pe.piboSessionId,he),t=u?e.deletedSessionIds.includes(u):!1;t&&d(null);let n=await je(t?void 0:u??void 0,ye.current,f??void 0);r===`sessions`&&Te(n.selectedRoomId,n.selectedPiboSessionId),me(null),ge(``),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{ve(!1)}}},Je=async()=>{if(!ae){oe(!0);try{await Ve((await qs({name:`New Chat`})).room.id),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{oe(!1)}}},Ye=async(e,t)=>{try{await Js(e,t);let n=await je(u??void 0,ye.current,e);r===`sessions`&&Te(n.selectedRoomId,n.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},Xe=async(e,t)=>{try{await Js(e,{archived:t}),t&&(T(!0),localStorage.setItem(`pibo.chat.showArchivedRooms`,`true`));let n=await je(u??void 0,ye.current,f??void 0);r===`sessions`&&Te(n.selectedRoomId,n.selectedPiboSessionId),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},Ze=e=>{ce(e),ue(``)},Qe=async()=>{if(se){fe(!0);try{await Ys(se.id,le),f===se.id&&(p(null),d(null));let e=await je(void 0,ye.current);r===`sessions`&&Te(e.selectedRoomId,e.selectedPiboSessionId),ce(null),ue(``),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{fe(!1)}}},$e=(0,L.useCallback)(async e=>{if(!u||Ce)return!1;let t=e.trim().split(/\s+/)[0],n=ze.find(e=>e.slash===t);if(!n)return!1;if(n.action===`thinking-show`){let e=!g;return _(e),localStorage.setItem(`pibo.chat.showThinking`,String(e)),!0}let i=e.match(/^\/thinking\s+(\S+)/)?.[1],a=Wre(await $s(u,n.action,i?{level:i}:void 0));if((n.action===`session.clone`||n.action===`session.fork`)&&a)await Be(a);else{let e=await je(u,ye.current,f??void 0);r===`sessions`&&Te(e.selectedRoomId,e.selectedPiboSessionId),await Fe(u)}return!0},[r,je,Te,Fe,Be,u,Ce,f,g,ze]),et=(0,L.useCallback)(async e=>{if(!u||Ce)return;let t=Ure(await $s(u,`session.fork`,{entryId:e}));if(!t?.result.cancelled){if(!t)throw Error(`Unexpected fork action response`);typeof t.result.selectedText==`string`&&(j(t.result.selectedText),N(e=>e+1)),t.result.piboSessionId&&await Be(t.result.piboSessionId)}},[Be,u,Ce]),tt=(0,L.useCallback)(e=>void Be(e),[Be]),nt=(0,L.useCallback)(e=>{k(e),r===`sessions`&&we({area:`sessions`,...f?{roomId:f}:{},...u?{piboSessionId:u}:{}},!1,e)},[r,we,u,f]);if(m&&!c)return(0,R.jsx)(Hne,{message:m});if(!c)return(0,R.jsx)(`div`,{className:`min-h-screen bg-[#101d22] text-slate-300 grid place-items-center`,children:`Loading Pibo Chat...`});let rt=!!(c.selectedRoomId||c.room||c.rooms.length),it=Q7(c.sessions),at=u?Y7(c.sessions,u):void 0,ot=$7(c.rooms),st=t9(c.rooms),ct=[...new Set([...c.agents.map(e=>e.name),...c.customAgents.map(e=>e.profileName)])];return(0,R.jsxs)(`div`,{className:`h-screen overflow-hidden bg-[#101d22] text-slate-200 grid grid-rows-[56px_1fr]`,children:[(0,R.jsxs)(`header`,{className:`flex items-center justify-between gap-3 px-4 bg-[#1a262b] border-b border-slate-800`,children:[(0,R.jsx)(`div`,{className:`font-extrabold tracking-[0.08em] uppercase text-lg`,children:`Pibo Chat`}),(0,R.jsx)(`nav`,{className:`flex gap-1`,children:[`sessions`,`agents`,`context`,`settings`].map(e=>(0,R.jsx)(`button`,{type:`button`,onClick:()=>{if(e===`sessions`){Te(f??c.selectedRoomId,u??c.selectedPiboSessionId);return}we({area:e})},className:`h-8 px-3 border rounded-sm text-xs uppercase tracking-wider ${r===e?`border-[#11a4d4] text-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-700 text-slate-400`}`,children:e},e))}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-slate-400 min-w-0`,children:[(0,R.jsx)(ps,{size:14}),(0,R.jsx)(`span`,{className:`truncate`,children:c.identity.email||c.identity.name||c.identity.userId}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>void ec().then(()=>location.reload()),className:`p-1 border border-slate-700 rounded-sm`,children:(0,R.jsx)(Zo,{size:14})})]})]}),(0,R.jsx)(`div`,{className:`min-h-0 ${r===`agents`?`h-full overflow-hidden`:`grid ${r===`sessions`&&b?`grid-cols-[300px_minmax(0,1fr)_320px] max-[980px]:grid-cols-[240px_minmax(0,1fr)]`:`grid-cols-[300px_minmax(0,1fr)] max-[980px]:grid-cols-[240px_minmax(0,1fr)]`}`}`,children:r===`agents`?(0,R.jsx)($ne,{agents:c.agents,initialCustomAgents:c.customAgents,initialCatalog:c.agentCatalog,onSelect:Pe,onCreateSession:e=>void He(e),onEditContextFile:Ee,onEditMcpServer:De,onAgentsChanged:()=>void je(u??void 0,ye.current,f??void 0,{selectSession:!1}),creatingSession:P||Ce}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`aside`,{className:`min-h-0 overflow-auto bg-[#1a262b] border-r border-slate-800`,children:[(0,R.jsxs)(`div`,{className:`h-11 px-3 border-b border-slate-800 flex items-center justify-between text-xs font-bold uppercase tracking-wider`,children:[(0,R.jsx)(`span`,{children:r}),r===`sessions`?(0,R.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,R.jsx)(`button`,{type:`button`,onClick:()=>void je(u??void 0,ye.current,f??void 0,{force:!0}).then(e=>{u&&Fe(u),r===`sessions`&&Te(e.selectedRoomId,e.selectedPiboSessionId)}),title:`Refresh`,"aria-label":`Refresh`,className:`p-1 border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(as,{size:13})})}):null]}),r===`sessions`?(0,R.jsxs)(`div`,{className:`p-2 space-y-3`,children:[rt?(0,R.jsxs)(`div`,{children:[ot?(0,R.jsxs)(`div`,{className:`mb-3`,children:[(0,R.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Personal Chat`}),(0,R.jsx)(K7,{room:ot,selectedRoomId:f,onSelect:e=>void Ve(e),onUpdate:(e,t)=>void Ye(e,t),onArchive:(e,t)=>void Xe(e,t),onDelete:Ze})]}):null,(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1 pb-1`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Rooms`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>void Je(),disabled:ae,title:`New Room`,"aria-label":`New Room`,className:`h-6 w-6 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,R.jsx)(ns,{size:12})}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{let e=!w;T(e),localStorage.setItem(`pibo.chat.showArchivedRooms`,String(e))},title:w?`Hide Archived Rooms`:`Show Archived Rooms`,"aria-label":w?`Hide Archived Rooms`:`Show Archived Rooms`,className:`h-6 w-6 inline-flex items-center justify-center border rounded-sm hover:border-[#11a4d4] hover:text-[#11a4d4] ${w?`border-[#11a4d4] text-[#11a4d4]`:`border-slate-700 text-slate-400`}`,children:w?(0,R.jsx)(Co,{size:12}):(0,R.jsx)(wo,{size:12})})]})]}),st.active.map(e=>(0,R.jsx)(K7,{room:e,selectedRoomId:f,onSelect:e=>void Ve(e),onUpdate:(e,t)=>void Ye(e,t),onArchive:(e,t)=>void Xe(e,t),onDelete:Ze},e.id)),st.active.length===0?(0,R.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No rooms`}):null,w?(0,R.jsxs)(`div`,{className:`mt-3`,children:[(0,R.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Archived Rooms`}),st.archived.map(e=>(0,R.jsx)(K7,{room:e,selectedRoomId:f,onSelect:e=>void Ve(e),onUpdate:(e,t)=>void Ye(e,t),onArchive:(e,t)=>void Xe(e,t),onDelete:Ze},e.id)),st.archived.length===0?(0,R.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No archived rooms`}):null]}):null]}):null,(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1 pb-1`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Sessions`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>void He(),disabled:P||Ce,title:`New Session`,"aria-label":`New Session`,className:`h-6 w-6 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,R.jsx)(ns,{size:12})}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>void Ue(),title:S?`Hide Archived Sessions`:`Show Archived Sessions`,"aria-label":S?`Hide Archived Sessions`:`Show Archived Sessions`,className:`h-6 w-6 inline-flex items-center justify-center border rounded-sm hover:border-[#11a4d4] hover:text-[#11a4d4] ${S?`border-[#11a4d4] text-[#11a4d4]`:`border-slate-700 text-slate-400`}`,children:S?(0,R.jsx)(Co,{size:12}):(0,R.jsx)(wo,{size:12})})]})]}),it.active.map(e=>(0,R.jsx)(q7,{node:e,selectedPiboSessionId:u,onSelect:e=>void Be(e),onRename:(e,t)=>void We(e,t),onArchive:(e,t)=>void Ge(e,t),onDelete:Ke},e.piboSessionId)),it.active.length===0?(0,R.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No active sessions`}):null]}),S?(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Archived Sessions`}),it.archived.map(e=>(0,R.jsx)(q7,{node:e,selectedPiboSessionId:u,onSelect:e=>void Be(e),onRename:(e,t)=>void We(e,t),onArchive:(e,t)=>void Ge(e,t),onDelete:Ke},e.piboSessionId)),it.archived.length===0?(0,R.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No archived sessions`}):null]}):null]}):r===`context`?(0,R.jsx)(cre,{activePanel:ee,onSelect:te,toolCount:c.agentCatalog?.piboTools.length??0,mcpServerCount:c.agentCatalog?.mcpServers.length??0}):(0,R.jsx)(sre,{activePanel:s,onSelect:e=>we({area:`settings`,panel:e}),piPackageCount:c.agentCatalog?.piPackages.length??0})]}),r===`sessions`?(0,R.jsx)(Vne,{bootstrap:c,selectedPiboSessionId:u,selectedRoomId:f,selectedRoomArchived:Ce,selectedSessionProfile:at?.profile??c.session.profile,sessionViewId:O,sessionViews:Me,currentSessionView:Ne,creatingSession:P,showRawEvents:b,showThinking:g,expandThinking:v,commands:ze,composerText:A,composerFocusSignal:M,onComposerTextChange:j,onToggleRawEvents:()=>{let e=!b;x(e),localStorage.setItem(`pibo.chat.showRawEvents`,String(e))},onToggleThinking:()=>{let e=!g;_(e),localStorage.setItem(`pibo.chat.showThinking`,String(e))},onToggleExpandThinking:()=>{let e=!v;y(e),localStorage.setItem(`pibo.chat.expandThinking`,String(e))},onSessionAgentProfileChange:e=>void Re(e),onFork:et,onOpenSession:tt,onSelectSessionView:nt,onCommand:$e,onRefreshTrace:Ie,onRefreshBootstrap:Le,onSend:async e=>{if(!(!u||Ce))try{await Qs(u,e,Qne(),f??void 0),await je(u,ye.current,f??void 0),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},onError:h}):(0,R.jsx)(`main`,{className:`min-h-0 flex flex-col`,children:r===`context`?ee===`pibo-tools`?(0,R.jsx)(h5,{tools:c.agentCatalog?.piboTools??[]}):ee===`mcp-tools`?(0,R.jsx)(g5,{servers:c.agentCatalog?.mcpServers??[],selectedServerName:I,onServerSaved:Oe}):ee===`base-prompt`?(0,R.jsx)(S2,{}):ee===`compaction-prompt`?(0,R.jsx)(T2,{}):(0,R.jsx)(u2,{agentProfiles:ct,selectedFileKey:ne}):(0,R.jsx)(bre,{activePanel:s,showThinking:g,setShowThinking:_,expandThinking:v,setExpandThinking:y,piPackages:c.agentCatalog?.piPackages,onPiPackageChanged:ke,onPiPackageRemoved:Ae})}),se?(0,R.jsx)(Wne,{room:se,confirmName:le,deleting:de,onConfirmNameChange:ue,onCancel:()=>{ce(null),ue(``)},onDelete:()=>void Qe()}):null,pe?(0,R.jsx)(Une,{session:pe,confirmText:he,deleting:_e,onConfirmTextChange:ge,onCancel:()=>{me(null),ge(``)},onDelete:()=>void qe()}):null]})})]})}function Vne({bootstrap:e,selectedPiboSessionId:t,selectedRoomId:n,selectedRoomArchived:r,selectedSessionProfile:i,sessionViewId:a,sessionViews:o,currentSessionView:s,creatingSession:c,showRawEvents:l,showThinking:u,expandThinking:d,commands:f,composerText:p,composerFocusSignal:m,onComposerTextChange:h,onToggleRawEvents:g,onToggleThinking:_,onToggleExpandThinking:v,onSessionAgentProfileChange:y,onFork:b,onOpenSession:x,onSelectSessionView:S,onCommand:C,onRefreshTrace:w,onRefreshBootstrap:T,onSend:E,onError:D}){let O=Yt(),k=(0,L.useRef)(new Map),A=(0,L.useRef)(void 0),j=(0,L.useMemo)(()=>t?R7(t,{includeRawEvents:l,rawEventsLimit:80}):null,[t,l]),M=dn({queryKey:j??[`chat`,`trace`,`idle`,`compact`,80],queryFn:()=>{if(!t)throw Error(`Session is required`);return zne(O,t,{includeRawEvents:l,rawEventsLimit:80})},enabled:!!t,gcTime:Nne,refetchOnWindowFocus:!1,retry:1}),N=M.data??null,P=(0,L.useCallback)(e=>{let t=k.current.get(e);if(!t?.length)return;let n=O.getQueryCache().findAll({queryKey:Ine(e)}),r=n.length===0;for(let i of n)O.setQueryData(i.queryKey,n=>!Lne(n)||n.piboSessionId!==e?n:(r=!0,Ere(n,t)));r&&k.current.delete(e)},[O]),F=(0,L.useCallback)(()=>{A.current!==void 0||!t||(A.current=requestAnimationFrame(()=>{A.current=void 0,P(t)}))},[P,t]),ee=(0,L.useCallback)((e,n,r=!1)=>{let i=k.current.get(e)??[];i.push(n),k.current.set(e,i),r||e!==t?P(e):F()},[P,F,t]);(0,L.useEffect)(()=>()=>{A.current!==void 0&&cancelAnimationFrame(A.current)},[]),(0,L.useEffect)(()=>{if(!t||!j||!N||N.piboSessionId!==t)return;let e=n?new URLSearchParams({roomId:n,piboSessionId:t}):new URLSearchParams({piboSessionId:t});N?.latestStreamId!==void 0&&e.set(`since`,`${N.latestStreamId}:999999`);let r=new EventSource(`/api/chat/events?${e.toString()}`),i,a,o=(e,t=!1)=>{if(i){if(!t)return;clearTimeout(i)}i=setTimeout(()=>{i=void 0,w().catch(e=>D(U7(e)))},e)},s=e=>{a||=setTimeout(()=>{a=void 0,T().catch(e=>D(U7(e)))},e)};return r.addEventListener(`pibo`,e=>{let n=Cre(e);if(!n)return;let r=n.piboSessionId||t;ee(r,n,n.type!==`TEXT_MESSAGE_CONTENT`&&n.type!==`REASONING_MESSAGE_CONTENT`);let i=wre(n);r===t&&i!==void 0?o(i,!0):r===t&&n.type!==`ready`&&o(1500,!0),Tre(n)&&s(r===t?0:150)}),()=>{i&&clearTimeout(i),a&&clearTimeout(a),r.close()}},[N?.latestStreamId,N?.piboSessionId,ee,D,T,w,t,n,j]);let te=(0,L.useMemo)(()=>N?sc(N.piboSessionId,N.title,N.nodes):null,[N]),ne=(0,L.useMemo)(()=>t?qne(e.sessions,t):[],[e.sessions,t]),re=(0,L.useMemo)(()=>t?Gne(e.sessions,t):void 0,[e.sessions,t]),I=(0,L.useMemo)(()=>t?Kne(e.sessions,t):[],[e.sessions,t]),ie=(0,L.useMemo)(()=>l?Rre(N?.rawEvents??[]):[],[l,N?.rawEvents]),ae=!!t&&M.isFetching&&!N,oe=M.error?U7(M.error):null;return(0,L.useEffect)(()=>{N?.piboSessionId&&P(N.piboSessionId)},[N?.piboSessionId,P]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`main`,{className:`min-h-0 flex flex-col`,children:[(0,R.jsxs)(`div`,{className:`h-14 px-4 bg-[#151f24] border-b border-slate-800 flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`h1`,{className:`text-base font-semibold truncate`,children:N?.title??t??e.room?.name??n}),(0,R.jsxs)(`div`,{className:`font-mono text-[11px] text-slate-500 truncate`,children:[e.room?.name??n??`Room`,` · `,N?.piboSessionId??t??``,` `,N?`· ${N.piSessionId}`:``]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`div`,{className:`flex items-center rounded-sm border border-slate-700 bg-[#0e1116] p-0.5`,children:o.map(e=>(0,R.jsx)(`button`,{type:`button`,onClick:()=>S(e.id),title:e.description??e.label,"aria-label":`Switch to ${e.label} view`,className:`min-w-20 px-2.5 py-1 text-[11px] font-bold tracking-wide ${a===e.id?`bg-[#11a4d4]/10 text-[#11a4d4]`:`text-slate-400 hover:text-[#11a4d4]`}`,children:e.label},e.id))}),(0,R.jsx)(W7,{onClick:g,title:l?`Hide Raw Events`:`Show Raw Events`,ariaLabel:l?`Hide Raw Events`:`Show Raw Events`,active:l,children:(0,R.jsx)(jo,{size:14})}),(0,R.jsx)(W7,{onClick:_,title:u?`Hide Thinking`:`Show Thinking`,ariaLabel:u?`Hide Thinking`:`Show Thinking`,active:u,children:u?(0,R.jsx)(Ao,{size:14}):(0,R.jsx)(Vo,{size:14})}),u?(0,R.jsx)(W7,{onClick:v,title:d?`Collapse Thinking`:`Expand Thinking`,ariaLabel:d?`Collapse Thinking`:`Expand Thinking`,active:d,children:d?(0,R.jsx)(Io,{size:14}):(0,R.jsx)(Ro,{size:14})}):null]})]}),oe&&!N?(0,R.jsx)(`div`,{className:`min-h-0 flex-1 p-4 text-sm text-red-200`,children:oe}):s.render({traceView:N,selectedTrace:te,isLoading:ae,showThinking:u,expandThinking:d,sessionAgentProfile:i,sessionBreadcrumbs:ne,originSession:re,derivedSessions:I,agentProfiles:e.agents,sessionProfileChangeDisabled:c||r,onSessionAgentProfileChange:y,onFork:b,onOpenSession:x}),(0,R.jsx)(Xne,{disabled:!t||r,commands:f,value:p,focusSignal:m,onValueChange:h,onCommand:C,onSend:E})]}),l?(0,R.jsxs)(`aside`,{className:`min-h-0 overflow-auto bg-[#0e1116] border-l border-slate-800 max-[980px]:hidden`,children:[(0,R.jsx)(`div`,{className:`h-11 px-3 border-b border-slate-800 flex items-center text-xs font-bold uppercase tracking-wider`,children:`Raw Events`}),(0,R.jsx)(`div`,{className:`p-3 flex flex-col gap-2`,children:ie.slice(-80).reverse().map(e=>(0,R.jsxs)(`div`,{className:`border-l-2 border-[#11a4d4] bg-[#151f24] p-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[#11a4d4] font-mono text-[11px] mb-1`,children:[(0,R.jsx)(`span`,{children:e.type}),e.count>1?(0,R.jsxs)(`span`,{className:`text-slate-500`,children:[`x`,e.count]}):null]}),(0,R.jsx)(cd,{value:e.payload,showControls:!1})]},e.id))})]}):null]})}function U7(e){return e instanceof Error?e.message:String(e)}function Hne({message:e}){return(0,R.jsx)(`div`,{className:`min-h-screen bg-[#101d22] text-slate-300 grid place-items-center`,children:(0,R.jsxs)(`div`,{className:`border border-slate-700 bg-[#1a262b] p-5 rounded-sm`,children:[(0,R.jsx)(`div`,{className:`mb-4 text-sm text-slate-400`,children:e}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>void tc(),className:`px-3 py-2 bg-[#11a4d4] rounded-sm`,children:`Sign in with Google`})]})})}function W7({title:e,ariaLabel:t,active:n,onClick:r,children:i}){return(0,R.jsx)(`button`,{type:`button`,onClick:r,title:e,"aria-label":t,className:`h-8 w-8 inline-flex items-center justify-center border rounded-sm transition-colors ${n?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`}`,children:i})}function Une({session:e,confirmText:t,deleting:n,onConfirmTextChange:r,onCancel:i,onDelete:a}){return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/70 grid place-items-center p-4`,children:(0,R.jsxs)(`div`,{className:`w-full max-w-lg border border-red-500/70 bg-[#1a262b] rounded-sm shadow-xl`,children:[(0,R.jsxs)(`div`,{className:`px-4 py-3 border-b border-red-500/50 flex items-center justify-between gap-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-sm font-bold uppercase tracking-wider text-red-200`,children:`Delete Session`}),(0,R.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500 truncate`,children:e.piboSessionId})]}),(0,R.jsx)(`button`,{type:`button`,onClick:i,disabled:n,title:`Cancel`,"aria-label":`Cancel`,className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,R.jsx)(gs,{size:14})})]}),(0,R.jsxs)(`div`,{className:`p-4 grid gap-3`,children:[(0,R.jsx)(`div`,{className:`border border-red-500/60 bg-red-500/10 text-red-100 rounded-sm p-3 text-sm`,children:`This permanently deletes the archived session, its child sessions, and their Chat events. This cannot be undone.`}),(0,R.jsxs)(`div`,{className:`text-sm text-slate-300`,children:[`Type `,(0,R.jsx)(`span`,{className:`font-mono text-red-200`,children:H7}),` to confirm.`]}),(0,R.jsx)(`input`,{value:t,onChange:e=>r(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-red-500`,placeholder:H7,autoFocus:!0}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:i,disabled:n,className:`h-8 inline-flex items-center border border-slate-700 rounded-sm px-3 text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:`Cancel`}),(0,R.jsxs)(`button`,{type:`button`,onClick:a,disabled:n||t!==H7,className:`h-8 inline-flex items-center gap-2 border border-red-500 rounded-sm px-3 text-red-200 bg-red-500/10 disabled:opacity-50`,children:[(0,R.jsx)(ds,{size:14}),`Delete permanently`]})]})]})]})})}function Wne({room:e,confirmName:t,deleting:n,onConfirmNameChange:r,onCancel:i,onDelete:a}){return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/70 grid place-items-center p-4`,children:(0,R.jsxs)(`div`,{className:`w-full max-w-lg border border-red-500/70 bg-[#1a262b] rounded-sm shadow-xl`,children:[(0,R.jsxs)(`div`,{className:`px-4 py-3 border-b border-red-500/50 flex items-center justify-between gap-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-sm font-bold uppercase tracking-wider text-red-200`,children:`Delete Room`}),(0,R.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500 truncate`,children:e.id})]}),(0,R.jsx)(`button`,{type:`button`,onClick:i,disabled:n,title:`Cancel`,"aria-label":`Cancel`,className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,R.jsx)(gs,{size:14})})]}),(0,R.jsxs)(`div`,{className:`p-4 grid gap-3`,children:[(0,R.jsx)(`div`,{className:`border border-red-500/60 bg-red-500/10 text-red-100 rounded-sm p-3 text-sm`,children:`This permanently deletes the archived room, child rooms, all contained sessions, subagent sessions, and their Chat events. This cannot be undone.`}),(0,R.jsxs)(`div`,{className:`text-sm text-slate-300`,children:[`Type `,(0,R.jsx)(`span`,{className:`font-mono text-red-200`,children:e.name}),` to confirm.`]}),(0,R.jsx)(`input`,{value:t,onChange:e=>r(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-red-500`,placeholder:e.name,autoFocus:!0}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:i,disabled:n,className:`h-8 inline-flex items-center border border-slate-700 rounded-sm px-3 text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:`Cancel`}),(0,R.jsxs)(`button`,{type:`button`,onClick:a,disabled:n||t!==e.name,className:`h-8 inline-flex items-center gap-2 border border-red-500 rounded-sm px-3 text-red-200 bg-red-500/10 disabled:opacity-50`,children:[(0,R.jsx)(ds,{size:14}),`Delete permanently`]})]})]})]})})}function G7({count:e}){if(!e||e<=0)return null;let t=e>99?`99+`:String(e);return(0,R.jsx)(`span`,{className:`min-w-5 h-5 px-1.5 inline-flex items-center justify-center rounded-full bg-[#0bda57] text-[#0e1116] text-[10px] font-bold tabular-nums leading-none`,"aria-label":`${e} unread messages`,title:`${e} unread messages`,children:t})}function K7({room:e,selectedRoomId:t,onSelect:n,onUpdate:r,onArchive:i,onDelete:a,depth:o=0}){let[s,c]=(0,L.useState)(!1),[l,u]=(0,L.useState)(e.name),[d,f]=(0,L.useState)(e.topic??``),[p,m]=(0,L.useState)(e.workspace??``),h=n9(e),g=r9(e);(0,L.useEffect)(()=>{s||(u(e.name),f(e.topic??``),m(e.workspace??``))},[s,e.name,e.topic,e.workspace]);let _=()=>{let t=l.trim();t&&(r(e.id,{name:t,topic:d.trim()||null,workspace:p.trim()||null}),c(!1))};return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`group mb-1 border rounded-sm ${h?e.id===t?`border-[#0bda57] bg-[#0bda57]/10`:`border-[#0bda57]/50 bg-[#0bda57]/5`:e.id===t?`border-[#11a4d4] bg-[#11a4d4]/10`:g?`border-[#f59e0b]/40 bg-[#f59e0b]/5`:`border-transparent`}`,style:{marginLeft:o*12},title:e.id,children:s&&!h?(0,R.jsxs)(`form`,{className:`grid gap-1 p-1`,onSubmit:e=>{e.preventDefault(),_()},children:[(0,R.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-sm outline-none focus:border-[#11a4d4]`,autoFocus:!0}),(0,R.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:`Topic`,className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-xs outline-none focus:border-[#11a4d4]`}),(0,R.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:`Workspace (/absolute/path)`,className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-xs font-mono outline-none focus:border-[#11a4d4]`}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,R.jsx)(`button`,{type:`submit`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(Mo,{size:13})}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>c(!1),className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(gs,{size:13})})]})]}):(0,R.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] items-center gap-1 py-1 pr-1`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`min-w-0 text-left px-2 py-1 grid grid-cols-[auto_minmax(0,1fr)_auto] gap-2 items-center`,children:[(0,R.jsx)(`span`,{className:`h-6 w-6 inline-flex items-center justify-center rounded-sm ${h?`bg-[#0bda57]/15 text-[#0bda57]`:g?`bg-[#f59e0b]/15 text-[#f59e0b]`:`bg-[#151f24] text-slate-500`}`,children:h?(0,R.jsx)(Qo,{size:13}):g?(0,R.jsx)(wo,{size:13}):(0,R.jsx)(Go,{size:13})}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block text-sm truncate ${g?`text-slate-500`:`text-slate-200`}`,children:e.name}),(0,R.jsx)(`span`,{className:`block text-[10px] font-mono truncate text-slate-500`,children:h?`locked personal room`:g?`archived`:Yne(e)})]}),(0,R.jsx)(G7,{count:e.unreadCount})]}),(0,R.jsx)(`div`,{className:`flex items-center gap-1 pr-1 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity`,children:h?(0,R.jsx)(`span`,{title:`Personal Chat is locked`,"aria-label":`Personal Chat is locked`,className:`h-7 w-7 inline-flex items-center justify-center border border-[#0bda57]/50 rounded-sm text-[#0bda57]`,children:(0,R.jsx)(Qo,{size:13})}):g?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>i(e.id,!1),title:`Restore Room`,"aria-label":`Restore Room`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(Co,{size:13})}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>a(e),title:`Delete Room`,"aria-label":`Delete Room`,className:`h-7 w-7 inline-flex items-center justify-center border border-red-500/70 rounded-sm text-red-300 hover:bg-red-500/10`,children:(0,R.jsx)(ds,{size:13})})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>c(!0),title:`Edit Room`,"aria-label":`Edit Room`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(ts,{size:13})}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>i(e.id,!0),title:`Archive Room`,"aria-label":`Archive Room`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(wo,{size:13})})]})})]})}),(e.children??[]).map(e=>(0,R.jsx)(K7,{room:e,selectedRoomId:t,onSelect:n,onUpdate:r,onArchive:i,onDelete:a,depth:o+1},e.id))]})}function q7({node:e,selectedPiboSessionId:t,onSelect:n,onRename:r,onArchive:i,onDelete:a,depth:o=0}){let[s,c]=(0,L.useState)(!1),[l,u]=(0,L.useState)(e.title),d=e.children.length>0,f=t?J7(e.children,t):!1,[p,m]=(0,L.useState)(f);(0,L.useEffect)(()=>{s||u(e.title)},[s,e.title]),(0,L.useEffect)(()=>{f&&m(!0)},[f]);let h=()=>{let t=l.trim();r(e.piboSessionId,t||null),c(!1)};return(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`group w-full grid grid-cols-[1fr_auto] gap-1 items-center mb-1 border rounded-sm ${e.piboSessionId===t?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-transparent`}`,style:{paddingLeft:8+o*14},title:e.piboSessionId,children:[s?(0,R.jsxs)(`form`,{className:`min-w-0 grid grid-cols-[1fr_auto_auto] gap-1 py-1 pr-1`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,R.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),c(!1),u(e.title))},autoFocus:!0,className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-sm outline-none focus:border-[#11a4d4]`}),(0,R.jsx)(`button`,{type:`submit`,title:`Save Session Title`,"aria-label":`Save Session Title`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(Mo,{size:13})}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{c(!1),u(e.title)},title:`Cancel Rename`,"aria-label":`Cancel Rename`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(gs,{size:13})})]}):(0,R.jsxs)(`div`,{className:`min-w-0 grid grid-cols-[1fr_auto] gap-2 items-center py-1 pr-1`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{if(d&&e.piboSessionId===t){m(e=>!e);return}n(e.piboSessionId)},className:`min-w-0 text-left px-1 py-1 grid grid-cols-[minmax(0,1fr)_auto] gap-2 items-center`,children:[(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block text-sm truncate ${e.archived?`text-slate-500`:`text-slate-200`}`,children:e.title}),(0,R.jsx)(`span`,{className:`block text-[10px] font-mono truncate text-slate-500`,children:e.piboSessionId})]}),(0,R.jsx)(G7,{count:e.unreadCount})]}),(0,R.jsxs)(`span`,{className:`grid grid-rows-[16px_16px] place-items-center gap-0.5`,children:[(0,R.jsx)(`span`,{className:`h-2 w-2 rounded-full ${e.status===`running`?`bg-[#0bda57]`:e.status===`error`?`bg-red-500`:`bg-slate-600`}`}),d?(0,R.jsx)(`button`,{type:`button`,onClick:()=>m(e=>!e),"aria-expanded":p,title:p?`Collapse Subsessions`:`Expand Subsessions`,"aria-label":p?`Collapse Subsessions`:`Expand Subsessions`,className:`h-4 w-4 inline-flex items-center justify-center rounded-sm transition-colors ${p?`text-[#0bda57]`:`text-slate-600 hover:text-[#11a4d4]`}`,children:(0,R.jsx)(Jo,{size:13})}):(0,R.jsx)(`span`,{className:`h-4 w-4`})]})]}),s?null:(0,R.jsxs)(`div`,{className:`flex items-center gap-1 pr-1 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>c(!0),title:`Rename Session`,"aria-label":`Rename Session`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(ts,{size:13})}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>i(e.piboSessionId,!e.archived),title:e.archived?`Restore Session`:`Archive Session`,"aria-label":e.archived?`Restore Session`:`Archive Session`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:e.archived?(0,R.jsx)(Co,{size:13}):(0,R.jsx)(wo,{size:13})}),e.archived?(0,R.jsx)(`button`,{type:`button`,onClick:()=>a(e),title:`Delete Session`,"aria-label":`Delete Session`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-red-500 hover:text-red-300`,children:(0,R.jsx)(ds,{size:13})}):null]})]}),p?e.children.map(e=>(0,R.jsx)(q7,{node:e,selectedPiboSessionId:t,onSelect:n,onRename:r,onArchive:i,onDelete:a,depth:o+1},e.piboSessionId)):null]})}function J7(e,t){return e.some(e=>e.piboSessionId===t||J7(e.children,t))}function Gne(e,t){let n=Y7(e,t);if(!n?.originId)return;let r=Y7(e,n.originId);return{piboSessionId:n.originId,label:r?Z7(r,0):n.originId}}function Kne(e,t){return Y7(e,t)?.derivedSessions.map(e=>({piboSessionId:e.piboSessionId,label:Jne(e),profile:e.profile,status:e.status}))??[]}function qne(e,t){return X7(e,t).map((e,t)=>({piboSessionId:e.piboSessionId,label:Z7(e,t)}))}function Y7(e,t){for(let n of e){if(n.piboSessionId===t)return n;let e=Y7(n.children,t);if(e)return e}}function X7(e,t,n=[]){for(let r of e){let e=[...n,r];if(r.piboSessionId===t)return e;let i=X7(r.children,t,e);if(i.length)return i}return[]}function Z7(e,t){return t?e.subagentName&&e.subagentName!==e.profile?`${e.subagentName} (${e.profile})`:e.profile||e.subagentName||e.title:e.profile||e.title}function Jne(e){return e.subagentName&&e.subagentName!==e.profile?`${e.subagentName} (${e.profile})`:e.title||e.profile||e.subagentName||`Untitled Session`}function Q7(e){let t=[],n=[];for(let r of e){if(r.archived){n.push(r);continue}let e=Q7(r.children);t.push({...r,children:e.active}),n.push(...e.archived)}return{active:t,archived:n}}function $7(e){for(let t of e){if(n9(t))return t;let e=$7(t.children??[]);if(e)return e}}function e9(e,t){for(let n of e){if(n.id===t)return n;let e=e9(n.children??[],t);if(e)return e}}function t9(e){let t=[],n=[];for(let r of e){if(n9(r)){let e=t9(r.children??[]);t.push(...e.active),n.push(...e.archived);continue}if(r9(r)){n.push(r);continue}let e=t9(r.children??[]);t.push({...r,children:e.active}),n.push(...e.archived)}return{active:t,archived:n}}function n9(e){return e.metadata.default===!0}function r9(e){return typeof e.metadata.chatRoomArchivedAt==`string`}function Yne(e){return e.topic&&e.workspace?`${e.topic} | ${e.workspace}`:e.topic?e.topic:e.workspace?e.workspace:e.type}function Xne({disabled:e=!1,commands:t,value:n,focusSignal:r,onValueChange:i,onCommand:a,onSend:o}){let s=(0,L.useRef)(null),c=(0,L.useRef)(null),[l,u]=(0,L.useState)(0),d=n.trim().startsWith(`/`)?t.filter(e=>e.slash.startsWith(n.trim().split(/\s+/)[0])):[];(0,L.useEffect)(()=>{!d.length||l<d.length||u(0)},[l,d.length]),(0,L.useEffect)(()=>{c.current?.scrollIntoView({block:`nearest`})},[l,d.length]),(0,L.useEffect)(()=>{if(r<=0)return;let e=s.current;if(!e)return;let t=e.value.length;e.focus(),e.setSelectionRange(t,t)},[r]),(0,L.useLayoutEffect)(()=>{Zne(s.current)},[n]);let f=async()=>{if(e)return;let r=n.trim();if(r){if(d.length&&!t.some(e=>e.slash===r.split(/\s+/)[0])){i(d[Math.min(l,d.length-1)].slash);return}i(``),!(r.startsWith(`/`)&&await a(r))&&await o(r)}};return(0,R.jsxs)(`div`,{className:`relative p-3 bg-[#151f24] border-t border-slate-800`,children:[d.length?(0,R.jsx)(`div`,{className:`absolute left-3 bottom-full mb-2 w-[min(520px,calc(100%-24px))] max-h-72 overflow-auto bg-[#0e1116] border border-[#11a4d4] rounded-sm shadow-xl`,children:d.map((e,t)=>(0,R.jsxs)(`button`,{ref:t===l?c:null,type:`button`,onClick:()=>{i(e.slash),u(t)},className:`w-full grid grid-cols-[120px_1fr] gap-2 px-3 py-2 text-left border-b border-slate-800 ${t===l?`bg-[#11a4d4]/15`:``}`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[#11a4d4]`,children:e.slash}),(0,R.jsx)(`span`,{className:`text-xs text-slate-400`,children:e.description})]},e.slash))}):null,(0,R.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] items-end gap-2`,children:[(0,R.jsx)(`textarea`,{ref:s,rows:1,value:n,disabled:e,onChange:e=>i(e.target.value),onKeyDown:e=>{if(d.length&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault(),u(t=>e.key===`ArrowDown`?(t+1)%d.length:(t-1+d.length)%d.length);return}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),f())},placeholder:e?`Select a session to message`:`Message selected session or type /`,className:`h-10 min-h-10 resize-none overflow-hidden bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm leading-5 outline-none focus:border-[#11a4d4] disabled:opacity-50 [scrollbar-gutter:stable]`}),(0,R.jsx)(`button`,{type:`button`,disabled:e,onClick:()=>void f(),title:`Send message`,"aria-label":`Send message`,className:`h-10 w-10 self-end inline-flex items-center justify-center bg-[#11a4d4] rounded-sm text-white disabled:opacity-50`,children:(0,R.jsx)(cs,{size:16})})]})]})}function Zne(e){if(!e)return;let t=window.getComputedStyle(e),n=i9(t.lineHeight,20),r=i9(t.borderTopWidth)+i9(t.borderBottomWidth),i=n*5+i9(t.paddingTop)+i9(t.paddingBottom);e.style.height=`auto`;let a=e.scrollHeight,o=a>i;e.style.height=`${Math.min(a,i)+r}px`,e.style.overflowY=o?`auto`:`hidden`,o&&e.selectionStart===e.value.length&&e.selectionEnd===e.value.length&&(e.scrollTop=a)}function i9(e,t=0){let n=Number.parseFloat(e);return Number.isFinite(n)?n:t}function Qne(){let e=globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2);return`web-${Date.now().toString(36)}-${e}`}function $ne({agents:e,initialCustomAgents:t,initialCatalog:n,onSelect:r,onCreateSession:i,onEditContextFile:a,onEditMcpServer:o,onAgentsChanged:s,creatingSession:c}){let[l,u]=(0,L.useState)(n??null),[d,f]=(0,L.useState)(t),[p,m]=(0,L.useState)(()=>a9(n)),[h,g]=(0,L.useState)(!1),[_,v]=(0,L.useState)(()=>localStorage.getItem(`pibo.chat.showArchivedAgents`)===`true`),[y,b]=(0,L.useState)(``),[x,S]=(0,L.useState)(null),[C,w]=(0,L.useState)(``),[T,E]=(0,L.useState)(`agent`),D=!!l;(0,L.useEffect)(()=>f(t),[t]),(0,L.useEffect)(()=>{n&&u(n)},[n]);let O=(0,L.useMemo)(()=>new Set(d.map(e=>e.profileName)),[d]),k=(0,L.useMemo)(()=>e.filter(e=>!O.has(e.name)),[e,O]),A=(0,L.useMemo)(()=>d.filter(e=>!e.archivedAt),[d]),j=(0,L.useMemo)(()=>d.filter(e=>e.archivedAt),[d]),M=(0,L.useMemo)(()=>tre(e,A),[e,A]),N=!!p.archivedAt,P=p.source===`profile`||N,F=P?null:nre(p.displayName),ee=p.profileName??(F?`new custom profile`:p.displayName),te=(0,L.useMemo)(()=>l?.contextFiles.filter(e=>(e.scope??`global`)===`agent`?e.agentProfileName===ee||p.contextFiles.includes(e.key):!0)??[],[l,p.contextFiles,ee]),ne=(0,L.useMemo)(()=>are(l?.nativeTools??[],p.nativeTools),[l?.nativeTools,p.nativeTools]),re=(0,L.useMemo)(()=>ore(te,p.contextFiles),[te,p.contextFiles]),I=async()=>{if(!P){if(F){S(F);return}if(!D){S(O9());return}g(!0);try{let e={displayName:p.displayName.trim(),description:(p.description??``).trim()||void 0,nativeTools:p.nativeTools,skills:p.skills,contextFiles:p.contextFiles,subagents:p.subagents.filter(e=>e.name.trim()&&e.targetProfile.trim()),mcpServers:p.mcpServers,piPackages:p.piPackages,builtinTools:p.builtinTools,builtinToolNames:p.builtinToolNames,autoContextFiles:p.autoContextFiles,runControl:p.runControl},t=p.id?await Vs(p.id,e):await Bs(e);f(e=>{let n=e.filter(e=>e.id!==t.agent.id);return[t.agent,...n]}),m(o9(t.agent)),r(t.agent.profileName),s(),S(null)}catch(e){let t=e instanceof Error?e.message:String(e);S(_re(t)?O9():t)}finally{g(!1)}}},ie=async e=>{if(!(!p.id||p.source!==`custom`)){g(!0);try{let t=await Vs(p.id,{archived:e});e&&(v(!0),localStorage.setItem(`pibo.chat.showArchivedAgents`,`true`)),f(e=>e.map(e=>e.id===t.agent.id?t.agent:e)),m(o9(t.agent)),b(``),s(),S(null)}catch(e){S(e instanceof Error?e.message:String(e))}finally{g(!1)}}},ae=async()=>{if(!(P||!D||!C.trim())){if(F){S(F);return}g(!0);try{let e=(await Ds({label:C.trim(),scope:T,agentProfileName:T===`agent`?ee:void 0,markdown:``})).file;u(t=>t&&{...t,contextFiles:[...t.contextFiles,e]}),m(t=>({...t,contextFiles:t.contextFiles.includes(e.key)?t.contextFiles:[...t.contextFiles,e.key]})),w(``),S(null)}catch(e){S(e instanceof Error?e.message:String(e))}finally{g(!1)}}},oe=async()=>{if(!(!p.id||!p.profileName||!N)){g(!0);try{await Hs(p.id,y),f(e=>e.filter(e=>e.id!==p.id)),m(a9(l??void 0)),b(``),s(),S(null)}catch(e){S(e instanceof Error?e.message:String(e))}finally{g(!1)}}};return(0,R.jsxs)(`div`,{className:`h-full min-h-0 overflow-hidden grid grid-cols-[300px_minmax(0,1fr)] max-[920px]:grid-cols-1`,children:[(0,R.jsxs)(`aside`,{className:`border-r border-slate-800 bg-[#1a262b] min-h-0 overflow-auto`,children:[(0,R.jsxs)(`div`,{className:`h-11 px-3 border-b border-slate-800 flex items-center justify-between text-xs font-bold uppercase tracking-wider`,children:[(0,R.jsx)(`span`,{children:`Agents`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>m(a9(l??void 0)),title:`New Agent`,"aria-label":`New Agent`,className:`p-1 border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(ns,{size:13})}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{let e=!_;v(e),localStorage.setItem(`pibo.chat.showArchivedAgents`,String(e))},title:_?`Hide Archived Agents`:`Show Archived Agents`,"aria-label":_?`Hide Archived Agents`:`Show Archived Agents`,className:`p-1 border rounded-sm hover:border-[#11a4d4] hover:text-[#11a4d4] ${_?`border-[#11a4d4] text-[#11a4d4]`:`border-slate-700 text-slate-400`}`,children:_?(0,R.jsx)(Co,{size:13}):(0,R.jsx)(wo,{size:13})}),(0,R.jsx)(`button`,{type:`button`,onClick:s,title:`Refresh`,"aria-label":`Refresh`,className:`p-1 border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(as,{size:13})})]})]}),(0,R.jsxs)(`div`,{className:`p-2`,children:[(0,R.jsxs)(h9,{title:`Custom Agents`,children:[A.map(e=>(0,R.jsx)(g9,{title:e.displayName,subtitle:e.profileName,selected:p.source===`custom`&&p.id===e.id,onSelect:()=>{m(o9(e)),r(e.profileName)},onCopy:()=>m(c9(e)),onCreateSession:()=>{r(e.profileName),i(e.profileName)},createSessionDisabled:c},e.id)),A.length===0?(0,R.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No custom agents`}):null]}),_?(0,R.jsxs)(h9,{title:`Archived Custom Agents`,children:[j.map(e=>(0,R.jsx)(g9,{title:e.displayName,subtitle:e.profileName,selected:p.source===`custom`&&p.id===e.id,onSelect:()=>{m(o9(e))},onCopy:()=>m(c9(e)),onCreateSession:()=>{},createSessionDisabled:!0},e.id)),j.length===0?(0,R.jsx)(`div`,{className:`px-2 py-3 text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm`,children:`No archived agents`}):null]}):null,(0,R.jsx)(h9,{title:`Read-only Profiles`,children:k.map(e=>(0,R.jsx)(g9,{title:e.name,subtitle:e.aliases.join(`, `)||`plugin`,selected:p.source===`profile`&&p.profileName===e.name,onSelect:()=>{m(s9(e,l??void 0)),r(e.name)},onCopy:()=>m(ere(e,l??void 0)),onCreateSession:()=>{r(e.name),i(e.name)},createSessionDisabled:c},e.name))})]})]}),(0,R.jsxs)(`section`,{className:`min-h-0 overflow-auto p-5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`h1`,{className:`text-sm font-bold uppercase tracking-wider`,children:`Agent Designer`}),(0,R.jsx)(`div`,{className:`font-mono text-[11px] text-slate-500 truncate`,children:ee}),(0,R.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-slate-500`,children:p.source===`profile`?`read-only plugin profile`:N?`archived custom agent`:`custom agent`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>{p.profileName&&(r(p.profileName),i(p.profileName))},disabled:!p.profileName||c||N,title:`New Session With Agent`,"aria-label":`New Session With Agent`,className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,R.jsx)($o,{size:14})}),p.source===`custom`&&p.id?(0,R.jsx)(`button`,{type:`button`,onClick:()=>void ie(!N),disabled:h,title:N?`Restore Agent`:`Archive Agent`,"aria-label":N?`Restore Agent`:`Archive Agent`,className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:N?(0,R.jsx)(Co,{size:14}):(0,R.jsx)(wo,{size:14})}):null,(0,R.jsx)(`button`,{type:`button`,onClick:()=>void I(),disabled:P||!D||h||!!F,title:`Save Agent`,"aria-label":`Save Agent`,className:`h-8 w-8 inline-flex items-center justify-center border border-[#11a4d4] rounded-sm text-[#11a4d4] bg-[#11a4d4]/10 disabled:opacity-50`,children:(0,R.jsx)(ss,{size:14})})]})]}),D?null:(0,R.jsx)(`div`,{className:`mb-3 border border-[#f59e0b]/60 bg-[#f59e0b]/10 text-amber-100 px-3 py-2 text-sm rounded-sm`,children:O9()}),p.source===`profile`?(0,R.jsx)(`div`,{className:`mb-3 border border-slate-700 bg-[#151f24] text-slate-300 px-3 py-2 text-sm rounded-sm`,children:`This profile is registered by a plugin. Copy it to create an editable custom agent.`}):null,N?(0,R.jsx)(`div`,{className:`mb-3 border border-[#f59e0b]/60 bg-[#f59e0b]/10 text-amber-100 px-3 py-2 text-sm rounded-sm`,children:`This agent is archived. Restore it before editing or starting new sessions.`}):null,x?(0,R.jsx)(`div`,{className:`mb-3 border border-red-500/60 bg-red-500/10 text-red-200 px-3 py-2 text-sm rounded-sm`,children:x}):null,(0,R.jsxs)(`div`,{className:`grid gap-4`,children:[(0,R.jsxs)(_9,{title:`Basics`,children:[(0,R.jsx)(`input`,{value:p.displayName,disabled:P,onChange:e=>m(t=>({...t,displayName:e.target.value})),className:`min-w-0 bg-[#0e1116] border rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60 ${F?`border-[#f59e0b]`:`border-slate-700`}`,placeholder:`agent-name`}),F?(0,R.jsx)(`div`,{className:`text-xs text-amber-100`,children:F}):null,(0,R.jsx)(`textarea`,{value:p.description,disabled:P,onChange:e=>m(t=>({...t,description:e.target.value})),className:`min-h-[72px] bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,placeholder:`Description`}),(0,R.jsx)(C9,{disabled:P,checked:p.autoContextFiles,title:`Load AGENTS.md / CLAUDE.md`,onToggle:()=>m(e=>({...e,autoContextFiles:!e.autoContextFiles}))}),(0,R.jsx)(pre,{draft:p,setDraft:m,readOnly:P})]}),(0,R.jsx)(_9,{title:`Tools`,children:(0,R.jsx)(y9,{groups:ne,empty:l?(0,R.jsx)(D9,{message:`No native tools registered`}):(0,R.jsx)(D9,{}),renderItem:e=>(0,R.jsx)(b9,{disabled:P,checked:p.nativeTools.includes(e.name),title:e.name,description:e.description,meta:e.yieldable?`yieldable`:`direct only`,onToggle:()=>m(t=>({...t,nativeTools:l9(t.nativeTools,e.name)}))},e.name)})}),(0,R.jsx)(v9,{title:`Skills`,children:l?.skills.map(e=>(0,R.jsx)(b9,{disabled:P,checked:p.skills.includes(e.name),title:e.name,description:e.path,onToggle:()=>m(t=>({...t,skills:l9(t.skills,e.name)}))},e.name))??(0,R.jsx)(D9,{})}),(0,R.jsx)(v9,{title:`Packages`,children:(0,R.jsx)(b9,{disabled:P,checked:p.runControl,title:`pibo-run-control`,description:`Expose pibo_run_* as one package for yielded native tools and subagents.`,meta:`package`,onToggle:()=>m(e=>({...e,runControl:!e.runControl}))})}),(0,R.jsx)(ure,{packages:l?.piPackages,draft:p,setDraft:m,readOnly:P}),(0,R.jsxs)(_9,{title:`Context Files`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-2`,children:[(0,R.jsx)(`input`,{value:C,disabled:P,onChange:e=>w(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,placeholder:`New context file`}),(0,R.jsx)(`button`,{type:`button`,disabled:P||h||!C.trim()||!!F,onClick:()=>void ae(),title:`Create Context File`,"aria-label":`Create Context File`,className:`h-9 w-9 inline-flex items-center justify-center border border-[#11a4d4] rounded-sm text-[#11a4d4] bg-[#11a4d4]/10 disabled:opacity-50`,children:(0,R.jsx)(ns,{size:14})})]}),(0,R.jsxs)(`div`,{className:`inline-flex w-fit gap-1 border border-slate-800 bg-[#0e1116] rounded-sm p-1`,children:[(0,R.jsx)(`button`,{type:`button`,disabled:P,onClick:()=>E(`agent`),className:`px-2 py-1 text-xs rounded-sm ${T===`agent`?`bg-[#11a4d4]/20 text-sky-100`:`text-slate-500 hover:text-slate-300`}`,children:`Agent`}),(0,R.jsx)(`button`,{type:`button`,disabled:P,onClick:()=>E(`global`),className:`px-2 py-1 text-xs rounded-sm ${T===`global`?`bg-[#11a4d4]/20 text-sky-100`:`text-slate-500 hover:text-slate-300`}`,children:`Global`})]}),(0,R.jsx)(y9,{groups:re,empty:l?(0,R.jsx)(D9,{message:`No context files registered`}):(0,R.jsx)(D9,{}),renderItem:e=>(0,R.jsx)(b9,{disabled:P,checked:p.contextFiles.includes(e.key),title:e.label??e.key,description:e.path,meta:mre(e),metaClass:`text-[#11a4d4]`,actionLabel:`Edit`,actionIcon:(0,R.jsx)(ts,{size:12}),onAction:()=>a(e.key),onToggle:()=>m(t=>({...t,contextFiles:l9(t.contextFiles,e.key)}))},e.key)})]}),(0,R.jsx)(vre,{draft:p,setDraft:m,profileOptions:M,readOnly:P}),(0,R.jsx)(yre,{servers:l?.mcpServers,draft:p,setDraft:m,readOnly:P,onEditServer:o}),N&&p.profileName?(0,R.jsxs)(_9,{title:`Delete Agent`,children:[(0,R.jsxs)(`div`,{className:`border border-red-500/60 bg-red-500/10 text-red-100 rounded-sm p-3 text-sm`,children:[`Permanently deleting this agent also deletes all Chat sessions that use profile `,(0,R.jsx)(`span`,{className:`font-mono`,children:p.profileName}),`.`]}),(0,R.jsx)(`input`,{value:y,onChange:e=>b(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-red-500`,placeholder:p.profileName}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void oe(),disabled:h||y!==p.profileName,className:`h-8 w-fit inline-flex items-center gap-2 border border-red-500 rounded-sm px-3 text-red-200 bg-red-500/10 disabled:opacity-50`,children:[(0,R.jsx)(ds,{size:14}),`Delete permanently`]})]}):null]})]})]})}function a9(e){return{displayName:`new-agent`,description:``,nativeTools:[],skills:e?.skills.some(e=>e.name===`pi-agent-harness`)?[`pi-agent-harness`]:[],contextFiles:[],subagents:[],mcpServers:[],piPackages:[],builtinTools:`default`,builtinToolNames:[...d9],autoContextFiles:!0,runControl:!1,source:`custom`}}function o9(e){return{id:e.id,profileName:e.profileName,displayName:e.displayName,description:e.description??``,nativeTools:e.nativeTools,skills:e.skills,contextFiles:e.contextFiles,subagents:e.subagents,mcpServers:e.mcpServers,piPackages:e.piPackages??[],builtinTools:e.builtinTools,builtinToolNames:u9(e.builtinToolNames,e.builtinTools),autoContextFiles:e.autoContextFiles??!0,runControl:e.runControl,archivedAt:e.archivedAt,source:`custom`}}function s9(e,t){return{displayName:e.name,description:e.description??``,nativeTools:e.nativeTools??[],skills:e.skills??(t?.skills.some(e=>e.name===`pi-agent-harness`)?[`pi-agent-harness`]:[]),contextFiles:e.contextFiles??[],subagents:e.subagents??[],mcpServers:e.mcpServers??[],piPackages:e.piPackages??[],builtinTools:e.builtinTools??`default`,builtinToolNames:u9(e.builtinToolNames,e.builtinTools),autoContextFiles:e.autoContextFiles??!0,runControl:e.runControl??!1,profileName:e.name,source:`profile`}}function ere(e,t){return{...s9(e,t),displayName:`${e.name}-copy`,id:void 0,profileName:void 0,source:`custom`}}function c9(e){return{...o9(e),displayName:`${e.profileName}-copy`,id:void 0,profileName:void 0,archivedAt:void 0,source:`custom`}}function tre(e,t){let n=new Map;for(let t of e)n.set(t.name,t.name);for(let e of t)n.set(e.profileName,e.displayName);return[...n.entries()].map(([e,t])=>({value:e,label:t}))}function nre(e){return e.trim()?e.length>120?`Agent name is too long.`:/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e)?null:`Use lowercase kebab-case only, for example test-agent.`:`Agent name is required.`}function l9(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function u9(e,t=`default`){if(t===`disabled`)return[];let n=new Set(e??d9);return d9.filter(e=>n.has(e))}var rre=new Set([`apply_patch`,`web_search`,`view_image`]),d9=[`read`,`bash`,`edit`,`write`],ire={read:`Read workspace files.`,bash:`Run shell commands.`,edit:`Edit existing files.`,write:`Create or overwrite files.`};function are(e,t){let n=new Set(t),r=new Map;for(let t of e){let e=t.pluginId??(rre.has(t.name)?`pibo.codex-compat`:void 0),i=t.pluginName??(e===`pibo.codex-compat`?`Codex Compat`:void 0),a=!e||e===`pibo.core`,o=f9(r,a?`native`:`plugin:${e}`,{title:a?`Native Tools`:m9(e,i),description:a?`Built-in Pibo tool catalog`:e??`plugin`,kind:a?`native`:`plugin`});o.items.push(t),n.has(t.name)&&(o.selectedCount+=1),o.totalCount+=1}return p9(r,[`native`,`plugin`])}function ore(e,t){let n=new Set(t),r=new Map;for(let t of e){let e=!t.pluginId,i=f9(r,e?`custom`:`plugin:${t.pluginId}`,{title:e?`Custom`:m9(t.pluginId,t.pluginName),description:e?`Loose context files without a plugin owner`:t.pluginId??`plugin`,kind:e?`custom`:`plugin`});i.items.push(t),n.has(t.key)&&(i.selectedCount+=1),i.totalCount+=1}return p9(r,[`custom`,`plugin`])}function f9(e,t,n){let r=e.get(t);if(r)return r;let i={key:t,title:n.title,description:n.description,kind:n.kind,items:[],selectedCount:0,totalCount:0,defaultOpen:!1};return e.set(t,i),i}function p9(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=[...e.values()].sort((e,r)=>{let i=n.get(e.kind)??t.length,a=n.get(r.kind)??t.length;return i===a?e.title.localeCompare(r.title):i-a});return r.map((e,t)=>({...e,defaultOpen:e.kind!==`plugin`&&(e.selectedCount>0||t===0&&r.length===1)}))}function m9(e,t){return e===`pibo.codex-compat`?`Codex Compat`:t||(e?(e.split(`.`).filter(Boolean).at(-1)??e).split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Plugin`)}function h9({title:e,children:t}){return(0,R.jsxs)(`div`,{className:`mb-4`,children:[(0,R.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:e}),t]})}function g9({title:e,subtitle:t,selected:n,onSelect:r,onCopy:i,onCreateSession:a,createSessionDisabled:o}){return(0,R.jsx)(`div`,{className:`mb-1 border rounded-sm ${n?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-transparent hover:border-slate-700`}`,children:(0,R.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_auto] items-center gap-1 p-1`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:r,className:`min-w-0 text-left px-1 py-1`,children:[(0,R.jsx)(`span`,{className:`block text-sm truncate text-slate-200`,children:e}),(0,R.jsx)(`span`,{className:`block text-[10px] font-mono truncate text-slate-500`,children:t})]}),i?(0,R.jsx)(`button`,{type:`button`,onClick:i,title:`Copy To Custom Agent`,"aria-label":`Copy To Custom Agent`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,R.jsx)(zo,{size:13})}):(0,R.jsx)(`span`,{className:`h-7 w-7`}),(0,R.jsx)(`button`,{type:`button`,onClick:a,disabled:o,title:`New Session With Profile`,"aria-label":`New Session With Profile`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:(0,R.jsx)($o,{size:13})})]})})}function sre({activePanel:e,onSelect:t,piPackageCount:n}){return(0,R.jsx)(`div`,{className:`p-2`,children:(0,R.jsxs)(`div`,{className:`mb-4`,children:[(0,R.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Settings`}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(`general`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`general`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,R.jsx)(us,{size:13,className:`text-[#11a4d4]`}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`General`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`browser-local`})]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(`pi-packages`),className:`flex w-full items-center gap-2 border p-2 text-left ${e===`pi-packages`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,R.jsx)(Jo,{size:13,className:`text-[#11a4d4]`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Pi Packages`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`runtime-packages`})]}),(0,R.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center border border-slate-700 bg-[#101d22] px-1.5 py-0.5 text-[10px] font-mono text-slate-400`,children:n})]})]})})}function cre({activePanel:e,onSelect:t,toolCount:n,mcpServerCount:r}){return(0,R.jsx)(`div`,{className:`p-2`,children:(0,R.jsxs)(`div`,{className:`mb-4`,children:[(0,R.jsx)(`div`,{className:`px-1 pb-1 text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Context`}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(`context-files`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`context-files`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,R.jsx)(Jo,{size:13,className:`text-[#11a4d4]`}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Context Files`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`managed-editor`})]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(`base-prompt`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`base-prompt`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,R.jsx)(Oo,{size:13,className:`text-[#11a4d4]`}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Base Prompt`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`system-prompt`})]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(`compaction-prompt`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`compaction-prompt`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,R.jsx)(Ao,{size:13,className:`text-[#11a4d4]`}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Compaction Prompt`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`summary-prompt`})]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(`pibo-tools`),className:`mb-1 flex w-full items-center gap-2 border p-2 text-left ${e===`pibo-tools`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,R.jsx)(hs,{size:13,className:`text-[#11a4d4]`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`Pibo Tools`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`installed-tool-context`})]}),(0,R.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center border border-slate-700 bg-[#101d22] px-1.5 py-0.5 text-[10px] font-mono text-slate-400`,children:n})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(`mcp-tools`),className:`flex w-full items-center gap-2 border p-2 text-left ${e===`mcp-tools`?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,R.jsx)(ls,{size:13,className:`text-[#11a4d4]`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm text-slate-200`,children:`MCP Tools`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`mcp-context`})]}),(0,R.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center border border-slate-700 bg-[#101d22] px-1.5 py-0.5 text-[10px] font-mono text-slate-400`,children:r})]})]})})}function _9({title:e,children:t}){return(0,R.jsxs)(`div`,{className:`border border-slate-700 bg-[#1a262b] rounded-sm p-4`,children:[(0,R.jsx)(`div`,{className:`text-xs font-bold uppercase tracking-wider text-slate-400 mb-3`,children:e}),(0,R.jsx)(`div`,{className:`grid gap-3`,children:t})]})}function v9({title:e,children:t}){return(0,R.jsx)(_9,{title:e,children:(0,R.jsx)(`div`,{className:`grid grid-cols-2 max-[1100px]:grid-cols-1 gap-2`,children:t})})}function y9({groups:e,empty:t,renderItem:n}){return e.length===0?(0,R.jsx)(R.Fragment,{children:t}):(0,R.jsx)(`div`,{className:`grid gap-2`,children:e.map(e=>(0,R.jsx)(lre,{group:e,renderItem:n},e.key))})}function lre({group:e,renderItem:t}){let[n,r]=(0,L.useState)(e.defaultOpen),i=e.kind===`custom`?`border-[#f59e0b]/70 text-amber-100 bg-[#f59e0b]/10`:`border-[#11a4d4]/70 text-sky-100 bg-[#11a4d4]/10`;return(0,R.jsxs)(`div`,{className:`border rounded-sm ${n?`border-slate-700 bg-[#101d22]`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full items-center gap-2 p-2 text-left`,children:[(0,R.jsx)(`span`,{className:`h-6 w-6 shrink-0 inline-flex items-center justify-center border rounded-sm ${i}`,children:n?(0,R.jsx)(No,{size:14}):(0,R.jsx)(Po,{size:14})}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm font-medium text-slate-100`,children:e.title}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:e.description})]}),(0,R.jsxs)(`span`,{className:`shrink-0 text-right font-mono text-sm font-semibold tabular-nums`,"aria-label":`${e.selectedCount} of ${e.totalCount} selected`,children:[(0,R.jsx)(`span`,{className:`text-[#11a4d4]`,children:e.selectedCount}),(0,R.jsxs)(`span`,{className:`text-slate-500`,children:[`/`,e.totalCount]})]})]}),n?(0,R.jsx)(`div`,{className:`border-t border-slate-800 p-2`,children:(0,R.jsx)(`div`,{className:`grid grid-cols-2 max-[1100px]:grid-cols-1 gap-2`,children:e.items.map(t)})}):null]})}function b9({checked:e,disabled:t,title:n,description:r,meta:i,metaClass:a,actionLabel:o,actionIcon:s,actionDisabled:c,onAction:l,onToggle:u}){return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{t||u()},"aria-disabled":t,className:`min-w-0 border rounded-sm p-2 text-left grid grid-cols-[18px_1fr] gap-2 ${t&&!l?`opacity-60`:``} ${e?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,R.jsx)(w9,{checked:e,className:`mt-0.5`}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsxs)(`span`,{className:`flex items-start justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(`span`,{className:`block text-sm truncate text-slate-200`,children:n})}),o&&l?(0,R.jsx)(`span`,{className:`shrink-0`,children:(0,R.jsxs)(`span`,{role:`button`,tabIndex:0,onClick:e=>{e.preventDefault(),e.stopPropagation(),c||l()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&!c&&(e.preventDefault(),e.stopPropagation(),l())},className:`inline-flex h-6 items-center justify-center gap-1 border px-1.5 text-[10px] uppercase tracking-wider ${c?`border-slate-800 text-slate-600`:`border-[#11a4d4]/70 text-[#7dd3fc] hover:border-[#11a4d4] hover:text-sky-100`}`,children:[s,o]})}):null]}),r?(0,R.jsx)(`span`,{className:`block text-xs text-slate-500 truncate`,children:r}):null,i?(0,R.jsx)(`span`,{className:`block font-mono text-[10px] mt-1 ${a??`text-slate-600`}`,children:i}):null]})]})}function ure({packages:e,draft:t,setDraft:n,readOnly:r}){let[i,a]=(0,L.useState)(()=>new Set),o=e??[],s=o.filter(gre),c=s.filter(e=>T9(t.piPackages,e)).length,l=e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,R.jsxs)(_9,{title:`Pi Packages`,children:[(0,R.jsxs)(`div`,{className:`font-mono text-[10px] uppercase tracking-wider text-slate-500`,children:[s.length,` available / `,c,` selected / `,o.length,` registered`]}),e?s.length?(0,R.jsx)(`div`,{className:`grid gap-2`,children:s.map(e=>(0,R.jsx)(dre,{pkg:e,selected:T9(t.piPackages,e),readOnly:r,expanded:i.has(e.id),busy:!1,onToggleSelected:()=>{r||n(t=>({...t,piPackages:hre(t.piPackages,e)}))},onToggleExpanded:()=>l(e.id)},e.id))}):(0,R.jsx)(D9,{message:`No installed and enabled Pi packages available. Manage Pi Packages in Settings.`}):(0,R.jsx)(D9,{})]})}function dre({pkg:e,selected:t,readOnly:n,expanded:r,busy:i,onToggleSelected:a,onToggleExpanded:o,onToggleEnabled:s,onUnregister:c}){let l=e.diagnostics.some(e=>e.type===`error`),u=!n&&(e.enabled||t);return(0,R.jsxs)(`div`,{className:`border rounded-sm ${t?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#151f24]`} ${e.enabled?``:`opacity-75`}`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-2 p-2`,children:[(0,R.jsxs)(`button`,{type:`button`,disabled:!u,onClick:a,className:`min-w-0 grid grid-cols-[18px_1fr] gap-2 text-left disabled:cursor-not-allowed`,children:[(0,R.jsx)(w9,{checked:t,disabled:!u,className:`mt-0.5`}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate text-sm text-slate-200`,children:e.name}),(0,R.jsx)(`span`,{className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider ${e.enabled?`border-[#11a4d4]/60 text-[#7dd3fc]`:`border-slate-700 text-slate-500`}`,children:e.enabled?`enabled`:`disabled`})]}),(0,R.jsx)(`span`,{className:`block text-xs text-slate-500 truncate`,children:e.description??e.source}),(0,R.jsx)(`span`,{className:`block font-mono text-[10px] mt-1 ${l?`text-[#f59e0b]`:`text-[#11a4d4]`}`,children:E9(e)})]})]}),(0,R.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:o,title:r?`Hide Details`:`Show Details`,"aria-label":r?`Hide Details`:`Show Details`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:r?(0,R.jsx)(No,{size:13}):(0,R.jsx)(Po,{size:13})}),s?(0,R.jsx)(`button`,{type:`button`,disabled:i,onClick:s,title:e.enabled?`Disable Package`:`Enable Package`,"aria-label":e.enabled?`Disable Package`:`Enable Package`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:e.enabled?(0,R.jsx)(rs,{size:13}):(0,R.jsx)(is,{size:13})}):null,c?(0,R.jsx)(`button`,{type:`button`,disabled:i,onClick:c,title:`Unregister Package`,"aria-label":`Unregister Package`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-red-400 hover:text-red-300 disabled:opacity-50`,children:(0,R.jsx)(ds,{size:13})}):null]})]}),r?(0,R.jsx)(x9,{pkg:e}):null]})}function x9({pkg:e}){return(0,R.jsxs)(`div`,{className:`border-t border-slate-800 p-3 grid gap-3 text-xs text-slate-300`,children:[(0,R.jsx)(fre,{rows:[[`Source`,e.source],[`Install`,e.installSpec],[`Version`,e.version],[`Added`,e.addedAt],[`Updated`,e.updatedAt]]}),e.repositoryUrl?(0,R.jsxs)(`a`,{href:e.repositoryUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex w-fit items-center gap-1 text-[#7dd3fc] hover:text-sky-100`,children:[(0,R.jsx)(Bo,{size:12}),`Source repository`]}):null,(0,R.jsx)(S9,{title:`Extensions`,values:e.extensionPaths}),(0,R.jsx)(S9,{title:`Skills`,values:e.skillNames}),(0,R.jsx)(S9,{title:`Prompts`,values:e.promptNames}),(0,R.jsx)(S9,{title:`Themes`,values:e.themeNames}),(0,R.jsx)(S9,{title:`Tools`,values:e.discoveredToolNames}),e.diagnostics.length?(0,R.jsxs)(`div`,{className:`grid gap-1`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:`Diagnostics`}),e.diagnostics.map((e,t)=>(0,R.jsxs)(`div`,{className:`border px-2 py-1 rounded-sm ${e.type===`error`?`border-red-500/50 text-red-200 bg-red-500/10`:e.type===`warning`?`border-[#f59e0b]/50 text-amber-100 bg-[#f59e0b]/10`:`border-slate-700 text-slate-400 bg-[#0e1116]`}`,children:[(0,R.jsx)(`span`,{className:`font-mono uppercase text-[10px] mr-2`,children:e.type}),e.message]},`${e.type}:${t}`))]}):null]})}function fre({rows:e}){let t=e.filter(([,e])=>e);return t.length===0?null:(0,R.jsx)(`div`,{className:`grid gap-1`,children:t.map(([e,t])=>(0,R.jsxs)(`div`,{className:`grid grid-cols-[84px_minmax(0,1fr)] gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-slate-500`,children:e}),(0,R.jsx)(`span`,{className:`min-w-0 break-all font-mono text-[11px] text-slate-300`,children:t})]},e))})}function S9({title:e,values:t}){return t?.length?(0,R.jsxs)(`div`,{className:`grid gap-1`,children:[(0,R.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-wider text-slate-500`,children:e}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>(0,R.jsx)(`span`,{className:`max-w-full break-all border border-slate-700 bg-[#0e1116] px-2 py-1 font-mono text-[11px] text-slate-300 rounded-sm`,children:e},e))})]}):null}function pre({draft:e,setDraft:t,readOnly:n}){let r=u9(e.builtinToolNames,e.builtinTools),[i,a]=(0,L.useState)(r.length!==d9.length),o=e=>{t(t=>{let n=l9(u9(t.builtinToolNames,t.builtinTools),e);return{...t,builtinTools:n.length===0?`disabled`:`default`,builtinToolNames:n}})};return(0,R.jsxs)(`div`,{className:`border rounded-sm ${i?`border-slate-700 bg-[#101d22]`:`border-slate-800 bg-[#151f24] hover:border-slate-700`}`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`flex w-full items-center gap-2 p-2 text-left`,children:[(0,R.jsx)(`span`,{className:`h-6 w-6 shrink-0 inline-flex items-center justify-center border rounded-sm border-[#11a4d4]/70 text-sky-100 bg-[#11a4d4]/10`,children:i?(0,R.jsx)(No,{size:14}):(0,R.jsx)(Po,{size:14})}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm font-medium text-slate-100`,children:`Pi Built-in Tools`}),(0,R.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-slate-500`,children:`basic model tools`})]}),(0,R.jsxs)(`span`,{className:`shrink-0 text-right font-mono text-sm font-semibold tabular-nums`,"aria-label":`${r.length} of ${d9.length} enabled`,children:[(0,R.jsx)(`span`,{className:`text-[#11a4d4]`,children:r.length}),(0,R.jsxs)(`span`,{className:`text-slate-500`,children:[`/`,d9.length]})]})]}),i?(0,R.jsx)(`div`,{className:`border-t border-slate-800 p-2`,children:(0,R.jsx)(`div`,{className:`grid grid-cols-2 max-[1100px]:grid-cols-1 gap-2`,children:d9.map(e=>(0,R.jsx)(b9,{disabled:n,checked:r.includes(e),title:e,description:ire[e],meta:`built-in`,onToggle:()=>o(e)},e))})}):null]})}function C9({checked:e,disabled:t,title:n,onToggle:r}){return(0,R.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":e,onClick:r,className:`inline-flex w-fit items-center gap-2 text-left text-sm text-slate-300 hover:text-slate-100 disabled:opacity-60`,children:[(0,R.jsx)(w9,{checked:e,disabled:t}),(0,R.jsx)(`span`,{children:n})]})}function w9({checked:e,disabled:t,className:n=``}){return(0,R.jsx)(`span`,{className:`h-4 w-4 shrink-0 border rounded-sm inline-flex items-center justify-center ${e?`border-[#11a4d4] text-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-600 text-transparent`} ${t?`opacity-70`:``} ${n}`,children:e?(0,R.jsx)(Mo,{size:12}):null})}function mre(e){let t=e.source??`plugin`,n=e.scope??`global`;return t===`plugin`?`plugin global`:n===`agent`?e.agentProfileName?`agent ${e.agentProfileName}`:`agent local`:`managed global`}function T9(e,t){return e.includes(t.id)||e.includes(t.name)}function hre(e,t){return T9(e,t)?e.filter(e=>e!==t.id&&e!==t.name):[...e,t.id]}function gre(e){return e.enabled&&e.installStatus===`installed`}function E9(e){let t=e.resourceTypes.length?e.resourceTypes.join(` + `):`resources pending`,n=e.version?`v${e.version}`:e.installStatus,r=e.diagnostics.some(e=>e.type===`error`)?` / needs attention`:``;return`${t} / ${n} / ${e.enabled?`enabled`:`disabled`}${r}`}function D9({message:e=`Agent Designer API unavailable`}){return(0,R.jsx)(`div`,{className:`text-xs text-amber-100 border border-dashed border-[#f59e0b]/50 bg-[#f59e0b]/10 rounded-sm p-3`,children:e})}function O9(){return`Agent Designer API unavailable. Restart the Pibo web gateway after pulling/building the latest backend.`}function _re(e){return e.toLowerCase().includes(`not found`)||e.includes(`404`)}function vre({draft:e,setDraft:t,profileOptions:n,readOnly:r}){let i=(e,n)=>{t(t=>({...t,subagents:t.subagents.map((t,r)=>r===e?{...t,...n}:t)}))};return(0,R.jsxs)(_9,{title:`Subagents`,children:[(0,R.jsx)(`div`,{className:`flex justify-end`,children:(0,R.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>t(e=>({...e,subagents:[...e.subagents,{name:`helper`,targetProfile:n[0]?.value??`pibo-minimal`,maxDepth:3}]})),className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,title:`Add Subagent`,"aria-label":`Add Subagent`,children:(0,R.jsx)(ns,{size:13})})}),(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[e.subagents.map((e,a)=>(0,R.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr_80px_auto] max-[1100px]:grid-cols-1 gap-2 border border-slate-800 bg-[#151f24] p-2 rounded-sm`,children:[(0,R.jsx)(`input`,{value:e.name,disabled:r,onChange:e=>i(a,{name:e.target.value}),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,placeholder:`name`}),(0,R.jsx)(`select`,{value:e.targetProfile,disabled:r,onChange:e=>i(a,{targetProfile:e.target.value}),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,children:n.map(e=>(0,R.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,R.jsx)(`input`,{type:`number`,min:1,disabled:r,value:e.maxDepth??3,onChange:e=>i(a,{maxDepth:Number(e.target.value)||1}),className:`bg-[#0e1116] border border-slate-700 rounded-sm px-2 py-1 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`}),(0,R.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>t(e=>({...e,subagents:e.subagents.filter((e,t)=>t!==a)})),className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-red-500 hover:text-red-300 disabled:opacity-50`,title:`Remove Subagent`,"aria-label":`Remove Subagent`,children:(0,R.jsx)(gs,{size:14})})]},a)),e.subagents.length===0?(0,R.jsx)(`div`,{className:`text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm p-3`,children:`No subagents configured`}):null]})]})}function yre({servers:e,draft:t,setDraft:n,readOnly:r,onEditServer:i}){return(0,R.jsx)(_9,{title:`MCP Servers`,children:(0,R.jsxs)(`div`,{className:`grid grid-cols-2 max-[1100px]:grid-cols-1 gap-2`,children:[e?e.map(e=>{let a=r||!e.hasDescription;return(0,R.jsxs)(`div`,{className:`border rounded-sm bg-[#151f24] p-2 ${t.mcpServers.includes(e.name)?`border-[#11a4d4]`:e.hasDescription?`border-slate-800`:`border-[#f59e0b]/60`}`,children:[(0,R.jsxs)(`button`,{type:`button`,disabled:a,onClick:()=>n(t=>({...t,mcpServers:l9(t.mcpServers,e.name)})),className:`grid w-full min-w-0 grid-cols-[18px_1fr] gap-2 text-left disabled:opacity-60`,children:[(0,R.jsx)(w9,{checked:t.mcpServers.includes(e.name),disabled:a,className:`mt-0.5`}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(ls,{size:13,className:`text-[#11a4d4]`}),(0,R.jsx)(`span`,{className:`block text-sm truncate text-slate-200`,children:e.name})]}),(0,R.jsxs)(`span`,{className:`block font-mono text-[10px] mt-1 text-slate-600`,children:[e.transport,e.descriptionSource?` / ${e.descriptionSource}`:``]})]})]}),e.hasDescription?(0,R.jsx)(`div`,{className:`mt-2 text-xs text-slate-400`,children:e.description}):(0,R.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 text-xs text-amber-100`,children:[(0,R.jsx)(fs,{size:13}),`Missing agent description`]}),(0,R.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>i(e.name),title:`Edit MCP Tool Context`,"aria-label":`Edit MCP Tool Context`,className:`inline-flex h-6 items-center justify-center gap-1 border border-[#11a4d4]/70 px-1.5 text-[10px] uppercase tracking-wider text-[#7dd3fc] hover:border-[#11a4d4] hover:text-sky-100`,children:[(0,R.jsx)(ts,{size:12}),`Edit`]})})]},e.name)}):(0,R.jsx)(D9,{}),e&&e.length===0?(0,R.jsx)(`div`,{className:`text-xs text-slate-500 border border-dashed border-slate-700 rounded-sm p-3`,children:`No MCP servers configured`}):null]})})}function bre({activePanel:e,showThinking:t,setShowThinking:n,expandThinking:r,setExpandThinking:i,piPackages:a,onPiPackageChanged:o,onPiPackageRemoved:s}){return e===`pi-packages`?(0,R.jsxs)(`div`,{className:`p-6 overflow-auto`,children:[(0,R.jsxs)(`h1`,{className:`text-sm font-bold uppercase tracking-wider mb-4 flex items-center gap-2`,children:[(0,R.jsx)(Jo,{size:16}),`Pi Packages`]}),(0,R.jsx)(xre,{packages:a,onPackageChanged:o,onPackageRemoved:s})]}):(0,R.jsxs)(`div`,{className:`p-6 overflow-auto`,children:[(0,R.jsxs)(`h1`,{className:`text-sm font-bold uppercase tracking-wider mb-4 flex items-center gap-2`,children:[(0,R.jsx)(us,{size:16}),`General`]}),(0,R.jsxs)(_9,{title:`General`,children:[(0,R.jsx)(C9,{checked:t,title:`Show thinking blocks`,onToggle:()=>{let e=!t;n(e),localStorage.setItem(`pibo.chat.showThinking`,String(e))}}),(0,R.jsx)(C9,{checked:r,disabled:!t,title:`Expand thinking blocks`,onToggle:()=>{let e=!r;i(e),localStorage.setItem(`pibo.chat.expandThinking`,String(e))}})]})]})}function xre({packages:e,onPackageChanged:t,onPackageRemoved:n}){let[r,i]=(0,L.useState)(``),[a,o]=(0,L.useState)(null),[s,c]=(0,L.useState)(null),[l,u]=(0,L.useState)(()=>new Set),d=e??[],f=d.filter(e=>e.installStatus===`installed`).length,p=d.filter(e=>e.enabled).length,m=async()=>{if(!a){o(`add`);try{let e=await Ws(r);t(e),i(``),u(t=>new Set(t).add(e.id)),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(null)}}},h=async e=>{if(!a){o(`${e.id}:enabled`);try{t(await Gs(e.id,{enabled:!e.enabled})),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(null)}}},g=async e=>{if(!a&&window.confirm(`Unregister Pi package "${e.name}"?`)){o(`${e.id}:delete`);try{n(await Ks(e.id)),u(t=>{let n=new Set(t);return n.delete(e.id),n}),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(null)}}},_=e=>{u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,R.jsxs)(_9,{title:`Pi Package Management`,children:[(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-2`,children:[(0,R.jsx)(`input`,{value:r,disabled:!e||a===`add`,onChange:e=>i(e.target.value),className:`min-w-0 bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm outline-none focus:border-[#11a4d4] disabled:opacity-60`,placeholder:`https://pi.dev/packages/package-name`}),(0,R.jsx)(`button`,{type:`button`,disabled:!e||a===`add`||!r.trim(),onClick:()=>void m(),title:`Add Pi Package`,"aria-label":`Add Pi Package`,className:`h-9 w-9 inline-flex items-center justify-center border border-[#11a4d4] rounded-sm text-[#11a4d4] bg-[#11a4d4]/10 disabled:opacity-50`,children:(0,R.jsx)(ns,{size:14})})]}),(0,R.jsx)(`div`,{className:`text-[11px] text-slate-500`,children:`Extensions execute code in the Pi runtime. Review package source before adding it.`}),s?(0,R.jsx)(`div`,{className:`border border-red-500/60 bg-red-500/10 text-red-200 px-3 py-2 text-sm rounded-sm`,children:s}):null,(0,R.jsxs)(`div`,{className:`font-mono text-[10px] uppercase tracking-wider text-slate-500`,children:[d.length,` registered / `,f,` installed / `,p,` enabled`]})]}),e?d.length?(0,R.jsx)(`div`,{className:`grid gap-2`,children:d.map(e=>(0,R.jsx)(Sre,{pkg:e,expanded:l.has(e.id),busy:a?.startsWith(`${e.id}:`)??!1,onToggleExpanded:()=>_(e.id),onToggleEnabled:()=>void h(e),onUnregister:()=>void g(e)},e.id))}):(0,R.jsx)(D9,{message:`No Pi packages registered`}):(0,R.jsx)(D9,{})]})}function Sre({pkg:e,expanded:t,busy:n,onToggleExpanded:r,onToggleEnabled:i,onUnregister:a}){let o=e.diagnostics.some(e=>e.type===`error`);return(0,R.jsxs)(`div`,{className:`border rounded-sm ${e.enabled?`border-slate-800 bg-[#151f24]`:`border-slate-800 bg-[#151f24] opacity-75`}`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-2 p-2`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate text-sm text-slate-200`,children:e.name}),(0,R.jsx)(`span`,{className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider ${e.enabled?`border-[#11a4d4]/60 text-[#7dd3fc]`:`border-slate-700 text-slate-500`}`,children:e.enabled?`enabled`:`disabled`}),(0,R.jsx)(`span`,{className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider ${e.installStatus===`installed`?`border-[#0bda57]/50 text-green-300`:`border-[#f59e0b]/50 text-amber-100`}`,children:e.installStatus})]}),(0,R.jsx)(`div`,{className:`truncate text-xs text-slate-500`,children:e.description??e.source}),(0,R.jsx)(`div`,{className:`font-mono text-[10px] mt-1 ${o?`text-[#f59e0b]`:`text-[#11a4d4]`}`,children:E9(e)})]}),(0,R.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:r,title:t?`Hide Details`:`Show Details`,"aria-label":t?`Hide Details`:`Show Details`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:t?(0,R.jsx)(No,{size:13}):(0,R.jsx)(Po,{size:13})}),(0,R.jsx)(`button`,{type:`button`,disabled:n,onClick:i,title:e.enabled?`Disable Package`:`Enable Package`,"aria-label":e.enabled?`Disable Package`:`Enable Package`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:e.enabled?(0,R.jsx)(rs,{size:13}):(0,R.jsx)(is,{size:13})}),(0,R.jsx)(`button`,{type:`button`,disabled:n,onClick:a,title:`Unregister Package`,"aria-label":`Unregister Package`,className:`h-7 w-7 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 hover:border-red-400 hover:text-red-300 disabled:opacity-50`,children:(0,R.jsx)(ds,{size:13})})]})]}),t?(0,R.jsx)(x9,{pkg:e}):null]})}function Cre(e){try{let t=JSON.parse(e.data);if(typeof t.type!=`string`)return;let n=e.lastEventId?pd(e.lastEventId):void 0;return{...t,...e.lastEventId?{streamFrameId:e.lastEventId}:{},...n?{streamId:n.streamId,streamFrameIndex:n.frameIndex}:{}}}catch{return}}function wre(e){if(e.type===`RUN_FINISHED`||e.type===`TEXT_MESSAGE_END`)return 300;if(e.type===`RUN_ERROR`)return 0}function Tre(e){return e.type===`RUN_STARTED`||e.type===`RUN_FINISHED`||e.type===`RUN_ERROR`||e.type===`TEXT_MESSAGE_END`}function k9(e,t){return fd(e.streamId,e.streamFrameIndex,t)}function Ere(e,t){return t.length?t.reduce(Dre,e):e}function Dre(e,t){if(t.type===`ready`||t.streamFrameId&&e.rawEvents.some(e=>e.id===`stream:${t.streamFrameId}`))return e;let n=new Date().toISOString(),r=e.nodes;switch(t.type){case`RUN_STARTED`:r=A9(r,{id:B9(t.runId),piboSessionId:e.piboSessionId,eventId:t.runId,type:`agent.turn`,title:`Agent Turn`,status:`running`,startedAt:n,summary:t.input?.text,input:t.input,source:`live`,stableKey:`turn:${t.runId}`,orderKey:k9(t,`agent.turn`),children:[]});break;case`RUN_FINISHED`:r=P9(r,t.runId,n);break;case`RUN_ERROR`:t.runId&&(r=M9(r,B9(t.runId),e=>({...e,status:`error`,completedAt:n,error:t.message}))),r=j9(r,{id:`event:error:${t.runId??n}`,parentId:t.runId?B9(t.runId):void 0,piboSessionId:e.piboSessionId,eventId:t.runId,type:`error`,title:`Error`,status:`error`,startedAt:n,error:t.message,output:t.message,source:`live`,stableKey:`error:${t.runId??n}`,orderKey:k9(t,`error`),children:[]});break;case`TEXT_MESSAGE_START`:r=A9(r,R9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`assistant.message`)));break;case`TEXT_MESSAGE_CONTENT`:r=F9(r,R9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`assistant.message`)),t.delta);break;case`TEXT_MESSAGE_END`:r=j9(r,{...R9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`assistant.message`)),status:`done`,completedAt:n,...t.finalText===void 0?{}:{summary:t.finalText,output:t.finalText}}),r=M9(r,B9(t.runId??t.messageId),e=>({...e,status:`done`,completedAt:n}));break;case`REASONING_MESSAGE_START`:r=A9(r,z9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`model.reasoning`)));break;case`REASONING_MESSAGE_CONTENT`:r=F9(r,z9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`model.reasoning`)),t.delta);break;case`REASONING_MESSAGE_END`:r=j9(r,{...z9(t.messageId,t.runId,e.piboSessionId,n,k9(t,`model.reasoning`)),status:`done`,completedAt:n,...t.finalText===void 0?{}:{summary:t.finalText,output:t.finalText}});break;case`TOOL_CALL_START`:r=A9(r,{id:V9(t.toolCallId),parentId:t.runId?B9(t.runId):void 0,piboSessionId:e.piboSessionId,eventId:t.runId,toolCallId:t.toolCallId,type:`tool.call`,title:t.toolName,status:`running`,startedAt:n,input:t.args,source:`live`,stableKey:`tool:${t.toolCallId}`,orderKey:k9(t,`tool.call`),children:[]});break;case`TOOL_CALL_ARGS`:r=M9(r,V9(t.toolCallId),e=>({...e,input:t.args}));break;case`TOOL_CALL_RESULT`:r=M9(r,V9(t.toolCallId),r=>({...Nre({...r,status:t.isError?`error`:`done`,completedAt:n,output:t.result,error:t.isError?Lre(t.result):r.error},e.piboSessionId,n)}));break;case`AGENT_DELEGATION`:{let i=t.toolCallId?V9(t.toolCallId):`event:subagent:${t.childPiboSessionId}`,a=L9(r,i);if(a&&W9(a)){r=M9(r,i,r=>Mre(r,t,e.piboSessionId,n));break}r=j9(r,{id:i,piboSessionId:e.piboSessionId,toolCallId:t.toolCallId,type:`agent.delegation`,title:t.toolName,status:`running`,startedAt:n,summary:t.subagentName,input:{subagentName:t.subagentName,threadKey:t.threadKey},linkedPiboSessionId:t.childPiboSessionId,source:`live`,stableKey:t.toolCallId?`tool:${t.toolCallId}`:`subagent:${t.childPiboSessionId}`,orderKey:k9(t,`agent.delegation`),children:[]});break}case`EXECUTION_RESULT`:if(Ire(t.action))break;r=j9(r,{id:`event:execution_result:${t.runId??t.action}`,piboSessionId:e.piboSessionId,eventId:t.runId,type:`execution.command`,title:t.action,status:`done`,startedAt:n,input:{action:t.action},output:t.result,source:`live`,stableKey:`execution:${t.runId??t.action}`,orderKey:k9(t,`execution.command`),children:[]});break;case`RAW_EVENT`:break}return{...e,nodes:r,rawEvents:kre(e.rawEvents,t,n)}}function A9(e,t){return L9(e,t.id)?e:j9(e,t)}function j9(e,t){if(L9(e,t.id))return M9(e,t.id,e=>({...e,...t,startedAt:e.startedAt??t.startedAt,source:e.source??t.source,stableKey:e.stableKey??t.stableKey,orderKey:e.orderKey??t.orderKey,children:t.children.length?t.children:e.children}));let n=t.parentId?L9(e,t.parentId):void 0;return n?M9(e,n.id,e=>({...e,children:I9([...e.children??[],t])})):I9([...e,t])}function M9(e,t,n){return N9(e,t,n)??e}function N9(e,t,n){for(let r=0;r<e.length;r+=1){let i=e[r];if(i.id===t){let t=n(i);if(t===i)return;let a=e.slice();return a[r]=t,a}let a=N9(i.children??[],t,n);if(a){let t=e.slice();return t[r]={...i,children:a},t}}}function P9(e,t,n){let r=B9(t),i=!1,a=e.map(e=>{let a=e.children.length?P9(e.children,t,n):e.children,o=a!==e.children,s=e.id===r||e.eventId===t||e.parentId===r;return!o&&(!s||e.status!==`running`)?e:(i=!0,{...e,...s&&e.status===`running`?{status:`done`,completedAt:n}:{},children:a})});return i?a:e}function F9(e,t,n){let r=L9(e,t.id);if(!r)return j9(e,{...t,summary:n,output:n});let i=`${typeof r.output==`string`?r.output:``}${n}`;return M9(e,r.id,e=>({...e,status:`running`,summary:i,output:i}))}function I9(e){return[...e].sort(Ore).map(e=>e.children.length?{...e,children:I9(e.children)}:e)}function Ore(e,t){let n=hd(e.orderKey,t.orderKey);return n===0?(e.startedAt??``).localeCompare(t.startedAt??``)||e.id.localeCompare(t.id):n}function L9(e,t){for(let n of e){if(n.id===t)return n;let e=L9(n.children??[],t);if(e)return e}}function R9(e,t,n,r,i){let a=t??e;return{id:Are(e),parentId:B9(a),piboSessionId:n,eventId:a,type:`assistant.message`,title:`Agent Message`,status:`running`,startedAt:r,summary:``,output:``,source:`live`,stableKey:`assistant:${e}`,orderKey:i,children:[]}}function z9(e,t,n,r,i){let a=t??e;return{id:jre(e),parentId:B9(a),piboSessionId:n,eventId:a,type:`model.reasoning`,title:`Thinking`,status:`running`,startedAt:r,summary:``,output:``,source:`live`,stableKey:`reasoning:${e}`,orderKey:i,children:[]}}function kre(e,t,n){return[...e.slice(-999),{id:t.streamFrameId?`stream:${t.streamFrameId}`:`stream:${n}:${e.length}`,type:t.type,createdAt:n,payload:t}]}function B9(e){return`event:message:${e}`}function Are(e){return`event:assistant:${e}`}function jre(e){return`event:thinking:${e}`}function V9(e){return`tool:${e}`}function Mre(e,t,n,r){let i=U9(e,n,r,{toolName:t.toolName,subagentName:t.subagentName,threadKey:t.threadKey,linkedPiboSessionId:t.childPiboSessionId});return i?H9(e,i):e}function Nre(e,t,n){let r=U9(e,t,n);return r?H9(e,r):e}function H9(e,t){return e.children.find(e=>e.id===t.id)?{...e,children:I9(e.children.map(e=>e.id===t.id?{...e,...t,runId:t.runId??e.runId,linkedPiboSessionId:t.linkedPiboSessionId??e.linkedPiboSessionId,startedAt:e.startedAt??t.startedAt,source:e.source??t.source,stableKey:e.stableKey??t.stableKey,orderKey:e.orderKey??t.orderKey,children:e.children}:e))}:{...e,children:I9([...e.children,t])}}function U9(e,t,n,r){if(!W9(e))return;let i=Pre(e.output),a=Q9(e.input)?e.input:{},o=G9(i?.toolName)||G9(a.toolName)||r?.toolName;if(!o||!o.startsWith(`pibo_subagent_`))return;let s=G9(i?.runId),c=G9(i?.status),l=r?.subagentName||o.slice(14),u=G9(i?.completionPolicy)||G9(a.completionPolicy);return{id:`${e.id}:async-agent`,parentId:e.id,piboSessionId:t,eventId:e.eventId,toolCallId:e.toolCallId,runId:s,type:`agent.async`,title:l,status:Fre(e,c),startedAt:n,completedAt:c===`completed`||c===`cancelled`?e.completedAt:void 0,summary:`Started by ${e.title}`,input:{startedBy:e.title,startToolCallId:e.toolCallId,toolName:o,subagentName:l,runId:s,completionPolicy:u,arguments:a.arguments,threadKey:r?.threadKey},output:i,error:e.error,linkedPiboSessionId:r?.linkedPiboSessionId??e.linkedPiboSessionId,source:e.source,stableKey:s?`async-agent:${s}`:`${e.stableKey??e.id}:async-agent`,orderKey:md(e.orderKey,`agent.async`),children:[]}}function W9(e){return e.type===`tool.call`&&e.title===`pibo_run_start`}function Pre(e){if(Q9(e)){if(typeof e.runId==`string`&&typeof e.toolName==`string`)return e;if(Q9(e.details)&&typeof e.details.runId==`string`&&typeof e.details.toolName==`string`)return e.details}}function G9(e){return typeof e==`string`?e:``}function Fre(e,t){return e.status===`error`||t===`failed`?`error`:t===`completed`||t===`cancelled`?`done`:`running`}function Ire(e){return e===`session.fork`||e===`session.clone`||e===`session.switch`}function Lre(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Rre(e){let t=[];for(let n of e){let e=t[t.length-1];if(e&&Hre(e,n)){e.count+=1,e.createdAt=n.createdAt,e.payload={...Q9(e.payload)?e.payload:{},text:`${X9(e.payload)}${X9(n.payload)}`};continue}t.push({...n,count:1})}return t}function K9(e,t){return e.some(e=>e.name===t||e.aliases.includes(t))}function q9(){try{let e=localStorage.getItem(B7);if(!e)return{};let t=JSON.parse(e);if(!Q9(t))return{};let n=Q9(t.sessionsByRoom)?Object.fromEntries(Object.entries(t.sessionsByRoom).filter(e=>typeof e[0]==`string`&&typeof e[1]==`string`&&!!e[1])):void 0;return{roomId:typeof t.roomId==`string`&&t.roomId?t.roomId:void 0,piboSessionId:typeof t.piboSessionId==`string`&&t.piboSessionId?t.piboSessionId:void 0,...n&&Object.keys(n).length?{sessionsByRoom:n}:{}}}catch{return{}}}function zre(e){try{let t={...q9().sessionsByRoom??{},...e.sessionsByRoom??{}};e.roomId&&e.piboSessionId&&(t[e.roomId]=e.piboSessionId),localStorage.setItem(B7,JSON.stringify({roomId:e.roomId,piboSessionId:e.piboSessionId,...Object.keys(t).length?{sessionsByRoom:t}:{}}))}catch{}}function J9(e){try{let t=q9();if(!t.sessionsByRoom?.[e])return;let{[e]:n,...r}=t.sessionsByRoom;localStorage.setItem(B7,JSON.stringify({roomId:t.roomId,piboSessionId:t.piboSessionId,...Object.keys(r).length?{sessionsByRoom:r}:{}}))}catch{}}function Y9(){try{return localStorage.getItem(V7)===`terminal`?`terminal`:v5}catch{return v5}}function Bre(e){try{localStorage.setItem(V7,e)}catch{}}function Vre(){try{localStorage.removeItem(B7)}catch{}}function Hre(e,t){if(e.type!==t.type||e.type!==`assistant_delta`&&e.type!==`thinking_delta`&&e.type!==`TEXT_MESSAGE_CONTENT`&&e.type!==`REASONING_MESSAGE_CONTENT`)return!1;let n=Q9(e.payload)?e.payload:{},r=Q9(t.payload)?t.payload:{};return Z9(n)===Z9(r)}function X9(e){return Q9(e)?typeof e.text==`string`?e.text:typeof e.delta==`string`?e.delta:``:``}function Z9(e){return e.eventId??e.messageId}function Ure(e){return!Q9(e)||!Q9(e.result)?null:e}function Wre(e){if(!(!Q9(e)||!Q9(e.result)))return typeof e.result.piboSessionId==`string`?e.result.piboSessionId:void 0}function Q9(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}var Gre=new Gt({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});function Kre(){let e=mo({select:e=>({pathname:e.location.pathname,search:e.location.search})});return(0,R.jsx)(Bne,{route:qre(e.pathname,e.search)})}function qre(e,t){let n=(e.startsWith(`/apps/chat`)?e.slice(10)||`/`:e).split(`/`).filter(Boolean).map(e=>decodeURIComponent(e)),r=b5(t.view);return n[0]===`context`?{area:`context`}:n[0]===`agents`?{area:`agents`}:n[0]===`settings`?{area:`settings`,panel:n[1]===`pi-packages`?`pi-packages`:`general`}:n[0]===`rooms`&&n[1]&&n[2]===`sessions`&&n[3]?{area:`sessions`,roomId:n[1],piboSessionId:n[3],sessionViewId:r}:n[0]===`rooms`&&n[1]?{area:`sessions`,roomId:n[1],sessionViewId:r}:n[0]===`sessions`&&n[1]?{area:`sessions`,piboSessionId:n[1],sessionViewId:r}:{area:`sessions`,sessionViewId:r}}var $9=Ya({component:Kre}),Jre=qa({getParentRoute:()=>$9,path:`/`}),Yre=qa({getParentRoute:()=>$9,path:`sessions/$piboSessionId`}),Xre=qa({getParentRoute:()=>$9,path:`rooms/$roomId`}),Zre=qa({getParentRoute:()=>$9,path:`rooms/$roomId/sessions/$piboSessionId`}),Qre=qa({getParentRoute:()=>$9,path:`agents`}),$re=qa({getParentRoute:()=>$9,path:`context`}),eie=qa({getParentRoute:()=>$9,path:`settings`}),tie=qa({getParentRoute:()=>$9,path:`settings/pi-packages`}),nie=lo({routeTree:$9.addChildren([Jre,Yre,Xre,Zre,Qre,$re,eie,tie]),basepath:`/apps/chat`});(0,_s.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(Xt,{client:Gre,children:(0,R.jsx)(po,{router:nie})})}));export{OK as i,_G as n,vG as r,mG as t};
|