@malloy-publisher/app 0.13.0 → 0.14.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.
Files changed (24) hide show
  1. package/dist/api-doc.yaml +198 -105
  2. package/dist/assets/{EnvironmentPage-B74sWMJb.js → EnvironmentPage-CX8dwMPh.js} +1 -1
  3. package/dist/assets/{HomePage-BOb2eaod.js → HomePage-C7yrR-ec.js} +1 -1
  4. package/dist/assets/{MainPage-D6QvMDBc.js → MainPage-BKs7CeWW.js} +1 -1
  5. package/dist/assets/{ModelPage-DOac8VF3.js → ModelPage-BGlX8geE.js} +2 -2
  6. package/dist/assets/{PackagePage-CpahRMLt.js → PackagePage-Bd5y7ILU.js} +1 -1
  7. package/dist/assets/PackageSplatRoute-Cw-yA9CE.js +2 -0
  8. package/dist/assets/{RenderedResult-D5HJr2Xo.es-CFweT1ny.js → RenderedResult-D0kAzSrP.es-DldjGxsY.js} +3 -3
  9. package/dist/assets/{RouteError-r7ydeLAE.js → RouteError-BJHAXzBN.js} +1 -1
  10. package/dist/assets/{ThemeEditorPage-dxaIYM0S.js → ThemeEditorPage-yUJpFBCR.js} +1 -1
  11. package/dist/assets/{ToggleButtonGroup-B8CQst36.js → ToggleButtonGroup-BoCnLGaG.js} +1 -1
  12. package/dist/assets/{documentRoutes-Dn5OclPv.js → documentRoutes-CIhmKz4i.js} +1 -1
  13. package/dist/assets/{editPageMounted-BXWQAQvv.js → editPageMounted-B5IyuuMZ.js} +2 -2
  14. package/dist/assets/{index-jw6yCO3t.js → index-B6DUq-GT.js} +1 -1
  15. package/dist/assets/{index-C2rpVa58.js → index-DTKG_ab2.js} +1 -1
  16. package/dist/assets/{index-D3PvzI_V.js → index-DqJz_hGj.js} +119 -119
  17. package/dist/assets/{index-BiZnC_i6.js → index-DrMbh_v4.js} +1 -1
  18. package/dist/assets/{index.es-BfpodLFo.js → index.es-VBpWc8yM.js} +1 -1
  19. package/dist/assets/usePackageLinkNavigate-BcERmCFv.js +1 -0
  20. package/dist/assets/{usePackageRoute-CwvWFoYD.js → usePackageRoute-CTkLtO3i.js} +1 -1
  21. package/dist/index.html +1 -1
  22. package/package.json +2 -2
  23. package/dist/assets/PackageSplatRoute-BBPH3864.js +0 -2
  24. package/dist/assets/usePackageLinkNavigate-CpjXFkgK.js +0 -1
package/dist/api-doc.yaml CHANGED
@@ -1500,7 +1500,7 @@ paths:
1500
1500
  424 refusal, or 200 with the package as it would load, its `warnings` included, plus the
1501
1501
  `location` it was loaded from. The 200 also carries what a publish would build and serve:
1502
1502
  the `buildPlan`, and `serveVerdicts`, each materialized source's serve verdict with each
1503
- stored source's named views compiled against a serve shape (no table is built). With package versioning on, the tree's `publisher.json`
1503
+ stored source's named views compiled against a compile-only served copy (no table is built). With package versioning on, the tree's `publisher.json`
1504
1504
  must declare a valid version, as a versioned publish requires (400
1505
1505
  `MANIFEST_VERSION_MISSING` or `MANIFEST_VERSION_INVALID`), and the 200 names it as
1506
1506
  `versionId`. Version lifecycle checks (a version that already exists, `latest`) are not
@@ -5130,8 +5130,9 @@ components:
5130
5130
  description: >-
5131
5131
  For a `live` verdict, why: `refused` (the plan refused to build it),
5132
5132
  `storage_mode` (`storage=` while `PERSIST_STORAGE_MODE` is not
5133
- `on`), `rollup_over_stored_base` (a rollup over a `storage=` base,
5134
- left out of the plan), `unreachable` (no source on the package's
5133
+ `on`), `rollup_over_stored_base` (retained, never reported by a
5134
+ released server: a rollup over a `storage=` base is planned like
5135
+ any other), `unreachable` (no source on the package's
5135
5136
  published surface reads it), `row_level_gate` (every query through
5136
5137
  it carries an `#(authorize)` or `#(access_filter)` gate, which the
5137
5138
  storage tier and rollups cannot keep yet), `shadowed` (its storage
@@ -5173,9 +5174,10 @@ components:
5173
5174
  type: array
5174
5175
  description: >-
5175
5176
  On a dry run, for a source stored with `storage=`: each named view
5176
- on it, and whether it compiles against the serve shape. A view that
5177
- does not is answered live, and `detail` carries the compile error
5178
- that says why (usually a field the shape cannot reproduce).
5177
+ on it, and whether it compiles against a compile-only served copy. A
5178
+ view that does not is answered live, and `detail` carries the compile
5179
+ error that says why (usually a field the stored table cannot
5180
+ reproduce).
5179
5181
  items:
5180
5182
  $ref: "#/components/schemas/ViewServeVerdict"
5181
5183
 
@@ -5891,37 +5893,80 @@ components:
5891
5893
  cannot tell from a real de-identification, so a review has
5892
5894
  to (one per field, `subject` the source; `warn`; a plain
5893
5895
  copy under `#(carries)` refuses the load instead).
5894
- `preaggregate-over-stored-base`: a source persisted with
5895
- `#@ persist storage=` that also declares `#@ preaggregate
5896
- storage=` rollups, which are left out of the build plan and
5897
- every run because a rollup over a stored base can neither build
5898
- nor serve yet (one per base, `subject` the base; `warn`; the
5899
- base still builds and serves from storage).
5900
- `persist-unparseable`: a `#@` annotation that does not
5901
- parse, so Malloy drops its source from the build and it is
5902
- served live (one per annotation, `model` its file; `error`;
5903
- refused at publish, while a package already published keeps
5904
- loading). `persist-retired-key`: a `#@ persist` key no longer
5905
- read, `sharing=` or `schedule=`, with what to write instead
5906
- (one per key, `subject` the source; `error`; refused at
5907
- publish). `persist-unknown-key`: a `#@ persist` key Publisher
5908
- does not read, such as a misspelled `merge_key=` (one per
5909
- key, `subject` the source; `warn`).
5910
- `persist-not-materializable`: a `#@ persist` source the build
5911
- walk did not recognize, served live (`subject` the source;
5912
- `warn`). `persist-source-refused`: a `#@ persist` source a
5913
- compile-time gate refused (a row-level gate, a free
5914
- parameter, a given in the persisted query, or the `storage=`
5915
- gate), served live, with the gate's message (`subject` the
5916
- source, or a rollup's base; `warn`).
5896
+ `preaggregate-over-stored-base`: retained, never reported by a
5897
+ released server. A `#@ preaggregate` rollup over a
5898
+ `#@ persist storage=` base is planned, built and served like
5899
+ any other rollup.
5900
+ Materialization codes follow one rule: the suffix tells the
5901
+ outcome. An INVALID annotation (or invalid code it covers)
5902
+ fails the publish and the load, on every path, so its code
5903
+ appears only in the load failure's message (the publish 4xx
5904
+ and `loadErrors`), never as a warning here:
5905
+ `persist-invalid`, `materialize-invalid`,
5906
+ `preaggregate-invalid`, `persist-view-invalid` and
5907
+ `persist-query-invalid` (a bad value or contradictory
5908
+ combination: a `storage=` that names nothing, an `@env.`
5909
+ reference, an unusable or reserved `name=`, an `inline=`
5910
+ that names no join, an incremental key on a view or query);
5911
+ `persist-unknown-key`, `materialize-unknown-key` and
5912
+ `preaggregate-unknown-key` (every route's key set is closed);
5913
+ `persist-retired-key` and `materialize-retired-key`
5914
+ (`sharing=`, `schedule=`, `partition=`);
5915
+ `persist-unparseable`, `materialize-unparseable` and
5916
+ `preaggregate-unparseable`; `persist-not-materializable` (a
5917
+ `#@ persist` on a shape Malloy does not plan);
5918
+ `preaggregate-not-a-measure`, `preaggregate-unknown-grain`
5919
+ and `preaggregate-not-mergeable`;
5920
+ `materialization-table-collision` (two sources whose
5921
+ `name=` puts them on one table; under
5922
+ `PERSIST_COLLISION_ENFORCE=false` a refusal instead); and
5923
+ `materialization-near-miss` (a misspelled materialization
5924
+ route or directive, such as `#(materialise)` or
5925
+ `#@ persits`). `preaggregate-malformed` is retained and no
5926
+ longer produced: it is `preaggregate-invalid` or
5927
+ `preaggregate-unparseable` now.
5928
+ A VALID annotation Publisher cannot build here is refused
5929
+ alone, answered live, while the package loads, and is
5930
+ severity `warn`, never `error`: `persist-not-built` (a
5931
+ `#@ persist` source a compile-time gate refused, a row-level
5932
+ gate, a free parameter, a given in the persisted query, the
5933
+ `storage=` gate, an incremental declaration the dialect cannot
5934
+ honour, or, under `PERSIST_COLLISION_ENFORCE=false`, a table
5935
+ another source writes; `subject` the source).
5936
+ `persist-source-refused` is its former name: each gate
5937
+ refusal (the cases it named before) is repeated under it,
5938
+ with the same message, for one release, then the repeat is
5939
+ removed; the refusals new in this release carry
5940
+ `persist-not-built` only.
5941
+ `materialize-not-built` (a valid `#(materialize)` Publisher
5942
+ cannot lay out or build; `subject` the source).
5943
+ `persist-view-not-built` and `persist-query-not-built` (a
5944
+ persisted view or named query that is not built: the feature
5945
+ is off (`PUBLISHER_MATERIALIZE`), or the message says why;
5946
+ `subject` the view or query). `preaggregate-not-built`: a
5947
+ valid `#(preaggregate)` or `#@ preaggregate` rollup a
5948
+ compile-time gate refused alone (a read-only dialect, a base
5949
+ scoped by a given, a table name another rollup holds, a
5950
+ row-level gate on a v1 rollup's base, or the `storage=`
5951
+ gate), so it is not built and its measures are served live
5952
+ while the rest of the package loads; the message names the
5953
+ base, the grain and the gate's reason (`subject` the base;
5954
+ `warn`). The rollup sub-family keeps its own codes:
5955
+ `preaggregate-hidden-field`, `-access-filter`, `-time-zone`,
5956
+ `-current-time`, `-reads-given`, `-unreadable-measure`,
5957
+ `-join-level` (also a `#@ preaggregate` over a source with a
5958
+ fan-out join), and `-name-clash`.
5959
+ `materialization-storage-mode`: a `storage=` source the
5960
+ deployment's `PERSIST_STORAGE_MODE` (`off` or `write-only`)
5961
+ does not serve from storage (`subject` the source, or a
5962
+ rollup's base; `warn`).
5917
5963
  `persist-incremental-no-merge-key`: an incremental source
5918
5964
  with no `merge_key=`, so each refresh replaces its watermark
5919
5965
  range (`subject` the source; `warn`).
5920
5966
  `persist-incremental-shared-address`: sources that compile to
5921
5967
  the same SQL on one connection, so they share one table and
5922
5968
  one boundary, where at least one is incremental (one per
5923
- source; `warn`). `preaggregate-hidden-field`: a `#@ preaggregate` on a
5924
- private or internal field or grain dimension (`warn`).
5969
+ source; `warn`).
5925
5970
  `join-bypass`: an author join from a published source to one
5926
5971
  with a stricter gate, which the join does not carry (one per
5927
5972
  join, or one for a walk cut short at the join bound; always
@@ -5933,6 +5978,16 @@ components:
5933
5978
  column, `model` the first model binding it, `subject` the
5934
5979
  source, the message naming the column, both types and which
5935
5980
  of the two applies; `warn`; see docs/materialization.md).
5981
+ `stored-native-schema-missing`: a colocated table is bound
5982
+ with no captured warehouse type (its manifest entry's
5983
+ `nativeSchema`) for a column whose field Malloy types as a big
5984
+ integer. On BigQuery the column is read as `INT64`, its only
5985
+ integer type, and still serves; on any other dialect it is
5986
+ left out, so a query that reads it is answered live. The next
5987
+ full rebuild captures the types (one per source, `model` the
5988
+ first model binding it, `subject` the source, the message
5989
+ naming the columns and which applies; `warn`; see
5990
+ docs/materialization.md).
5936
5991
  `entities-…` (`entities-not-a-dimension`,
5937
5992
  `entities-parameterized-source`,
5938
5993
  `entities-multiple-required-filters`,
@@ -8479,9 +8534,9 @@ components:
8479
8534
  to degrade to the live warehouse. **The rows are correct and the
8480
8535
  request succeeded**, which is why this needs its own value: it is
8481
8536
  indistinguishable from a storage hit at the call site, and treating it
8482
- as one would report a healthy hit rate for a broken store. This value
8483
- is NOT the same event as the `live_fallback` label on
8484
- `publisher_storage_serve_routing_total` — see the warning below.
8537
+ as one would report a healthy hit rate for a broken store. On
8538
+ `publisher_query_route_total` the same event is the answering leg's
8539
+ `outcome="fallback", reason="RUN_FAILED"`.
8485
8540
 
8486
8541
  **This field describes the `storage=` tier and nothing else.** It
8487
8542
  records how the storage routing decision came out, so it says nothing
@@ -8498,26 +8553,20 @@ components:
8498
8553
  2. It was answered from a **colocated** materialized table. The
8499
8554
  query never reached the routing decision, so a fully materialized
8500
8555
  answer reports the same null a fully live one does.
8501
- 3. The storage transform was **ineligible** for this query, so it was
8502
- served live. The query DID reach the routing decision and the tier
8556
+ 3. The served copy did **not answer** this query, so it was served
8557
+ live. The query DID reach the routing decision and the tier
8503
8558
  declined it — a storage-tier miss, reported identically to "no
8504
8559
  materialization exists anywhere."
8505
8560
 
8506
8561
  Case 3 is the one that costs time, because nothing about this field
8507
8562
  distinguishes it from case 1. `path`, the path report, does: it names
8508
8563
  the table that answered in every tier, and why each table that could
8509
- have answered did not. The server does log it: one
8510
- `storage serve-shape ineligible for this query; serving live` line at
8511
- INFO per routed query, carrying the compile error that made the shape
8512
- ineligible, plus `shapeSources` (what the shape offered) and
8513
- `staleSources` (bound, but withheld by the freshness gate). The
8514
- compile error alone does not separate those: `Reference to undefined
8515
- object 'x'` reads identically whether `x` carries no `#@ persist` at
8516
- all or is materialized and merely past its freshness window. That log
8517
- is currently the only per-query account of a storage-tier miss. It is not a hypothetical shape — a source
8518
- warehouse that folds unquoted identifiers to upper case made every
8519
- query on every `storage=` source in a package ineligible, and the
8520
- whole tier reported null for months while looking exactly like a
8564
+ have answered did not. The server also logs one
8565
+ `served copy cannot answer this query` line at DEBUG per declined
8566
+ query, carrying the error that declined it. It is not hypothetical —
8567
+ a source warehouse that folds unquoted identifiers to upper case once
8568
+ made every query on every `storage=` source in a package miss, and
8569
+ the whole tier reported null for months while looking exactly like a
8521
8570
  deployment that had never enabled it.
8522
8571
 
8523
8572
  For the colocated tier there is no per-query signal at all. The
@@ -8529,18 +8578,11 @@ components:
8529
8578
  counts colocated entries only, so a package whose sources are all
8530
8579
  `storage=` reports 0 while being fully bound.
8531
8580
 
8532
- ⚠️ **`live_fallback` names two different things across two surfaces,
8533
- and correlating them on the token is wrong in both directions.** On
8534
- this field it means the store failed at run time. On
8535
- `publisher_storage_serve_routing_total{outcome}` it means the
8536
- transform was ineligible — this field's null case 3 — and that
8537
- metric spells the run-time failure `runtime_live_fallback`. So the
8538
- field's `live_fallback` is the metric's `runtime_live_fallback`, and
8539
- the metric's `live_fallback` is this field's `null`. A third surface,
8540
- `manifestBindingStatus`, uses the same token for a third thing: a
8541
- configured `manifestLocation` whose fetch or bind failed. Each
8542
- surface is internally consistent; none of them means what the others
8543
- do.
8581
+ ⚠️ **`live_fallback` here is not `manifestBindingStatus`'s.** On this
8582
+ field it means the store failed at run time; `manifestBindingStatus`
8583
+ uses the same token for a configured `manifestLocation` whose fetch
8584
+ or bind failed. Each surface is internally consistent; neither means
8585
+ what the other does.
8544
8586
  executionTimeMs:
8545
8587
  type: integer
8546
8588
  description: >-
@@ -8803,11 +8845,13 @@ components:
8803
8845
 
8804
8846
  QueryPathTableKind:
8805
8847
  type: string
8806
- enum: [view, rollup, materialized, live]
8848
+ enum: [view, query, rollup, materialized, live]
8807
8849
  description: >-
8808
- What kind of answer: `view`, a persisted view's table; `rollup`, a
8809
- pre-aggregation; `materialized`, a materialized source's table; `live`,
8810
- the source's own warehouse.
8850
+ What kind of answer: `view`, a persisted view's table; `query`, a
8851
+ persisted named query's table (`#@ persist` on a top-level `query:`);
8852
+ `rollup`, a pre-aggregation; `materialized`, a materialized source's
8853
+ table; `live`, the source's own warehouse. A client treats a kind it
8854
+ does not know as a materialized table it cannot name.
8811
8855
 
8812
8856
  SkipReason:
8813
8857
  type: string
@@ -10243,7 +10287,13 @@ components:
10243
10287
  properties:
10244
10288
  url:
10245
10289
  type: string
10246
- description: URL of the source file
10290
+ description: >-
10291
+ The source file, never where the server keeps it: a package
10292
+ file's path relative to the package root, decoded
10293
+ (`sub dir/orders.malloy`). At scope `append` the problem points
10294
+ into a temporary compile-check overlay beside the model,
10295
+ `__compile_check.malloy` (`model` names the model it extends).
10296
+ A file outside the package reads `<outside package>`.
10247
10297
  range:
10248
10298
  type: object
10249
10299
  description: Character range within the source file
@@ -10374,7 +10424,18 @@ components:
10374
10424
 
10375
10425
  MaterializationStatus:
10376
10426
  type: string
10377
- description: Phase-aware status of a materialization run.
10427
+ description: >-
10428
+ Phase-aware status of a materialization run. `MANIFEST_ROWS_READY`:
10429
+ the tables are built and the manifest is recorded. `MANIFEST_FILE_READY`:
10430
+ the run is done; an auto-run reaches it only after its manifest is
10431
+ loaded into the package it built, so a query sent after it is answered
10432
+ from the new tables (`metadata.autoLoad` is `loaded`). When that load
10433
+ does not take, the run still reaches `MANIFEST_FILE_READY`, since its
10434
+ tables were built, with `metadata.autoLoad` `failed`,
10435
+ `metadata.autoLoadStep` (`reload`, `bind` or `timeout`),
10436
+ `metadata.autoLoadError`, and `error` set; the package's next reload
10437
+ or restart binds the run's manifest. An orchestrated run never loads
10438
+ its manifest, so for it `MANIFEST_FILE_READY` means built.
10378
10439
  enum:
10379
10440
  - PENDING
10380
10441
  - MANIFEST_ROWS_READY
@@ -10398,7 +10459,12 @@ components:
10398
10459
  oneOf:
10399
10460
  - $ref: "#/components/schemas/BuildManifest"
10400
10461
  - type: "null"
10401
- description: Build output. Null until status = MANIFEST_FILE_READY.
10462
+ description: >-
10463
+ Build output. Null until the tables are built (status
10464
+ MANIFEST_ROWS_READY), and on a run that failed or was cancelled
10465
+ before then. A run interrupted at MANIFEST_ROWS_READY (the server
10466
+ stopped while it loaded its manifest) ends FAILED with its
10467
+ manifest; that manifest is never served.
10402
10468
  startedAt:
10403
10469
  type: ["string", "null"]
10404
10470
  format: date-time
@@ -10548,9 +10614,10 @@ components:
10548
10614
  copy of a model file without
10549
10615
  `##! experimental.persistence` did not compile, so none of its
10550
10616
  `#@ persist` sources were planned);
10551
- `persist_annotation_unparseable` (none of the source's `#@` lines
10552
- parse, so Malloy planned nothing for it; the package warning
10553
- names the line).
10617
+ `persist_annotation_unparseable` is retained and no longer
10618
+ produced: a `#@` line that does not parse is an invalid annotation
10619
+ (`persist-unparseable`), which fails the publish and the load, so
10620
+ no served plan carries it.
10554
10621
 
10555
10622
  OmittedFile:
10556
10623
  type: object
@@ -10628,6 +10695,7 @@ components:
10628
10695
  dynamic_projection,
10629
10696
  dynamic_join,
10630
10697
  dynamic_joined_where,
10698
+ inherited_where_with_given,
10631
10699
  partition_without_storage,
10632
10700
  partition_column_unknown,
10633
10701
  partition_column_not_public,
@@ -10637,33 +10705,59 @@ components:
10637
10705
  not_duckdb_portable,
10638
10706
  public_surface_unknown,
10639
10707
  read_only_dialect,
10708
+ storage_source_unsupported,
10640
10709
  env_reference,
10641
10710
  rollup_name_collision,
10711
+ empty_storage,
10712
+ table_name_collision,
10713
+ current_time,
10642
10714
  ]
10643
10715
  description: >-
10644
10716
  The bounded refusal reason. Only the compile-time reasons can
10645
10717
  appear here — `free_parameter`, `authorize`, the four
10646
10718
  that name where a given the build could not strip sits
10647
10719
  (`given_in_persisted_query`, `dynamic_projection`, `dynamic_join`,
10648
- `dynamic_joined_where`), the three that name an unusable
10649
- `partition=` (`partition_without_storage`,
10650
- `partition_column_unknown`, `partition_column_not_public`),
10720
+ `dynamic_joined_where`), `inherited_where_with_given` (a
10721
+ given-reading `where:` the source inherits from a source it is
10722
+ built from, in its own file or another, rather than writing it in
10723
+ its own declaration: only the source's own declaration is
10724
+ re-applied over the stored table at read, so it is not built and
10725
+ is answered live, under the term; move the `where:` onto the
10726
+ persisted source to serve it from a table),
10651
10727
  `merge_key_scope_unresolved` (a `merge_key=` whose caller scope
10652
10728
  cannot be expressed over the stored table's own columns),
10653
10729
  `preaggregate_over_dynamic_source` (a rollup whose base is scoped by
10654
10730
  a given, which has no read-time re-application to put the term back),
10655
10731
  `read_only_dialect` (a colocated `#@ persist` on a source whose
10656
10732
  dialect cannot create tables; SQL Server today, whose connection
10657
- reports `canPersist: false`), `env_reference` (a source with an
10658
- `@env.` reference on one of its `#@` lines, whose directives are all
10659
- ignored, so it serves live rather than build into the source
10660
- warehouse), and `rollup_name_collision` (a
10733
+ reports `canPersist: false`), `storage_source_unsupported`
10734
+ (`storage=` on a source whose connection the build cannot pass
10735
+ through to a destination, e.g. the package's DuckDB sandbox; it
10736
+ is not built and is answered live), `rollup_name_collision` (a
10661
10737
  pre-aggregation rollup whose generated name, and so its table, is
10662
10738
  also another model's rollup with different content; neither builds
10663
- or serves, and each model answers from its base) — those being the
10664
- only reasons the two
10739
+ or serves, and each model answers from its base), and
10740
+ `current_time` (a `#@ persist` whose build reads the current
10741
+ time, `now`: in its persisted query, a view it runs, the
10742
+ `where:`, a field or a join of the source that query reads, or
10743
+ the query of a query-shaped source it is built from or joins; its
10744
+ table would hold the rows as of the build, so it is not built and
10745
+ is answered live. `now` in the source's own extend block is
10746
+ applied at every read and is admitted) —
10747
+ those being the only reasons the two
10665
10748
  compile-time eligibility asserts this collection is computed from
10666
- produce.
10749
+ produce. One more appears only in a run's
10750
+ `metadata.refusedSources`, never in a build plan:
10751
+ `table_name_collision` (a source whose readable table name, the
10752
+ name a standalone run gives a table it names itself, is a name
10753
+ another source's table already takes in that run: two sources of
10754
+ one model that share a name, such as a `#@ persist` source named
10755
+ like a persisted view's generated build source beside it, or a
10756
+ hash collision; it is not built and is answered live), or a
10757
+ source whose `name=` puts it on one table with another source,
10758
+ under `PERSIST_COLLISION_ENFORCE=false` (by default such a
10759
+ package does not load); neither is built, so neither overwrites
10760
+ the other, and both are answered live).
10667
10761
 
10668
10762
 
10669
10763
  `given_in_persisted_query` is raised by BOTH gates, for one
@@ -10679,12 +10773,22 @@ components:
10679
10773
  longer produced. It was the storage tier's blanket refusal of any
10680
10774
  given reference, and the positional reasons above replaced it: where
10681
10775
  a given sits decides the outcome, so a single reason covering every
10682
- placement can no longer be raised. `not_duckdb_portable` is decided against the
10683
- post-build captured schema, which does not exist at compile time,
10684
- and `public_surface_unknown` is raised by the build-time narrowing
10685
- of a stored table to the source's public columns; both are listed
10686
- only because they share the enum the runtime eligibility metric
10687
- uses.
10776
+ placement can no longer be raised. `not_duckdb_portable` is
10777
+ likewise retained and no longer produced: a `storage=` table no
10778
+ column of which Malloy can type is now built, and its source is
10779
+ answered live. The three `partition_*` reasons
10780
+ (`partition_without_storage`, `partition_column_unknown`,
10781
+ `partition_column_not_public`) are likewise retained and no longer
10782
+ produced: `partition=` is a retired key, which fails the publish
10783
+ and the load as `persist-retired-key` or `materialize-retired-key`,
10784
+ never a plan refusal. `env_reference` and `empty_storage` are
10785
+ likewise retained and no longer produced: an `@env.` reference on a
10786
+ `#@` line, and a `storage=` that names no destination, are invalid
10787
+ annotations (`persist-invalid`), which fail the publish and the
10788
+ load, so no served plan carries them. `public_surface_unknown` is raised by the build-time
10789
+ narrowing of a stored table to the source's public columns; both
10790
+ are listed only because they share the enum the runtime
10791
+ eligibility metric uses.
10688
10792
  message:
10689
10793
  type: string
10690
10794
  description: >-
@@ -10732,8 +10836,8 @@ components:
10732
10836
  description: >-
10733
10837
  One `where:` conjunct a storage build leaves out of the artifact and the
10734
10838
  read puts back. Its `code` is the author's verbatim expression, which is
10735
- what a serve shape re-emits; `givens` are the names that expression reads,
10736
- which is what the shape must declare for it to compile.
10839
+ what the served copy re-emits; `givens` are the names that expression
10840
+ reads, which the served copy must declare for it to compile.
10737
10841
  properties:
10738
10842
  code:
10739
10843
  type: string
@@ -10837,26 +10941,15 @@ components:
10837
10941
  rewrites).
10838
10942
  partition:
10839
10943
  type: array
10944
+ deprecated: true
10840
10945
  items:
10841
10946
  type: string
10842
10947
  description: >-
10843
- The source's declared `#@ persist partition=` columns, resolved
10844
- against its public projection and reported in the author's order,
10845
- which is the order the stored table's directories nest in. Absent or
10846
- empty means the table is written unpartitioned, which is the default
10847
- and what every source built before this field existed means.
10848
-
10849
-
10850
- A layout, not an access control. Every term the build strips from a
10851
- source is re-applied when the artifact is read whether or not its
10852
- column is partitioned, so a list omitting the column a caller is
10853
- scoped by costs a full scan and never widens what that caller sees.
10854
- Consumers should not infer isolation from it.
10855
-
10856
-
10857
- `partition=` requires `storage=`; declared without one it is a
10858
- publish refusal rather than an ignored key, so this is empty for
10859
- every colocated source.
10948
+ Retired and no longer produced: always absent. It reported a
10949
+ source's `#@ persist partition=` columns; `partition=` is now a
10950
+ retired key, refused at publish, and every stored table is written
10951
+ unpartitioned. Kept so generated clients that read it still
10952
+ compile.
10860
10953
  strippedTerms:
10861
10954
  type: array
10862
10955
  items:
@@ -1 +1 @@
1
- import{_ as r,A as t,j as e,a7 as i,aa as o}from"./index-D3PvzI_V.js";function m(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{m as default};
1
+ import{W as r,A as t,j as e,a7 as i,aa as o}from"./index-DqJz_hGj.js";function m(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{m as default};
@@ -1 +1 @@
1
- import{_ as t,j as o,Z as a}from"./index-D3PvzI_V.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
1
+ import{W as t,j as o,J as a}from"./index-DqJz_hGj.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
@@ -1 +1 @@
1
- import{c as j,j as t,s as C,B as Ee,m as Q,e as ce,g as me,a as fe,r as x,u as ge,b as Me,d as W,f as ye,T as K,h as G,i as ze,k as Ie,l as Ce,o as be,n as De,p as Te,q as de,t as Be,v as Re,w as A,x as $,M as Le,P as He,y as $e,S as Ne,z as J,A as Z,C as Ae,D as Oe,E as We,F as pe,G as Ve,_ as ee,H as u,I as Fe,J as Y,K as V,L as te,N as _e,O as Ue,Q as ue,R as Xe,U as re,V as ne,W as oe,X as Ye,Y as qe,$ as Qe,a0 as Ke}from"./index-D3PvzI_V.js";import{u as Ge,l as he}from"./editPageMounted-BXWQAQvv.js";import{i as Je,w as Ze,a as et}from"./documentRoutes-Dn5OclPv.js";import{u as ve,p as tt}from"./usePackageRoute-CwvWFoYD.js";const rt=j(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),nt=C(Ee,{name:"MuiBreadcrumbCollapsed"})(Q(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:ce(e.palette.grey[200],.12)}:{backgroundColor:ce(e.palette.grey[600],.12)}}}))),ot=C(rt)({width:24,height:16});function st(e){const{slots:r={},slotProps:o={},...n}=e,s=e;return t.jsx("li",{children:t.jsx(nt,{focusRipple:!0,...n,ownerState:s,children:t.jsx(ot,{as:r.CollapsedIcon,ownerState:s,...o.collapsedIcon})})})}function at(e){return me("MuiBreadcrumbs",e)}const it=fe("MuiBreadcrumbs",["root","ol","li","separator"]),lt=e=>{const{classes:r}=e;return ye({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},at,r)},ct=C(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${it.li}`]:r.li},r.root]})({}),dt=C("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),pt=C("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ut(e,r,o,n){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(pt,{"aria-hidden":!0,className:r,ownerState:n,children:o},`separator-${i}`)):s.push(a),s),[])}const ht=x.forwardRef(function(r,o){const n=ge({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:d={},slotProps:m={},expandText:p="Show path",itemsAfterCollapse:h=1,itemsBeforeCollapse:b=1,maxItems:g=8,separator:w="/",...D}=n,[k,S]=x.useState(!1),v={...n,component:i,expanded:k,expandText:p,itemsAfterCollapse:h,itemsBeforeCollapse:b,maxItems:g,separator:w},z=lt(v),T=Me({elementType:d.CollapsedIcon,externalSlotProps:m.collapsedIcon,ownerState:v}),P=x.useRef(null),E=c=>{const M=()=>{S(!0);const y=P.current.querySelector("a[href],button,[tabindex]");y&&y.focus()};return b+h>=c.length?c:[...c.slice(0,b),t.jsx(st,{"aria-label":p,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:T},onClick:M},"ellipsis"),...c.slice(c.length-h,c.length)]},B=x.Children.toArray(s).filter(c=>x.isValidElement(c)).map((c,M)=>t.jsx("li",{className:z.li,children:c},`child-${M}`));return t.jsx(ct,{ref:o,component:i,color:"textSecondary",className:W(z.root,a),ownerState:v,...D,children:t.jsx(dt,{className:z.ol,ref:P,ownerState:v,children:ut(k||g&&B.length<=g?B:E(B),z.separator,w,v)})})});function xt(e,r,o){const n=r.getBoundingClientRect(),s=o&&o.getBoundingClientRect(),a=be(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const p=a.getComputedStyle(r);i=p.getPropertyValue("-webkit-transform")||p.getPropertyValue("transform")}let d=0,m=0;if(i&&i!=="none"&&typeof i=="string"){const p=i.split("(")[1].split(")")[0].split(",");d=parseInt(p[4],10),m=parseInt(p[5],10)}return e==="left"?s?`translateX(${s.right+d-n.left}px)`:`translateX(${a.innerWidth+d-n.left}px)`:e==="right"?s?`translateX(-${n.right-s.left-d}px)`:`translateX(-${n.left+n.width-d}px)`:e==="up"?s?`translateY(${s.bottom+m-n.top}px)`:`translateY(${a.innerHeight+m-n.top}px)`:s?`translateY(-${n.top-s.top+n.height-m}px)`:`translateY(-${n.top+n.height-m}px)`}function mt(e){return typeof e=="function"?e():e}function O(e,r,o){const n=mt(o),s=xt(e,r,n);s&&(r.style.webkitTransform=s,r.style.transform=s)}const ft=x.forwardRef(function(r,o){const n=G(),s={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:d=!0,children:m,container:p,direction:h="down",easing:b=s,in:g,onEnter:w,onEntered:D,onEntering:k,onExit:S,onExited:v,onExiting:z,style:T,timeout:P=a,TransitionComponent:E=ze,...B}=r,c=x.useRef(null),M=Ie(Ce(m),c,o),y=l=>f=>{l&&(f===void 0?l(c.current):l(c.current,f))},F=y((l,f)=>{O(h,l,p),Te(l),w&&w(l,f)}),ae=y((l,f)=>{const H=de({timeout:P,style:T,easing:b},{mode:"enter"});l.style.webkitTransition=n.transitions.create("-webkit-transform",{...H}),l.style.transition=n.transitions.create("transform",{...H}),l.style.webkitTransform="none",l.style.transform="none",k&&k(l,f)}),R=y(D),L=y(z),I=y(l=>{const f=de({timeout:P,style:T,easing:b},{mode:"exit"});l.style.webkitTransition=n.transitions.create("-webkit-transform",f),l.style.transition=n.transitions.create("transform",f),O(h,l,p),S&&S(l)}),_=y(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),U=l=>{i&&i(c.current,l)},N=x.useCallback(()=>{c.current&&O(h,c.current,p)},[h,p]);return x.useEffect(()=>{if(g||h==="down"||h==="right")return;const l=De(()=>{c.current&&O(h,c.current,p)}),f=be(c.current);return f.addEventListener("resize",l),()=>{l.clear(),f.removeEventListener("resize",l)}},[h,g,p]),x.useEffect(()=>{g||N()},[g,N]),t.jsx(E,{nodeRef:c,onEnter:F,onEntered:R,onEntering:ae,onExit:I,onExited:_,onExiting:L,addEndListener:U,appear:d,in:g,timeout:P,...B,children:(l,{ownerState:f,...H})=>x.cloneElement(m,{ref:M,style:{visibility:l==="exited"&&!g?"hidden":void 0,...T,...m.props.style},...H})})});function gt(e){return me("MuiDrawer",e)}fe("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const je=(e,r)=>{const{ownerState:o}=e;return[r.root,(o.variant==="permanent"||o.variant==="persistent")&&r.docked,r.modal]},yt=e=>{const{classes:r,anchor:o,variant:n}=e,s={root:["root",`anchor${$(o)}`],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${$(o)}`,n!=="temporary"&&`paperAnchorDocked${$(o)}`]};return ye(s,gt,r)},bt=C(Le,{name:"MuiDrawer",slot:"Root",overridesResolver:je})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),vt=C("div",{shouldForwardProp:$e,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:je})({flex:"0 0 auto"}),jt=C(He,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.paper,r[`paperAnchor${$(o.anchor)}`],o.variant!=="temporary"&&r[`paperAnchorDocked${$(o.anchor)}`]]}})(Q(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),ke={left:"right",right:"left",top:"down",bottom:"up"};function kt(e){return["left","right"].includes(e)}function wt({direction:e},r){return e==="rtl"&&kt(r)?ke[r]:r}const St=x.forwardRef(function(r,o){const n=ge({props:r,name:"MuiDrawer"}),s=G(),a=Be(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:m,children:p,className:h,elevation:b=16,hideBackdrop:g=!1,ModalProps:{BackdropProps:w,...D}={},onClose:k,open:S=!1,PaperProps:v={},SlideProps:z,TransitionComponent:T,transitionDuration:P=i,variant:E="temporary",slots:B={},slotProps:c={},...M}=n,y=x.useRef(!1);x.useEffect(()=>{y.current=!0},[]);const F=wt({direction:a?"rtl":"ltr"},d),R={...n,anchor:d,elevation:b,open:S,variant:E,...M},L=yt(R),I={slots:{transition:T,...B},slotProps:{paper:v,transition:z,...c,backdrop:Re(c.backdrop||{...m,...w},{transitionDuration:P})}},[_,U]=A("root",{ref:o,elementType:bt,className:W(L.root,L.modal,h),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...I,...M,...D},additionalProps:{open:S,onClose:k,hideBackdrop:g,slots:{backdrop:I.slots.backdrop},slotProps:{backdrop:I.slotProps.backdrop}}}),[N,l]=A("paper",{elementType:jt,shouldForwardComponentProp:!0,className:W(L.paper,v.className),ownerState:R,externalForwardedProps:I,additionalProps:{elevation:E==="temporary"?b:0,square:!0,...E==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[f,H]=A("docked",{elementType:vt,ref:o,className:W(L.root,L.docked,h),ownerState:R,externalForwardedProps:I,additionalProps:M}),[Se,Pe]=A("transition",{elementType:ft,ownerState:R,externalForwardedProps:I,additionalProps:{in:S,direction:ke[F],timeout:P,appear:y.current}}),ie=t.jsx(N,{...l,children:p});if(E==="permanent")return t.jsx(f,{...H,children:ie});const le=t.jsx(Se,{...Pe,children:ie});return E==="persistent"?t.jsx(f,{...H,children:le}):t.jsx(_,{...U,children:le})}),Pt=j([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Et=j(t.jsx("path",{d:"M10.85 12.65h2.3L12 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9z"})),Mt=j(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),zt=j(t.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"})),It=j(t.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),Ct=j(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),Dt=j(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Tt=j(t.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"})),Bt=j(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Rt=j([t.jsx("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),t.jsx("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),t.jsx("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),t.jsx("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),t.jsx("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")]);function q(e){return t.jsxs(Ne,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}const Lt=/\.malloy(nb)?$/;function Ht(){const{pathname:e,search:r}=J(),o=Z(),n=Ae(),s=Oe(),a=Ge(),i=o.environmentName??"",d=o.packageName??"",m=ve({always:!0}),p=m.path??"",h=i!==""&&d!==""&&p!==""&&m.writable&&!Lt.test(p),{reports:b,settled:g}=We(i,d,void 0,h);if(!h||s)return null;const w=p.replace(/\/$/,""),D=Je(r),k=e.replace(/\/$/,"");return D?a?null:t.jsx(pe,{label:"View",onClick:()=>n(`${k}${Ze(r)}`)}):(g?Ve(`${w}.malloy`,b):void 0)?.editable?t.jsx("span",{onPointerEnter:()=>void he(),onFocus:()=>void he(),children:t.jsx(pe,{label:"Edit",icon:t.jsx(It,{}),onClick:()=>n(`${k}${et(r)}`)})}):null}function X({label:e,onClick:r,current:o=!1}){return t.jsx(Fe,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,"aria-current":o?"page":void 0,sx:n=>({backgroundColor:"transparent",border:"none",color:o?"text.primary":"text.secondary",fontWeight:o?500:400,fontSize:13,height:28,cursor:"pointer",borderRadius:"6px",maxWidth:320,"& .MuiChip-label":{px:.75,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:n.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}})})}function $t(){const e=Z(),r=ve(),o=e.environmentName&&e.packageName?tt(e.environmentName,e.packageName,r.versionSegment):"",n=r.path?r.path.replace(/\/$/,""):void 0,s=ee();return!e.environmentName&&!e.packageName&&!n?null:t.jsx(u,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(ht,{"aria-label":"breadcrumb",separator:t.jsx(u,{component:"span","aria-hidden":!0,sx:{color:"text.disabled"},children:"/"}),children:[e.environmentName&&t.jsx(X,{label:e.environmentName,current:!e.packageName&&!n,onClick:a=>s(`/${e.environmentName}/`,a)}),e.packageName&&t.jsx(X,{label:e.packageName,current:!n,onClick:a=>s(`${o}/`,a)}),n&&t.jsx(X,{label:n,current:!0,onClick:a=>s(`${o}/${n}`,a)})]})})}const Nt=260,At=64;function we({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){return t.jsxs(u,{sx:{height:"100dvh",width:e?At:Nt,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Ot,{isCollapsed:e,onToggleCollapse:r,logoHeader:o}),t.jsxs(u,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Wt,{isCollapsed:e}),t.jsx(Vt,{isCollapsed:e})]}),t.jsx(Ft,{isCollapsed:e})]})}function Ot({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){const n=ee();return o?t.jsxs(u,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[o,t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})]}):t.jsxs(u,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(u,{onClick:s=>n("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(u,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(K,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(V,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})})]})}function Wt({isCollapsed:e}){const o=J().pathname==="/";return t.jsx(te,{sx:{py:0},children:t.jsx(se,{icon:t.jsx(Dt,{fontSize:"small"}),label:"Home",to:"/",selected:o,isCollapsed:e})})}function Vt({isCollapsed:e}){const{apiClients:r}=_e(),o=Z(),{data:n}=Ue({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=n?.data??[];return s.length===0?null:t.jsxs(u,{sx:{mt:1},children:[!e&&t.jsx(K,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(te,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(se,{icon:t.jsx(Ct,{fontSize:"small"}),label:i,to:`/${i}`,selected:o.environmentName===i,isCollapsed:e},i)})})]})}function Ft({isCollapsed:e}){const{pathname:r}=J(),o=[{label:"Malloy Docs",href:ue.docsHome,icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:ue.publishing,icon:t.jsx(Bt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(Mt,{fontSize:"small"}),external:!1}];return t.jsxs(te,{sx:{py:1},children:[t.jsx(se,{icon:t.jsx(Rt,{fontSize:"small"}),label:"Theme",to:"/settings/theme",selected:r.startsWith("/settings/theme"),isCollapsed:e}),t.jsx(Yt,{isCollapsed:e}),o.map(n=>t.jsx(_t,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))]})}function se({icon:e,label:r,to:o,selected:n,isCollapsed:s}){const a=ee(),i=t.jsxs(re,{selected:n,onClick:d=>a(o,d),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:n?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(oe,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:r,placement:"right",children:t.jsx(u,{children:i})}):i}function _t({label:e,href:r,icon:o,external:n,isCollapsed:s}){const a=t.jsxs(re,{component:"a",href:r,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:o}),!s&&t.jsx(oe,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:e,placement:"right",children:t.jsx(u,{children:a})}):a}const Ut={light:"dark",dark:"auto",auto:"light"},Xt={light:"Light mode",dark:"Dark mode",auto:"Auto mode"},xe={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function Yt({isCollapsed:e}){const{mode:r,userChoice:o,setMode:n,allowUserToggle:s}=Xe();if(!s)return null;const a=o??r,i=a==="auto"?Et:a==="dark"?zt:Tt,d=t.jsxs(re,{"aria-label":xe[a],onClick:()=>n(Ut[a]),sx:{justifyContent:e?"center":"flex-start",px:e?0:2},children:[t.jsx(ne,{sx:{minWidth:e?0:36,justifyContent:"center",color:"text.secondary"},children:t.jsx(i,{fontSize:"small"})}),!e&&t.jsx(oe,{primary:Xt[a],primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",whiteSpace:"nowrap"}}})]});return t.jsx(V,{title:xe[a],placement:"right",disableHoverListener:!e,children:t.jsx(u,{children:d})})}function qt({open:e,onClose:r,logoHeader:o}){return t.jsx(St,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(we,{isCollapsed:!1,onToggleCollapse:r,logoHeader:o})})}function Zt({headerProps:e}){const r=G(),o=Ye(r.breakpoints.up("md")),[n,s]=x.useState(!1),[a,i]=x.useState(!1);return x.useEffect(()=>{o&&n&&s(!1)},[o,n]),t.jsxs(u,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[o&&t.jsx(we,{isCollapsed:a,onToggleCollapse:()=>i(d=>!d),logoHeader:e?.logoHeader}),t.jsxs(u,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(u,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:qe.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(u,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(Y,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(q,{fontSize:"small"})})}),t.jsx(u,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx($t,{})}),t.jsxs(u,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx(Ht,{}),e?.endCap]})]}),t.jsx(u,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(x.Suspense,{fallback:t.jsx(Ke,{}),children:t.jsx(Qe,{})})})]}),t.jsx(qt,{open:n,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Zt as default};
1
+ import{c as j,j as t,s as C,B as Ee,m as Q,e as ce,g as me,a as fe,r as x,u as ge,b as Me,d as W,f as ye,T as K,h as G,i as ze,k as Ie,l as Ce,o as be,n as De,p as Te,q as de,t as Be,v as Re,w as A,x as $,M as Le,P as He,y as $e,S as Ne,z as Z,A as J,C as Ae,X as Oe,E as We,D as pe,F as Ve,W as ee,G as u,H as Fe,I as Y,K as V,L as te,N as _e,O as Ue,Q as ue,_ as Xe,R as re,U as ne,V as oe,Y as Ye,Z as qe,$ as Qe,a0 as Ke}from"./index-DqJz_hGj.js";import{u as Ge,l as he}from"./editPageMounted-B5IyuuMZ.js";import{i as Ze,w as Je,a as et}from"./documentRoutes-CIhmKz4i.js";import{u as ve,p as tt}from"./usePackageRoute-CTkLtO3i.js";const rt=j(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),nt=C(Ee,{name:"MuiBreadcrumbCollapsed"})(Q(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:ce(e.palette.grey[200],.12)}:{backgroundColor:ce(e.palette.grey[600],.12)}}}))),ot=C(rt)({width:24,height:16});function st(e){const{slots:r={},slotProps:o={},...n}=e,s=e;return t.jsx("li",{children:t.jsx(nt,{focusRipple:!0,...n,ownerState:s,children:t.jsx(ot,{as:r.CollapsedIcon,ownerState:s,...o.collapsedIcon})})})}function at(e){return me("MuiBreadcrumbs",e)}const it=fe("MuiBreadcrumbs",["root","ol","li","separator"]),lt=e=>{const{classes:r}=e;return ye({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},at,r)},ct=C(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${it.li}`]:r.li},r.root]})({}),dt=C("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),pt=C("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ut(e,r,o,n){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(pt,{"aria-hidden":!0,className:r,ownerState:n,children:o},`separator-${i}`)):s.push(a),s),[])}const ht=x.forwardRef(function(r,o){const n=ge({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:d={},slotProps:m={},expandText:p="Show path",itemsAfterCollapse:h=1,itemsBeforeCollapse:b=1,maxItems:g=8,separator:w="/",...D}=n,[k,S]=x.useState(!1),v={...n,component:i,expanded:k,expandText:p,itemsAfterCollapse:h,itemsBeforeCollapse:b,maxItems:g,separator:w},z=lt(v),T=Me({elementType:d.CollapsedIcon,externalSlotProps:m.collapsedIcon,ownerState:v}),P=x.useRef(null),E=c=>{const M=()=>{S(!0);const y=P.current.querySelector("a[href],button,[tabindex]");y&&y.focus()};return b+h>=c.length?c:[...c.slice(0,b),t.jsx(st,{"aria-label":p,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:T},onClick:M},"ellipsis"),...c.slice(c.length-h,c.length)]},B=x.Children.toArray(s).filter(c=>x.isValidElement(c)).map((c,M)=>t.jsx("li",{className:z.li,children:c},`child-${M}`));return t.jsx(ct,{ref:o,component:i,color:"textSecondary",className:W(z.root,a),ownerState:v,...D,children:t.jsx(dt,{className:z.ol,ref:P,ownerState:v,children:ut(k||g&&B.length<=g?B:E(B),z.separator,w,v)})})});function xt(e,r,o){const n=r.getBoundingClientRect(),s=o&&o.getBoundingClientRect(),a=be(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const p=a.getComputedStyle(r);i=p.getPropertyValue("-webkit-transform")||p.getPropertyValue("transform")}let d=0,m=0;if(i&&i!=="none"&&typeof i=="string"){const p=i.split("(")[1].split(")")[0].split(",");d=parseInt(p[4],10),m=parseInt(p[5],10)}return e==="left"?s?`translateX(${s.right+d-n.left}px)`:`translateX(${a.innerWidth+d-n.left}px)`:e==="right"?s?`translateX(-${n.right-s.left-d}px)`:`translateX(-${n.left+n.width-d}px)`:e==="up"?s?`translateY(${s.bottom+m-n.top}px)`:`translateY(${a.innerHeight+m-n.top}px)`:s?`translateY(-${n.top-s.top+n.height-m}px)`:`translateY(-${n.top+n.height-m}px)`}function mt(e){return typeof e=="function"?e():e}function O(e,r,o){const n=mt(o),s=xt(e,r,n);s&&(r.style.webkitTransform=s,r.style.transform=s)}const ft=x.forwardRef(function(r,o){const n=G(),s={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:d=!0,children:m,container:p,direction:h="down",easing:b=s,in:g,onEnter:w,onEntered:D,onEntering:k,onExit:S,onExited:v,onExiting:z,style:T,timeout:P=a,TransitionComponent:E=ze,...B}=r,c=x.useRef(null),M=Ie(Ce(m),c,o),y=l=>f=>{l&&(f===void 0?l(c.current):l(c.current,f))},F=y((l,f)=>{O(h,l,p),Te(l),w&&w(l,f)}),ae=y((l,f)=>{const H=de({timeout:P,style:T,easing:b},{mode:"enter"});l.style.webkitTransition=n.transitions.create("-webkit-transform",{...H}),l.style.transition=n.transitions.create("transform",{...H}),l.style.webkitTransform="none",l.style.transform="none",k&&k(l,f)}),R=y(D),L=y(z),I=y(l=>{const f=de({timeout:P,style:T,easing:b},{mode:"exit"});l.style.webkitTransition=n.transitions.create("-webkit-transform",f),l.style.transition=n.transitions.create("transform",f),O(h,l,p),S&&S(l)}),_=y(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),U=l=>{i&&i(c.current,l)},N=x.useCallback(()=>{c.current&&O(h,c.current,p)},[h,p]);return x.useEffect(()=>{if(g||h==="down"||h==="right")return;const l=De(()=>{c.current&&O(h,c.current,p)}),f=be(c.current);return f.addEventListener("resize",l),()=>{l.clear(),f.removeEventListener("resize",l)}},[h,g,p]),x.useEffect(()=>{g||N()},[g,N]),t.jsx(E,{nodeRef:c,onEnter:F,onEntered:R,onEntering:ae,onExit:I,onExited:_,onExiting:L,addEndListener:U,appear:d,in:g,timeout:P,...B,children:(l,{ownerState:f,...H})=>x.cloneElement(m,{ref:M,style:{visibility:l==="exited"&&!g?"hidden":void 0,...T,...m.props.style},...H})})});function gt(e){return me("MuiDrawer",e)}fe("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const je=(e,r)=>{const{ownerState:o}=e;return[r.root,(o.variant==="permanent"||o.variant==="persistent")&&r.docked,r.modal]},yt=e=>{const{classes:r,anchor:o,variant:n}=e,s={root:["root",`anchor${$(o)}`],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${$(o)}`,n!=="temporary"&&`paperAnchorDocked${$(o)}`]};return ye(s,gt,r)},bt=C(Le,{name:"MuiDrawer",slot:"Root",overridesResolver:je})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),vt=C("div",{shouldForwardProp:$e,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:je})({flex:"0 0 auto"}),jt=C(He,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.paper,r[`paperAnchor${$(o.anchor)}`],o.variant!=="temporary"&&r[`paperAnchorDocked${$(o.anchor)}`]]}})(Q(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),ke={left:"right",right:"left",top:"down",bottom:"up"};function kt(e){return["left","right"].includes(e)}function wt({direction:e},r){return e==="rtl"&&kt(r)?ke[r]:r}const St=x.forwardRef(function(r,o){const n=ge({props:r,name:"MuiDrawer"}),s=G(),a=Be(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:m,children:p,className:h,elevation:b=16,hideBackdrop:g=!1,ModalProps:{BackdropProps:w,...D}={},onClose:k,open:S=!1,PaperProps:v={},SlideProps:z,TransitionComponent:T,transitionDuration:P=i,variant:E="temporary",slots:B={},slotProps:c={},...M}=n,y=x.useRef(!1);x.useEffect(()=>{y.current=!0},[]);const F=wt({direction:a?"rtl":"ltr"},d),R={...n,anchor:d,elevation:b,open:S,variant:E,...M},L=yt(R),I={slots:{transition:T,...B},slotProps:{paper:v,transition:z,...c,backdrop:Re(c.backdrop||{...m,...w},{transitionDuration:P})}},[_,U]=A("root",{ref:o,elementType:bt,className:W(L.root,L.modal,h),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...I,...M,...D},additionalProps:{open:S,onClose:k,hideBackdrop:g,slots:{backdrop:I.slots.backdrop},slotProps:{backdrop:I.slotProps.backdrop}}}),[N,l]=A("paper",{elementType:jt,shouldForwardComponentProp:!0,className:W(L.paper,v.className),ownerState:R,externalForwardedProps:I,additionalProps:{elevation:E==="temporary"?b:0,square:!0,...E==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[f,H]=A("docked",{elementType:vt,ref:o,className:W(L.root,L.docked,h),ownerState:R,externalForwardedProps:I,additionalProps:M}),[Se,Pe]=A("transition",{elementType:ft,ownerState:R,externalForwardedProps:I,additionalProps:{in:S,direction:ke[F],timeout:P,appear:y.current}}),ie=t.jsx(N,{...l,children:p});if(E==="permanent")return t.jsx(f,{...H,children:ie});const le=t.jsx(Se,{...Pe,children:ie});return E==="persistent"?t.jsx(f,{...H,children:le}):t.jsx(_,{...U,children:le})}),Pt=j([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Et=j(t.jsx("path",{d:"M10.85 12.65h2.3L12 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9z"})),Mt=j(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),zt=j(t.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"})),It=j(t.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),Ct=j(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),Dt=j(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Tt=j(t.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"})),Bt=j(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Rt=j([t.jsx("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),t.jsx("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),t.jsx("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),t.jsx("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),t.jsx("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")]);function q(e){return t.jsxs(Ne,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}const Lt=/\.malloy(nb)?$/;function Ht(){const{pathname:e,search:r}=Z(),o=J(),n=Ae(),s=Oe(),a=Ge(),i=o.environmentName??"",d=o.packageName??"",m=ve({always:!0}),p=m.path??"",h=i!==""&&d!==""&&p!==""&&m.writable&&!Lt.test(p),{reports:b,settled:g}=We(i,d,void 0,h);if(!h||s)return null;const w=p.replace(/\/$/,""),D=Ze(r),k=e.replace(/\/$/,"");return D?a?null:t.jsx(pe,{label:"View",onClick:()=>n(`${k}${Je(r)}`)}):(g?Ve(`${w}.malloy`,b):void 0)?.editable?t.jsx("span",{onPointerEnter:()=>void he(),onFocus:()=>void he(),children:t.jsx(pe,{label:"Edit",icon:t.jsx(It,{}),onClick:()=>n(`${k}${et(r)}`)})}):null}function X({label:e,onClick:r,current:o=!1}){return t.jsx(Fe,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,"aria-current":o?"page":void 0,sx:n=>({backgroundColor:"transparent",border:"none",color:o?"text.primary":"text.secondary",fontWeight:o?500:400,fontSize:13,height:28,cursor:"pointer",borderRadius:"6px",maxWidth:320,"& .MuiChip-label":{px:.75,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:n.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}})})}function $t(){const e=J(),r=ve(),o=e.environmentName&&e.packageName?tt(e.environmentName,e.packageName,r.versionSegment):"",n=r.path?r.path.replace(/\/$/,""):void 0,s=ee();return!e.environmentName&&!e.packageName&&!n?null:t.jsx(u,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(ht,{"aria-label":"breadcrumb",separator:t.jsx(u,{component:"span","aria-hidden":!0,sx:{color:"text.disabled"},children:"/"}),children:[e.environmentName&&t.jsx(X,{label:e.environmentName,current:!e.packageName&&!n,onClick:a=>s(`/${e.environmentName}/`,a)}),e.packageName&&t.jsx(X,{label:e.packageName,current:!n,onClick:a=>s(`${o}/`,a)}),n&&t.jsx(X,{label:n,current:!0,onClick:a=>s(`${o}/${n}`,a)})]})})}const Nt=260,At=64;function we({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){return t.jsxs(u,{sx:{height:"100dvh",width:e?At:Nt,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Ot,{isCollapsed:e,onToggleCollapse:r,logoHeader:o}),t.jsxs(u,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Wt,{isCollapsed:e}),t.jsx(Vt,{isCollapsed:e})]}),t.jsx(Ft,{isCollapsed:e})]})}function Ot({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){const n=ee();return o?t.jsxs(u,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[o,t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})]}):t.jsxs(u,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(u,{onClick:s=>n("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(u,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(K,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(V,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})})]})}function Wt({isCollapsed:e}){const o=Z().pathname==="/";return t.jsx(te,{sx:{py:0},children:t.jsx(se,{icon:t.jsx(Dt,{fontSize:"small"}),label:"Home",to:"/",selected:o,isCollapsed:e})})}function Vt({isCollapsed:e}){const{apiClients:r}=_e(),o=J(),{data:n}=Ue({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=n?.data??[];return s.length===0?null:t.jsxs(u,{sx:{mt:1},children:[!e&&t.jsx(K,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(te,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(se,{icon:t.jsx(Ct,{fontSize:"small"}),label:i,to:`/${i}`,selected:o.environmentName===i,isCollapsed:e},i)})})]})}function Ft({isCollapsed:e}){const{pathname:r}=Z(),o=[{label:"Malloy Docs",href:ue.docsHome,icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:ue.publishing,icon:t.jsx(Bt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(Mt,{fontSize:"small"}),external:!1}];return t.jsxs(te,{sx:{py:1},children:[t.jsx(se,{icon:t.jsx(Rt,{fontSize:"small"}),label:"Theme",to:"/settings/theme",selected:r.startsWith("/settings/theme"),isCollapsed:e}),t.jsx(Yt,{isCollapsed:e}),o.map(n=>t.jsx(_t,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))]})}function se({icon:e,label:r,to:o,selected:n,isCollapsed:s}){const a=ee(),i=t.jsxs(re,{selected:n,onClick:d=>a(o,d),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:n?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(oe,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:r,placement:"right",children:t.jsx(u,{children:i})}):i}function _t({label:e,href:r,icon:o,external:n,isCollapsed:s}){const a=t.jsxs(re,{component:"a",href:r,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:o}),!s&&t.jsx(oe,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:e,placement:"right",children:t.jsx(u,{children:a})}):a}const Ut={light:"dark",dark:"auto",auto:"light"},Xt={light:"Light mode",dark:"Dark mode",auto:"Auto mode"},xe={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function Yt({isCollapsed:e}){const{mode:r,userChoice:o,setMode:n,allowUserToggle:s}=Xe();if(!s)return null;const a=o??r,i=a==="auto"?Et:a==="dark"?zt:Tt,d=t.jsxs(re,{"aria-label":xe[a],onClick:()=>n(Ut[a]),sx:{justifyContent:e?"center":"flex-start",px:e?0:2},children:[t.jsx(ne,{sx:{minWidth:e?0:36,justifyContent:"center",color:"text.secondary"},children:t.jsx(i,{fontSize:"small"})}),!e&&t.jsx(oe,{primary:Xt[a],primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",whiteSpace:"nowrap"}}})]});return t.jsx(V,{title:xe[a],placement:"right",disableHoverListener:!e,children:t.jsx(u,{children:d})})}function qt({open:e,onClose:r,logoHeader:o}){return t.jsx(St,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(we,{isCollapsed:!1,onToggleCollapse:r,logoHeader:o})})}function Jt({headerProps:e}){const r=G(),o=Ye(r.breakpoints.up("md")),[n,s]=x.useState(!1),[a,i]=x.useState(!1);return x.useEffect(()=>{o&&n&&s(!1)},[o,n]),t.jsxs(u,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[o&&t.jsx(we,{isCollapsed:a,onToggleCollapse:()=>i(d=>!d),logoHeader:e?.logoHeader}),t.jsxs(u,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(u,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:qe.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(u,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(Y,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(q,{fontSize:"small"})})}),t.jsx(u,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx($t,{})}),t.jsxs(u,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx(Ht,{}),e?.endCap]})]}),t.jsx(u,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(x.Suspense,{fallback:t.jsx(Ke,{}),children:t.jsx(Qe,{})})})]}),t.jsx(qt,{open:n,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Jt as default};