unleash-server 7.0.5 → 7.0.6

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 (41) hide show
  1. package/dist/lib/features/metrics/instance/metrics.js +1 -1
  2. package/dist/lib/features/metrics/instance/metrics.js.map +1 -1
  3. package/dist/lib/openapi/util/openapi-tags.d.ts +6 -6
  4. package/dist/lib/openapi/util/openapi-tags.d.ts.map +1 -1
  5. package/dist/lib/openapi/util/openapi-tags.js +4 -1
  6. package/dist/lib/openapi/util/openapi-tags.js.map +1 -1
  7. package/dist/lib/routes/edge-api/index.js +1 -1
  8. package/dist/lib/routes/edge-api/index.js.map +1 -1
  9. package/dist/lib/types/experimental.d.ts +1 -1
  10. package/dist/lib/types/experimental.d.ts.map +1 -1
  11. package/dist/lib/types/experimental.js +1 -0
  12. package/dist/lib/types/experimental.js.map +1 -1
  13. package/frontend/build/index.html +1 -1
  14. package/frontend/build/static/{AdvancedPlayground-CtNsC82U.js → AdvancedPlayground-DizgjpWb.js} +1 -1
  15. package/frontend/build/static/{BackendConnections-BKBAcZux.js → BackendConnections-Bc1IXLRP.js} +1 -1
  16. package/frontend/build/static/{CreateProject-Cl_-OElZ.js → CreateProject-moy7uMGX.js} +1 -1
  17. package/frontend/build/static/{FeatureMetricsChart-Ri2zR-Li.js → FeatureMetricsChart-CXpaGFz-.js} +1 -1
  18. package/frontend/build/static/{FeatureStaleDialog-B4kuZsir.js → FeatureStaleDialog-DOiJpKNC.js} +1 -1
  19. package/frontend/build/static/{FeatureViewLazyExport-DaVKFqvO.js → FeatureViewLazyExport-3Y6uMkoC.js} +2 -2
  20. package/frontend/build/static/{FlagMetricsChart-BXks2oqd.js → FlagMetricsChart-wgHxfp3k.js} +1 -1
  21. package/frontend/build/static/{FrontendNetworkTrafficUsage-1ohy9ak2.js → FrontendNetworkTrafficUsage-BB_PtRBn.js} +1 -1
  22. package/frontend/build/static/{ImpactMetricsPage-DKuhpY7C.js → ImpactMetricsPage-PWbLS_eq.js} +1 -1
  23. package/frontend/build/static/{LazyAdminExport-WZgqtZjz.js → LazyAdminExport-B8NZvb6Q.js} +2 -2
  24. package/frontend/build/static/{LazyProjectExport-DtOq56MO.js → LazyProjectExport-BkuOERly.js} +35 -35
  25. package/frontend/build/static/{LifecycleChartComponent-qmefPX9z.js → LifecycleChartComponent-B5-DntLG.js} +1 -1
  26. package/frontend/build/static/{LineChartComponent-GoTWBfeH.js → LineChartComponent-DZqTXcwQ.js} +1 -1
  27. package/frontend/build/static/{MarkCompletedDialogue-B5yr7GS5.js → MarkCompletedDialogue-BxpNwvZk.js} +1 -1
  28. package/frontend/build/static/{NetworkConnectedEdges-_SHY-DHB.js → NetworkConnectedEdges-B9eD1vcM.js} +1 -1
  29. package/frontend/build/static/{NetworkOverview-D8XoJi9Q.js → NetworkOverview-D8AnghGS.js} +1 -1
  30. package/frontend/build/static/{NetworkPrometheusAPIWarning-CP7Vp9yu.js → NetworkPrometheusAPIWarning-BsxwMt7D.js} +1 -1
  31. package/frontend/build/static/{NetworkTraffic-B_j1ffJL.js → NetworkTraffic-DMs5zzJP.js} +1 -1
  32. package/frontend/build/static/{NetworkTrafficUsage-5fI-LA0Z.js → NetworkTrafficUsage-CBqsbLjy.js} +1 -1
  33. package/frontend/build/static/{ReactJSONEditor-BzPk9Jo7.js → ReactJSONEditor-DUlEHqcf.js} +1 -1
  34. package/frontend/build/static/{RoleCell-ycKPyNvK.js → RoleCell-C2bUEPUX.js} +1 -1
  35. package/frontend/build/static/{aggregateFeatureMetrics-D6Ts8R60.js → aggregateFeatureMetrics-B9YGjDrl.js} +1 -1
  36. package/frontend/build/static/{formatTickValue-CnEuS4gg.js → formatTickValue-UVMjaxYs.js} +1 -1
  37. package/frontend/build/static/{index-7Xiv8xBJ.js → index-CBxzHo9v.js} +115 -115
  38. package/frontend/build/static/{useApiTokens-D7Sffu1E.js → useApiTokens-CUb6SDEP.js} +1 -1
  39. package/frontend/build/static/{useChartDataSelection-CJ_ODQpO.js → useChartDataSelection-oJZtWCYi.js} +1 -1
  40. package/package.json +1 -1
  41. package/frontend/build/static/google-BGDiGwsi.svg +0 -100
@@ -49,7 +49,7 @@ export default class ClientMetricsController extends Controller {
49
49
  permission: NONE,
50
50
  middleware: [
51
51
  this.openApiService.validPath({
52
- tags: ['Edge'],
52
+ tags: ['Unleash Edge'],
53
53
  summary: 'Send metrics in bulk',
54
54
  description: `This operation accepts batched metrics from any client. Metrics will be inserted into Unleash's metrics storage`,
55
55
  operationId: 'clientBulkMetrics',
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../../../src/lib/features/metrics/instance/metrics.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,+BAA+B,CAAC;AAMvD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAKrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EACH,aAAa,EACb,oBAAoB,GACvB,MAAM,6CAA6C,CAAC;AACrD,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EACH,0BAA0B,EAC1B,mBAAmB,GACtB,MAAM,qBAAqB,CAAC;AAW7B,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU;IAe3D,YACI,EACI,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,oBAAoB,GAOvB,EACD,MAAsB;QAEtB,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAE7B,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAC/C,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;QACnD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,sBAAsB,CAAC;QACxC,IAAI,CA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AO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBAE5B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YAC1B,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACT,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YAC1B,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
@@ -28,9 +28,6 @@ declare const OPENAPI_TAGS: readonly [{
28
28
  }, {
29
29
  readonly name: "Dependencies";
30
30
  readonly description: "Manage feature dependencies.";
31
- }, {
32
- readonly name: "Edge";
33
- readonly description: "Endpoints related to Unleash on the Edge.";
34
31
  }, {
35
32
  readonly name: "Environments";
36
33
  readonly description: "Create, update, delete, enable or disable [environments](https://docs.getunleash.io/reference/environments) for this Unleash instance.";
@@ -94,6 +91,9 @@ declare const OPENAPI_TAGS: readonly [{
94
91
  }, {
95
92
  readonly name: "Telemetry";
96
93
  readonly description: "API for information about telemetry collection";
94
+ }, {
95
+ readonly name: "Unleash Edge";
96
+ readonly description: "Endpoints related to [Unleash Edge](https://docs.getunleash.io/reference/api/unleash/edge).";
97
97
  }, {
98
98
  readonly name: "Unstable";
99
99
  readonly description: "Experimental endpoints that may change or disappear at any time.";
@@ -131,9 +131,6 @@ export declare const openApiTags: ({
131
131
  } | {
132
132
  readonly name: "Dependencies";
133
133
  readonly description: "Manage feature dependencies.";
134
- } | {
135
- readonly name: "Edge";
136
- readonly description: "Endpoints related to Unleash on the Edge.";
137
134
  } | {
138
135
  readonly name: "Environments";
139
136
  readonly description: "Create, update, delete, enable or disable [environments](https://docs.getunleash.io/reference/environments) for this Unleash instance.";
@@ -197,6 +194,9 @@ export declare const openApiTags: ({
197
194
  } | {
198
195
  readonly name: "Telemetry";
199
196
  readonly description: "API for information about telemetry collection";
197
+ } | {
198
+ readonly name: "Unleash Edge";
199
+ readonly description: "Endpoints related to [Unleash Edge](https://docs.getunleash.io/reference/api/unleash/edge).";
200
200
  } | {
201
201
  readonly name: "Unstable";
202
202
  readonly description: "Experimental endpoints that may change or disappear at any time.";
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-tags.d.ts","sourceRoot":"","sources":["../../../../src/lib/openapi/util/openapi-tags.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkJR,CAAC;AAGX,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAoB,CAAC;AAE7C,MAAM,MAAM,UAAU,GAElB,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"openapi-tags.d.ts","sourceRoot":"","sources":["../../../../src/lib/openapi/util/openapi-tags.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsJR,CAAC;AAGX,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAoB,CAAC;AAE7C,MAAM,MAAM,UAAU,GAElB,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -40,7 +40,6 @@ const OPENAPI_TAGS = [
40
40
  name: 'Dependencies',
41
41
  description: 'Manage feature dependencies.',
42
42
  },
43
- { name: 'Edge', description: 'Endpoints related to Unleash on the Edge.' },
44
43
  {
45
44
  name: 'Environments',
46
45
  description: 'Create, update, delete, enable or disable [environments](https://docs.getunleash.io/reference/environments) for this Unleash instance.',
@@ -119,6 +118,10 @@ const OPENAPI_TAGS = [
119
118
  name: 'Telemetry',
120
119
  description: 'API for information about telemetry collection',
121
120
  },
121
+ {
122
+ name: 'Unleash Edge',
123
+ description: 'Endpoints related to [Unleash Edge](https://docs.getunleash.io/reference/api/unleash/edge).',
124
+ },
122
125
  {
123
126
  name: 'Unstable',
124
127
  description: 'Experimental endpoints that may change or disappear at any time.',
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-tags.js","sourceRoot":"","sources":["../../../../src/lib/openapi/util/openapi-tags.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,gBAAgB;AAChB,MAAM,YAAY,GAAG;IACjB;QACI,IAAI,EAAE,QAAQ;QACd,WAAW,EACP,iFAAiF;KACxF;IACD;QACI,IAAI,EAAE,UAAU;QAChB,WAAW,EACP,qIAAqI;KAC5I;IACD;QACI,IAAI,EAAE,YAAY;QAClB,WAAW,EACP,mHAAmH;KAC1H;IACD;QACI,IAAI,EAAE,SAAS;QACf,WAAW,EACP,8GAA8G;KACrH;IACD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,gCAAgC,EAAE;IAC/D;QACI,IAAI,EAAE,SAAS;QACf,WAAW,EACP,2FAA2F;KAClG;IACD;QACI,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACP,2FAA2F;KAClG;IACD;QACI,IAAI,EAAE,QAAQ;QACd,WAAW,EACP,yFAAyF;KAChG;IACD;QACI,IAAI,EAAE,SAAS;QACf,WAAW,EACP,6HAA6H;KACpI;IACD;QACI,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,8BAA8B;KAC9C;IACD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,2CAA2C,EAAE;IAC1E;QACI,IAAI,EAAE,cAAc;QACpB,WA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AgD;KAChE;IACD;QACI,IAAI,EAAE,UAAU;QAChB,WAAW,EACP,kEAAkE;KACzE;IACD,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,6BAA6B,EAAE;CACvD,CAAC;AAEX,yDAAyD;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"openapi-tags.js","sourceRoot":"","sources":["../../../../src/lib/openapi/util/openapi-tags.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,gBAAgB;AAChB,MAAM,YAAY,GAAG;IACjB;QACI,IAAI,EAAE,QAAQ;QACd,WAAW,EACP,iFAAiF;KACxF;IACD;QACI,IAAI,EAAE,UAAU;QAChB,WAAW,EACP,qIAAqI;KAC5I;IACD;QACI,IAAI,EAAE,YAAY;QAClB,WAAW,EACP,mHAAmH;KAC1H;IACD;QACI,IAAI,EAAE,SAAS;QACf,WAAW,EACP,8GAA8G;KACrH;IACD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,gCAAgC,EAAE;IAC/D;QACI,IAAI,EAAE,SAAS;QACf,WAAW,EACP,2FAA2F;KAClG;IACD;QACI,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACP,2FAA2F;KAClG;IACD;QACI,IAAI,EAAE,QAAQ;QACd,WAAW,EACP,yFAAyF;KAChG;IACD;QACI,IAAI,EAAE,SAAS;QACf,WAAW,EACP,6HAA6H;KACpI;IACD;QACI,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,8BAA8B;KAC9C;IACD;QACI,IAAI,EAAE,cAAc;QACpB,WAAW,EACP,wIAAwI;KAC/I;IACD,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;IAC1E;QACI,IAAI,EAAE,eAAe;QACrB,WAAW,EACP,uGAAuG;KAC9G;IACD;QACI,IAAI,EAAE,UAAU;QAChB,WAAW,EACP,mGA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AAC;AAEX,yDAAyD;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC"}
@@ -17,7 +17,7 @@ export default class EdgeController extends Controller {
17
17
  permission: NONE,
18
18
  middleware: [
19
19
  this.openApiService.validPath({
20
- tags: ['Edge'],
20
+ tags: ['Unleash Edge'],
21
21
  security: [{}],
22
22
  summary: 'Check which tokens are valid',
23
23
  description: 'This operation accepts a list of tokens to validate. Unleash will validate each token you provide. For each valid token you provide, Unleash will return the token along with its type and which projects it has access to.',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/routes/edge-api/index.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAEpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EACH,yBAAyB,GAE5B,MAAM,oDAAoD,CAAC;AAG5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAIhF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU;IAOlD,YACI,MAAsB,EACtB,EACI,WAAW,EACX,cAAc,GACyC;QAE3D,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QAErC,IAAI,CAAC,KAAK,CAAC;YACP,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,IAAI,CAAC,cAAc;YAC5B,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE;gBACR,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;oB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CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QAErC,IAAI,CAAC,KAAK,CAAC;YACP,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,IAAI,CAAC,cAAc;YAC5B,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE;gBACR,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;oBAC1B,IAAI,EAAE,CAAC,cAAc,CAAC;oBACtB,QAAQ,EAAE,CAAC,EAAE,CAAC;oBACd,OAAO,EAAE,8BAA8B;oBACvC,WAAW,EACP,6NAA6N;oBACjO,WAAW,EAAE,gBAAgB;oBAC7B,WAAW,EAAE,mBAAmB,CAAC,uBAAuB,CAAC;oBACzD,SAAS,EAAE;wBACP,GAAG,EAAE,oBAAoB,CAAC,2BAA2B,CAAC;wBACtD,GAAG,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;qBACzC;iBACJ,CAAC;aACL;SACJ,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,cAAc,CAChB,GAAuC,EACvC,GAAwC;QAExC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtE,IAAI,CAAC,cAAc,CAAC,qBAAqB,CACrC,GAAG,EACH,GAAG,EACH,yBAAyB,CAAC,GAAG,EAC7B,MAAM,CACT,CAAC;IACN,CAAC;CACJ"}
@@ -1,7 +1,7 @@
1
1
  import { type Variant } from 'unleash-client';
2
2
  import type { MetricFlagContext } from 'unleash-client/lib/impact-metrics/metric-types.js';
3
3
  import type { Context } from '../features/playground/feature-evaluator/index.js';
4
- export type IFlagKey = 'accessLogs' | 'anonymiseEventLog' | 'encryptEmails' | 'enableLicense' | 'responseTimeWithAppNameKillSwitch' | 'maintenanceMode' | 'messageBanner' | 'strictSchemaValidation' | 'personalAccessTokensKillSwitch' | 'migrationLock' | 'demo' | 'advancedPlayground' | 'filterInvalidClientMetrics' | 'disableMetrics' | 'signals' | 'automatedActions' | 'celebrateUnleash' | 'feedbackPosting' | 'extendedUsageMetrics' | 'feedbackComments' | 'killScheduledChangeRequestCache' | 'estimateTrafficDataCost' | 'useMemoizedActiveTokens' | 'queryMissingTokens' | 'disableUpdateMaxRevisionId' | 'disablePublishUnannouncedEvents' | 'outdatedSdksBanner' | 'responseTimeMetricsFix' | 'disableShowContextFieldSelectionValues' | 'manyStrategiesPagination' | 'enableLegacyVariants' | 'extendedMetrics' | 'removeUnsafeInlineStyleSrc' | 'projectRoleAssignment' | 'originMiddlewareRequestLogging' | 'webhookDomainLogging' | 'releasePlans' | 'productivityReportEmail' | 'productivityReportUnsubscribers' | 'showUserDeviceCount' | 'memorizeStats' | 'streaming' | 'etagVariant' | 'deltaApi' | 'uniqueSdkTracking' | 'consumptionModel' | 'edgeObservability' | 'reportUnknownFlags' | 'lifecycleMetrics' | 'customMetrics' | 'impactMetrics' | 'createFlagDialogCache' | 'improvedJsonDiff' | 'crDiffView' | 'changeRequestApproverEmails' | 'paygTrialEvents' | 'eventGrouping' | 'paygInstanceStatsEvents' | 'timestampsInChangeRequestTimeline' | 'lifecycleGraphs';
4
+ export type IFlagKey = 'accessLogs' | 'anonymiseEventLog' | 'encryptEmails' | 'enableLicense' | 'responseTimeWithAppNameKillSwitch' | 'maintenanceMode' | 'messageBanner' | 'strictSchemaValidation' | 'personalAccessTokensKillSwitch' | 'migrationLock' | 'demo' | 'advancedPlayground' | 'filterInvalidClientMetrics' | 'disableMetrics' | 'signals' | 'automatedActions' | 'celebrateUnleash' | 'feedbackPosting' | 'extendedUsageMetrics' | 'feedbackComments' | 'killScheduledChangeRequestCache' | 'estimateTrafficDataCost' | 'useMemoizedActiveTokens' | 'queryMissingTokens' | 'disableUpdateMaxRevisionId' | 'disablePublishUnannouncedEvents' | 'outdatedSdksBanner' | 'responseTimeMetricsFix' | 'disableShowContextFieldSelectionValues' | 'manyStrategiesPagination' | 'enableLegacyVariants' | 'extendedMetrics' | 'removeUnsafeInlineStyleSrc' | 'projectRoleAssignment' | 'originMiddlewareRequestLogging' | 'webhookDomainLogging' | 'releasePlans' | 'productivityReportEmail' | 'productivityReportUnsubscribers' | 'showUserDeviceCount' | 'memorizeStats' | 'streaming' | 'etagVariant' | 'deltaApi' | 'uniqueSdkTracking' | 'consumptionModel' | 'edgeObservability' | 'reportUnknownFlags' | 'lifecycleMetrics' | 'customMetrics' | 'impactMetrics' | 'createFlagDialogCache' | 'improvedJsonDiff' | 'crDiffView' | 'changeRequestApproverEmails' | 'paygTrialEvents' | 'eventGrouping' | 'paygInstanceStatsEvents' | 'timestampsInChangeRequestTimeline' | 'lifecycleGraphs' | 'githubAuth';
5
5
  export type IFlags = Partial<{
6
6
  [key in IFlagKey]: boolean | Variant;
7
7
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../../../src/lib/types/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAEjF,MAAM,MAAM,QAAQ,GACd,YAAY,GACZ,mBAAmB,GACnB,eAAe,GACf,eAAe,GACf,mCAAmC,GACnC,iBAAiB,GACjB,eAAe,GACf,wBAAwB,GACxB,gCAAgC,GAChC,eAAe,GACf,MAAM,GACN,oBAAoB,GACpB,4BAA4B,GAC5B,gBAAgB,GAChB,SAAS,GACT,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,sBAAsB,GACtB,kBAAkB,GAClB,iCAAiC,GACjC,yBAAyB,GACzB,yBAAyB,GACzB,oBAAoB,GACpB,4BAA4B,GAC5B,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AAY,KAAK,OAAO,CAAC;IACnE,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC;IACpE,gBAAgB,EAAE,MAAM,YAAY,CAAC;IACrC,aAAa,CAAC,EAAE,sBAAsB,CAAC;CAC1C;AAED,MAAM,WAAW,sBAAsB;IACnC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAE;IAC1C,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAE;IACxC,gBAAgB,CACZ,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,EACd,kBAAkB,CAAC,EAAE,iBAAiB,GACvC,IAAI,CAAC;IACR,WAAW,CACP,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,iBAAiB,GACvC,IAAI,CAAC;CACX"}
1
+ {"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../../../src/lib/types/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAEjF,MAAM,MAAM,QAAQ,GACd,YAAY,GACZ,mBAAmB,GACnB,eAAe,GACf,eAAe,GACf,mCAAmC,GACnC,iBAAiB,GACjB,eAAe,GACf,wBAAwB,GACxB,gCAAgC,GAChC,eAAe,GACf,MAAM,GACN,oBAAoB,GACpB,4BAA4B,GAC5B,gBAAgB,GAChB,SAAS,GACT,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,sBAAsB,GACtB,kBAAkB,GAClB,iCAAiC,GACjC,yBAAyB,GACzB,yBAAyB,GACzB,oBAAoB,GACpB,4BAA4B,GAC5B,iCAAiC,GACjC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AAY,KAAK,OAAO,CAAC;IACnE,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC;IACpE,gBAAgB,EAAE,MAAM,YAAY,CAAC;IACrC,aAAa,CAAC,EAAE,sBAAsB,CAAC;CAC1C;AAED,MAAM,WAAW,sBAAsB;IACnC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAE;IAC1C,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAE;IACxC,gBAAgB,CACZ,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,EACd,kBAAkB,CAAC,EAAE,iBAAiB,GACvC,IAAI,CAAC;IACR,WAAW,CACP,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,iBAAiB,GACvC,IAAI,CAAC;CACX"}
@@ -78,6 +78,7 @@ const flags = {
78
78
  paygInstanceStatsEvents: parseEnvVarBoolean(process.env.UNLEASH_EXPERIMENTAL_PAYG_INSTANCE_STATS_EVENTS, false),
79
79
  timestampsInChangeRequestTimeline: parseEnvVarBoolean(process.env.UNLEASH_EXPERIMENTAL_TIMESTAMPS_IN_CHANGE_REQUEST_TIMELINE, false),
80
80
  lifecycleGraphs: parseEnvVarBoolean(process.env.UNLEASH_EXPERIMENTAL_LIFECYCLE_GRAPHS, false),
81
+ githubAuth: parseEnvVarBoolean(process.env.UNLEASH_EXPERIMENTAL_GITHUB_AUTH, false),
81
82
  };
82
83
  export const defaultExperimentalOptions = {
83
84
  flags,
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.js","sourceRoot":"","sources":["../../../src/lib/types/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,i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qC,EACjD,KAAK,CACR;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAyB;IAC5D,KAAK;IACL,gBAAgB,EAAE;QACd,SAAS,EAAE,GAAY,EAAE,CAAC,KAAK;QAC/B,UAAU,EAAE,GAAG,EAAE,CAAC,iBAAiB,EAAE;QACrC,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;KAC/B;CACJ,CAAC"}
1
+ {"version":3,"file":"experimental.js","sourceRoot":"","sources":["../../../src/lib/types/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAqElE,MAAM,KAAK,GAAW;IAClB,iBAAiB,EAAE,KAAK;IACxB,aAAa,EAAE,KAAK;IACpB,iCAAiC,EAAE,kBAAkB,CACjD,OAAO,CAAC,GAAG,CAAC,+CAA+C,EAC3D,KAAK,CACR;IACD,eAAe,EAAE,kBAAkB,CAC/B,OAAO,CAAC,GAAG,CAAC,qCAAqC,EACjD,KAAK,CACR;IACD,aAAa,EAAE;QACX,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,kBAAkB,CACvB,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAC/C,KAAK,CACR;QACD,OAAO,EAAE;YACL,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,KAAK,EACD,OAAO,CAAC,GAAG,CAAC,2CAA2C,IAAI,EAAE;SACpE;KACJ;IACD,sBAAsB,EAAE,kBAAkB,CACtC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAC3C,KAAK,CACR;IACD,8BAA8B,EAAE,kBAAkB,CAC9C,OAAO,CAAC,GAAG,CAAC,uBAAuB,EACnC,KAAK,CACR;IACD,aAAa,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,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ACD,aAAa,EAAE,kBAAkB,CAC7B,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAC/C,KAAK,CACR;IACD,aAAa,EAAE,kBAAkB,CAC7B,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAC/C,KAAK,CACR;IACD,eAAe,EAAE,kBAAkB,CAC/B,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAClD,KAAK,CACR;IACD,uBAAuB,EAAE,kBAAkB,CACvC,OAAO,CAAC,GAAG,CAAC,+CAA+C,EAC3D,KAAK,CACR;IACD,iCAAiC,EAAE,kBAAkB,CACjD,OAAO,CAAC,GAAG,CAAC,0DAA0D,EACtE,KAAK,CACR;IACD,eAAe,EAAE,kBAAkB,CAC/B,OAAO,CAAC,GAAG,CAAC,qCAAqC,EACjD,KAAK,CACR;IACD,UAAU,EAAE,kBAAkB,CAC1B,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAC5C,KAAK,CACR;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAyB;IAC5D,KAAK;IACL,gBAAgB,EAAE;QACd,SAAS,EAAE,GAAY,EAAE,CAAC,KAAK;QAC/B,UAAU,EAAE,GAAG,EAAE,CAAC,iBAAiB,EAAE;QACrC,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;KAC/B;CACJ,CAAC"}
@@ -21,7 +21,7 @@
21
21
  rel="stylesheet"
22
22
  href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0"
23
23
  />
24
- <script type="module" crossorigin src="/static/index-7Xiv8xBJ.js"></script>
24
+ <script type="module" crossorigin src="/static/index-CBxzHo9v.js"></script>
25
25
  <link rel="stylesheet" crossorigin href="/static/style-BW9ZTER3.css">
26
26
  </head>
27
27
  <body>
@@ -1,3 +1,3 @@
1
- import{u as Tt,g as It,r as g,_ as Pt,j as t,a as xe,s as E,U as Rt,b as N,B as k,C as L,d as Ot,c as Bt,e as Ge,f as Ft,h as Z,T as $,F as Lt,I as Nt,S as At,M as $t,i as se,p as Ee,k as Te,l as te,A as _e,m as Dt,n as Wt,o as Ht,q as zt,t as Mt,v as Ut,w as Gt,x as _t,y as Ie,P as Vt,z as Pe,D as G,L as qt,E as Kt,G as Ve,H as qe,J as X,K as Jt,N as Ke,O as oe,Q as Je,R as Yt,V as Q,W as pe,X as Zt,Y as Qt,Z as Xt,$ as Ye,a0 as re,a1 as en,a2 as tn,a3 as nn,a4 as rn,a5 as an,a6 as sn,a7 as on,a8 as ln,a9 as cn,aa as dn,ab as un,ac as B,ad as ie,ae as hn,af as gn,ag as fn,ah as pn,ai as mn,aj as xn,ak as Re,al as Ze,am as ye,an as be,ao as Qe,ap as ve,aq as Xe,ar as et,as as tt,at as nt,au as yn,av as Oe,aw as bn,ax as vn,ay as de,az as jn,aA as Cn,aB as Sn,aC as kn,aD as wn,aE as En,aF as Tn}from"./index-7Xiv8xBJ.js";import{c as In,d as Pn,s as Rn,h as On,f as Bn,a as Fn,l as Ln,b as Nn,e as An,g as $n,i as Dn,j as Wn,k as Hn,m as zn,E as ae,n as Mn,o as je,p as Un,q as Gn,r as _n,t as Vn,u as qn,v as Kn,w as Jn,x as Yn,y as Zn,z as rt,A as U,H as at,B as i,C as Qn,D as Xn,S as er,F as tr,L as nr,G as rr,I as ar,J as sr,K as Be,M as or,N as ir}from"./index-Bj8wwcOa.js";import{u as lr}from"./useApiTokens-D7Sffu1E.js";const cr=()=>{const{makeRequest:e,createRequest:n,errors:r,loading:a}=Tt({propagateErrors:!0}),s="api/admin/playground";return{evaluateAdvancedPlayground:async l=>{const u=`${s}/advanced`,f=n(u,{method:"POST",body:JSON.stringify(l)});return(await e(f.caller,f.id)).json()},evaluateChangeRequestPlayground:async(l,u)=>{const f=`${s}/change-request/${l}`,o=n(f,{method:"POST",body:JSON.stringify(u)});return(await e(o.caller,o.id)).json()},errors:r,loading:a}};var Ce={exports:{}};function st(e,n=100,r={}){if(typeof e!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(n<0)throw new RangeError("`wait` must not be negative.");const{immediate:a}=typeof r=="boolean"?{immediate:r}:r;let s,c,d,l,u;function f(){const h=s,b=c;return s=void 0,c=void 0,u=e.apply(h,b),u}function o(){const h=Date.now()-l;h<n&&h>=0?d=setTimeout(o,n-h):(d=void 0,a||(u=f()))}const p=function(...h){if(s&&this!==s&&Object.getPrototypeOf(this)===Object.getPrototypeOf(s))throw new Error("Debounced method called with different contexts of the same prototype.");s=this,c=h,l=Date.now();const b=a&&!d;return d||(d=setTimeout(o,n)),b&&(u=f()),u};return Object.defineProperty(p,"isPending",{get(){return d!==void 0}}),p.clear=()=>{d&&(clearTimeout(d),d=void 0)},p.flush=()=>{d&&p.trigger()},p.trigger=()=>{u=f(),p.clear()},p}Ce.exports.debounce=st;Ce.exports=st;var dr=Ce.exports;const ur=It(dr);var Fe=function(n){n===void 0&&(n={});var{crosshairCursor:r=!1}=n,a=[];n.closeBracketsKeymap!==!1&&(a=a.concat(In)),n.defaultKeymap!==!1&&(a=a.concat(Pn)),n.searchKeymap!==!1&&(a=a.concat(Rn)),n.historyKeymap!==!1&&(a=a.concat(On)),n.foldKeymap!==!1&&(a=a.concat(Bn)),n.completionKeymap!==!1&&(a=a.concat(Fn)),n.lintKeymap!==!1&&(a=a.concat(Ln));var s=[];return n.lineNumbers!==!1&&s.push(Nn()),n.highlightActiveLineGutter!==!1&&s.push(An()),n.highlightSpecialChars!==!1&&s.push($n()),n.history!==!1&&s.push(Dn()),n.foldGutter!==!1&&s.push(Wn()),n.drawSelection!==!1&&s.push(Hn()),n.dropCursor!==!1&&s.push(zn()),n.allowMultipleSelections!==!1&&s.push(ae.allowMultipleSelections.of(!0)),n.indentOnInput!==!1&&s.push(Mn()),n.syntaxHighlighting!==!1&&s.push(je(Un,{fallback:!0})),n.bracketMatching!==!1&&s.push(Gn()),n.closeBrackets!==!1&&s.push(_n()),n.autocompletion!==!1&&s.push(Vn()),n.rectangularSelection!==!1&&s.push(qn()),r!==!1&&s.push(Kn()),n.highlightActiveLine!==!1&&s.push(Jn()),n.highlightSelectionMatches!==!1&&s.push(Yn()),n.tabSize&&typeof n.tabSize=="number"&&s.push(Zn.of(" ".repeat(n.tabSize))),s.concat([rt.of(a.flat())]).filter(Boolean)};const hr="#e5c07b",Le="#e06c75",gr="#56b6c2",fr="#ffffff",ne="#abb2bf",me="#7d8799",pr="#61afef",mr="#98c379",Ne="#d19a66",xr="#c678dd",yr="#21252b",Ae="#2c313a",$e="#282c34",ue="#353a42",br="#3E4451",De="#528bff",vr=U.theme({"&":{color:ne,backgroundColor:$e},".cm-content":{caretColor:De},".cm-cursor, .cm-dropCursor":{borderLeftColor:De},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:br},".cm-panels":{backgroundColor:yr,color:ne},".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 #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:$e,color:me,border:"none"},".cm-activeLineGutter":{backgroundColor:Ae},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ue},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ue,borderBottomColor:ue},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Ae,color:ne}}},{dark:!0}),jr=at.define([{tag:i.keyword,color:xr},{tag:[i.name,i.deleted,i.character,i.propertyName,i.macroName],color:Le},{tag:[i.function(i.variableName),i.labelName],color:pr},{tag:[i.color,i.constant(i.name),i.standard(i.name)],color:Ne},{tag:[i.definition(i.name),i.separator],color:ne},{tag:[i.typeName,i.className,i.number,i.changed,i.annotation,i.modifier,i.self,i.namespace],color:hr},{tag:[i.operator,i.operatorKeyword,i.url,i.escape,i.regexp,i.link,i.special(i.string)],color:gr},{tag:[i.meta,i.comment],color:me},{tag:i.strong,fontWeight:"bold"},{tag:i.emphasis,fontStyle:"italic"},{tag:i.strikethrough,textDecoration:"line-through"},{tag:i.link,color:me,textDecoration:"underline"},{tag:i.heading,fontWeight:"bold",color:Le},{tag:[i.atom,i.bool,i.special(i.variableName)],color:Ne},{tag:[i.processingInstruction,i.string,i.inserted],color:mr},{tag:i.invalid,color:fr}]),Cr=[vr,je(jr)];var Sr=U.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),kr=function(n){n===void 0&&(n={});var{indentWithTab:r=!0,editable:a=!0,readOnly:s=!1,theme:c="light",placeholder:d="",basicSetup:l=!0}=n,u=[];switch(r&&u.unshift(rt.of([Qn])),l&&(typeof l=="boolean"?u.unshift(Fe()):u.unshift(Fe(l))),d&&u.unshift(Xn(d)),c){case"light":u.push(Sr);break;case"dark":u.push(Cr);break;case"none":break;default:u.push(c);break}return a===!1&&u.push(U.editable.of(!1)),s&&u.push(ae.readOnly.of(!0)),[...u]},wr=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(n=>e.state.sliceDoc(n.from,n.to)),selectedText:e.state.selection.ranges.some(n=>!n.empty)}),We=tr.define(),Er=[];function Tr(e){var{value:n,selection:r,onChange:a,onStatistics:s,onCreateEditor:c,onUpdate:d,extensions:l=Er,autoFocus:u,theme:f="light",height:o=null,minHeight:p=null,maxHeight:h=null,width:b=null,minWidth:T=null,maxWidth:I=null,placeholder:v="",editable:R=!0,readOnly:P=!1,indentWithTab:F=!0,basicSetup:y=!0,root:m,initialState:w}=e,[x,j]=g.useState(),[C,A]=g.useState(),[D,z]=g.useState(),J=U.theme({"&":{height:o,minHeight:p,maxHeight:h,width:b,minWidth:T,maxWidth:I},"& .cm-scroller":{height:"100% !important"}}),V=U.updateListener.of(O=>{if(O.docChanged&&typeof a=="function"&&!O.transactions.some(le=>le.annotation(We))){var _=O.state.doc,q=_.toString();a(q,O)}s&&s(wr(O))}),Y=kr({theme:f,editable:R,readOnly:P,placeholder:v,indentWithTab:F,basicSetup:y}),W=[V,J,...Y];return d&&typeof d=="function"&&W.push(U.updateListener.of(d)),W=W.concat(l),g.useLayoutEffect(()=>{if(x&&!D){var O={doc:n,selection:r,extensions:W},_=w?ae.fromJSON(w.json,O,w.fields):ae.create(O);if(z(_),!C){var q=new U({state:_,parent:x,root:m});A(q),c&&c(q,_)}}return()=>{C&&(z(void 0),A(void 0))}},[x,D]),g.useEffect(()=>{e.container&&j(e.container)},[e.container]),g.useEffect(()=>()=>{C&&(C.destroy(),A(void 0))},[C]),g.useEffect(()=>{u&&C&&C.focus()},[u,C]),g.useEffect(()=>{C&&C.dispatch({effects:er.reconfigure.of(W)})},[f,l,o,p,h,b,T,I,v,R,P,F,y,a,d]),g.useEffect(()=>{if(n!==void 0){var O=C?C.state.doc.toString():"";C&&n!==O&&C.dispatch({changes:{from:0,to:O.length,insert:n||""},annotations:[We.of(!0)]})}},[n,C]),{state:D,setState:z,view:C,setView:A,container:x,setContainer:j}}var Ir=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],ot=g.forwardRef((e,n)=>{var{className:r,value:a="",selection:s,extensions:c=[],onChange:d,onStatistics:l,onCreateEditor:u,onUpdate:f,autoFocus:o,theme:p="light",height:h,minHeight:b,maxHeight:T,width:I,minWidth:v,maxWidth:R,basicSetup:P,placeholder:F,indentWithTab:y,editable:m,readOnly:w,root:x,initialState:j}=e,C=Pt(e,Ir),A=g.useRef(null),{state:D,view:z,container:J,setContainer:V}=Tr({root:x,value:a,autoFocus:o,theme:p,height:h,minHeight:b,maxHeight:T,width:I,minWidth:v,maxWidth:R,basicSetup:P,placeholder:F,indentWithTab:y,editable:m,readOnly:w,selection:s,onChange:d,onStatistics:l,onCreateEditor:u,onUpdate:f,extensions:c,initialState:j});g.useImperativeHandle(n,()=>({editor:A.current,state:D,view:z}),[A,J,D,z]);var Y=g.useCallback(O=>{A.current=O,V(O)},[V]);if(typeof a!="string")throw new Error("value must be typeof string but got "+typeof a);var W=typeof p=="string"?"cm-theme-"+p:"cm-theme";return t.jsx("div",xe({ref:Y,className:""+W+(r?" "+r:"")},C))});ot.displayName="CodeMirror";const Pr=rr.define({name:"json",parser:ar.configure({props:[sr.add({Object:Be({except:/^\s*\}/}),Array:Be({except:/^\s*\]/})}),or.add({"Object Array":ir})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Rr(){return new nr(Pr)}var it=e=>{var{theme:n,settings:r={},styles:a=[]}=e,s={".cm-gutters":{}},c={};r.background&&(c.backgroundColor=r.background),r.backgroundImage&&(c.backgroundImage=r.backgroundImage),r.foreground&&(c.color=r.foreground),r.fontSize&&(c.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=c),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var d={};r.gutterActiveForeground&&(d.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},d.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=d,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var l=U.theme(s,{dark:n==="dark"}),u=at.define(a),f=[l,je(u)];return f},Or={background:"#faf8f5",foreground:"#b29762",caret:"#93abdc",selection:"#e3dcce",selectionMatch:"#e3dcce",gutterBackground:"#faf8f5",gutterForeground:"#cdc4b1",gutterBorder:"transparent",lineHighlight:"#ddceb154"},Br=[{tag:[i.comment,i.bracket],color:"#b6ad9a"},{tag:[i.atom,i.number,i.keyword,i.link,i.attributeName,i.quote],color:"#063289"},{tag:[i.emphasis,i.heading,i.tagName,i.propertyName,i.variableName],color:"#2d2006"},{tag:[i.typeName,i.url,i.string],color:"#896724"},{tag:[i.operator,i.string],color:"#1659df"},{tag:[i.propertyName],color:"#b29762"},{tag:[i.unit,i.punctuation],color:"#063289"}],Fr=e=>{var{theme:n="light",settings:r={},styles:a=[]}={};return it({theme:n,settings:xe({},Or,r),styles:[...Br,...a]})},Lr=Fr(),Nr={background:"#2a2734",foreground:"#6c6783",caret:"#ffad5c",selection:"#91ff6c26",selectionMatch:"#91ff6c26",gutterBackground:"#2a2734",gutterForeground:"#545167",lineHighlight:"#36334280"},Ar=[{tag:[i.comment,i.bracket],color:"#6c6783"},{tag:[i.atom,i.number,i.keyword,i.link,i.attributeName,i.quote],color:"#ffcc99"},{tag:[i.emphasis,i.heading,i.tagName,i.propertyName,i.className,i.variableName],color:"#eeebff"},{tag:[i.typeName,i.url],color:"#7a63ee"},{tag:i.operator,color:"#ffad5c"},{tag:i.string,color:"#ffb870"},{tag:[i.propertyName],color:"#9a86fd"},{tag:[i.unit,i.punctuation],color:"#e09142"}],$r=e=>{var{theme:n="dark",settings:r={},styles:a=[]}={};return it({theme:n,settings:xe({},Nr,r),styles:[...Ar,...a]})},Dr=$r();const Wr=E("aside")(({theme:e})=>({height:"50px",backgroundColor:e.palette.background.paper,borderTopRightRadius:e.shape.borderRadiusMedium,borderTopLeftRadius:e.shape.borderRadiusMedium,padding:e.spacing(1,2),color:e.palette.text.primary,display:"flex",justifyContent:"space-between",alignItems:"center",border:`1px solid ${e.palette.divider}`})),lt=E("div")(({theme:e,style:n})=>({width:e.spacing(3),height:e.spacing(3),display:"flex",alignItems:"center",color:e.palette.background.paper,justifyContent:"center",transition:"background-color 0.5s ease-in-out",borderRadius:"50%",...n})),Hr=E("div")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.error.dark,marginRight:e.spacing(1)})),zr=()=>{const e=N();return t.jsx(lt,{style:{backgroundColor:e.palette.success.main},children:t.jsx(Ot,{sx:n=>({width:n.spacing(2),height:n.spacing(2)})})})},Mr=()=>{const e=N();return t.jsx(lt,{style:{backgroundColor:e.palette.error.main},children:t.jsx(Bt,{})})},Ur=({context:e,setContext:n,error:r})=>{const{themeMode:a}=g.useContext(Rt),s=N(),c=g.useCallback(l=>{n(l)},[n]),d=`calc(6 * ${s.typography.body1.fontSize} * ${s.typography.body1.lineHeight}) + 8px`;return t.jsxs(k,{sx:{width:"100%"},children:[t.jsxs(Wr,{children:["JSON",t.jsx(L,{condition:!!r,show:t.jsxs(k,{sx:l=>({display:"flex",alignItems:"center"}),children:[t.jsx(Hr,{children:r}),t.jsx(Mr,{})]}),elseShow:t.jsx(zr,{})})]}),t.jsx(ot,{value:e,minHeight:d,theme:a==="dark"?Dr:Lr,extensions:[Rr()],onChange:c,style:{border:`1px solid ${s.palette.divider}`,borderTop:"none"},placeholder:JSON.stringify({currentTime:"2022-07-04T14:13:03.929Z",appName:"playground",userId:"test",remoteAddress:"127.0.0.1"},null,2)})]})};function ct(e){return Array.isArray(e)?e:[e]}const Gr=e=>!e||e.length===0||e.length===1&&e[0]==="*"?"*":ct(e),_r=e=>ct(e),Vr=e=>{const n=qr(e);return n.length>0?n[0]:""},qr=e=>e.filter(({enabled:n})=>!!n).sort((n,r)=>n.sortOrder-r.sortOrder).map(({name:n})=>n),Kr=(e,n)=>"100%",Jr=e=>typeof e=="string"?!0:Array.isArray(e)?e.every(n=>typeof n=="string"):!1,Yr=e=>{const n=new Set(["appName","environment","userId","sessionId","remoteAddress","currentTime","properties"]),r={...e};let a=!1;for(const s in e)n.has(s)||(r.properties||(r.properties={}),r.properties[s]=e[s],delete r[s],a=!0);return!a&&!e.properties&&delete r.properties,r},Zr=e=>{const[n]=e.split("."),[r,a]=n.split(":");if(!r||!a)throw new Error("Invalid token format");if(a==="*")throw new Error("Admin tokens are not supported in the playground")},Qr=e=>{const[n]=e.split(".");return n.split(":")},Xr=({context:e,setContext:n})=>{const r=N(),{setToastData:a}=Ge(),{context:s}=Ft(),c=s.sort((y,m)=>y.sortOrder-m.sortOrder).map(({name:y})=>y),[d,l]=g.useState(),[u,f]=g.useState(!1),[o,p]=g.useState(""),[h,b]=g.useState(""),T=g.useMemo(()=>ur(y=>{var m;if(!y)return l(void 0);try{const w=JSON.parse(y);f(w[o]!==void 0||((m=w==null?void 0:w.properties)==null?void 0:m[o])!==void 0)}catch(w){return l(Z(w))}return l(void 0)},250),[l,o,f]);g.useEffect(()=>{T(e)},[T,e]);const I=()=>{try{const y=JSON.parse(e||"{}");n(JSON.stringify(Yr({...y,[o]:h}),null,2));const m=s.find(w=>w.name===o);if(m!=null&&m.legalValues&&m.legalValues.length>0||o==="currentTime")return b("")}catch(y){a({type:"error",text:`Error parsing context: ${Z(y)}`})}},v=(y,m)=>{if(Jr(m)){if(Array.isArray(m)){const w=(m||[]).length>1?m.join(","):m[0];return b(w)}b(m)}},R=()=>{if(!h||h==="")return[];const y=s.find(w=>w.name===o),m=((y==null?void 0:y.legalValues)||[]).length>1;return h.includes(",")&&m?h.split(","):[h]},P=()=>{if(o==="currentTime"){const m=Ee(h),x=m?Te(m.toISOString()):Te(new Date().toISOString());return t.jsx(te,{id:"date",label:"Date",size:"small",type:"datetime-local",value:x,sx:{width:200,maxWidth:"100%"},onChange:j=>{const C=Ee(j.target.value),A=C==null?void 0:C.toISOString();A&&b(A)},InputLabelProps:{shrink:!0},required:!0})}const y=s.find(m=>m.name===o);if(y!=null&&y.legalValues&&y.legalValues.length>0){const m=y.legalValues.map(({value:w})=>w);return t.jsx(_e,{disablePortal:!0,limitTags:3,id:"context-legal-values",multiple:!0,options:m,disableCloseOnSelect:!0,size:"small",value:R(),onChange:v,getOptionLabel:w=>w,renderOption:(w,x,{selected:j})=>t.jsxs("li",{...w,children:[t.jsx(Dt,{icon:t.jsx(Wt,{fontSize:"small"}),checkedIcon:t.jsx(Ht,{fontSize:"small"}),sx:C=>({marginRight:C.spacing(.5)}),checked:j}),x]}),sx:{width:370,maxWidth:"100%"},renderInput:w=>t.jsx(te,{...w,label:"Value"})})}return t.jsx(te,{label:"Value",id:"context-value",sx:{width:370,maxWidth:"100%"},placeholder:"value1,value2,value3",size:"small",value:h,onChange:m=>b(m.target.value||"")})},F=y=>{if(p(y.target.value||""),y.target.value==="currentTime")return b(new Date().toISOString());b("")};return t.jsxs(k,{children:[t.jsx(k,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx($,{variant:"body2",color:r.palette.text.primary,sx:{ml:1},children:"Unleash context"})}),t.jsxs(k,{sx:{display:"flex",gap:2,flexWrap:"wrap",mb:2},children:[t.jsxs(Lt,{children:[t.jsx(Nt,{id:"context-field-label",size:"small",children:"Context field"}),t.jsx(At,{label:"Context field",labelId:"context-field-label",id:"context-field",value:o,onChange:F,variant:"outlined",size:"small",sx:{width:200,maxWidth:"100%"},children:c.map(y=>t.jsx($t,{value:y,children:y},y))})]}),P(),t.jsx(se,{variant:"outlined",disabled:!o||!!d,onClick:I,sx:{width:"95px",maxHeight:"40px"},children:`${u?"Replace":"Add"} `})]}),t.jsx(Ur,{context:e,setContext:n,error:d})]})},ea=({environments:e,setEnvironments:n,availableEnvironments:r,disabled:a})=>{const s=[...r.map(l=>({label:l,id:l}))],c=s.filter(({id:l})=>e.includes(l)),d=(l,u,f)=>{const o=u;return f==="clear"||o===null?n([]):Array.isArray(o)?o.length===0?n([]):n(o.map(({id:p})=>p)):n([o.id])};return t.jsx(_e,{disablePortal:!0,limitTags:3,id:"environment",multiple:!0,options:s,sx:{flex:1},renderInput:l=>t.jsx(te,{...l,label:"Environments"}),renderOption:zt,renderTags:(l,u)=>l.map((f,o)=>{const{key:p,...h}=u({index:o});return t.jsx(Mt,{size:"small",...h,label:f.label},p)}),getOptionLabel:({label:l})=>l,disableCloseOnSelect:!1,size:"small",value:c,onChange:d,disabled:a,"data-testid":"PLAYGROUND_ENVIRONMENT_SELECT"})},he={label:"ALL",id:"*"},He=E(Ut)({fontSize:"1.25rem"}),dt=E(Gt)(()=>({width:"100%"})),ta=E(k)(({theme:e})=>({display:"grid",columnGap:e.spacing(2),rowGap:e.spacing(2),gridTemplateColumns:"1fr",[e.breakpoints.up("md")]:{gridTemplateColumns:"1fr 1fr"}})),na=E(dt)(({theme:e})=>({"& label":{WebkitTextFillColor:e.palette.text.secondary},"& input.Mui-disabled":{WebkitTextFillColor:e.palette.text.secondary}})),ra=({environments:e,projects:n,token:r,setProjects:a,setEnvironments:s,setToken:c,availableEnvironments:d,changeRequest:l,onClearChangeRequest:u})=>{const f=N(),{tokens:o}=lr(),[p,h]=g.useState(),{projects:b}=_t(),T=[he,...b.map(({name:x,id:j})=>({label:x,id:j}))],I=async x=>{const j=x.target.value;if(c==null||c(j),j===""){m();return}try{Zr(j),h(void 0),v(j)}catch(C){h(C.message)}},v=x=>{const[j,C]=Qr(x);switch(s([C]),j){case"[]":P(x);break;case"*":F();break;default:y(j)}},R=x=>{!x.projects||x.projects==="*"?a([he.id]):typeof x.projects=="string"?a([x.projects]):Array.isArray(x.projects)&&a(x.projects)},P=x=>{const j=o.find(({secret:C})=>C===x);j?R(j):h("Invalid token. Ensure you use a valid token from this Unleash instance.")},F=()=>{a([he.id])},y=x=>{T.map(j=>j.id).includes(x)?a([x]):h(`Invalid token. Project ${x} does not exist.`)},m=()=>{h(void 0)},w=()=>{c==null||c(""),m()};return t.jsxs(k,{sx:{pb:2},children:[t.jsx(k,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx($,{variant:"body2",color:f.palette.text.primary,sx:{ml:1},children:"Access configuration"})}),t.jsxs(ta,{children:[t.jsx(k,{children:t.jsx(Ie,{arrow:!0,title:r?"Environment is automatically selected because you are using a token":"Select environments to use in the playground",children:t.jsx(k,{children:t.jsx(ea,{environments:e,setEnvironments:s,availableEnvironments:d,disabled:!!(r||l)})})})}),t.jsx(k,{children:t.jsx(Ie,{arrow:!0,title:r?"Project is automatically selected because you are using a token":"Select projects to use in the playground",children:t.jsx(Vt,{selectedProjects:n,onChange:a,dataTestId:"PLAYGROUND_PROJECT_SELECT",disabled:!!(r||l),limitTags:3})})}),t.jsx(k,{children:t.jsx(dt,{label:"API token",value:r||(l?" ":""),onChange:I,type:"text",error:!!p,errorText:p,placeholder:"Enter your API token","data-testid":"PLAYGROUND_TOKEN_INPUT",InputProps:{endAdornment:r?t.jsx(Pe,{position:"end","data-testid":"TOKEN_INPUT_CLEAR_BTN",children:t.jsx(G,{"aria-label":"clear API token",onClick:w,edge:"end",children:t.jsx(He,{})})}):null},disabled:!!l})}),t.jsx(L,{condition:!!l,show:t.jsxs(k,{sx:{display:"flex",gap:2},children:[t.jsx(k,{sx:{flex:1},children:t.jsx(na,{label:"Change request",value:l?`Change request #${l}`:"",onChange:()=>{},type:"text",disabled:!0,InputProps:{endAdornment:t.jsx(Pe,{position:"end",children:t.jsx(G,{"aria-label":"clear Change request results",onClick:u,edge:"end",children:t.jsx(He,{})})})}})}),t.jsx(se,{variant:"outlined",size:"small",to:`/projects/${n[0]}/change-requests/${l}`,component:qt,children:"View change request"})]})})]})]})},aa=({availableEnvironments:e,environments:n,onSubmit:r,projects:a,token:s,setToken:c,setProjects:d,setEnvironments:l,context:u,setContext:f,changeRequest:o,onClearChangeRequest:p})=>t.jsxs(k,{component:"form",onSubmit:r,sx:{display:"flex",flexDirection:"column"},children:[t.jsx(ra,{environments:Array.isArray(n)?n:[n],projects:a,token:s,setToken:c,setEnvironments:l,setProjects:d,availableEnvironments:e.map(({name:h})=>h),changeRequest:o,onClearChangeRequest:p}),t.jsx(Xr,{context:u,setContext:f}),t.jsx(k,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between"},children:t.jsx(se,{variant:"contained",size:"large",type:"submit",sx:{marginLeft:"auto"},children:"Try configuration"})})]}),sa=E("div")(({style:e,theme:n})=>({width:"25px",height:"25px",borderRadius:"50%",color:n.palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",...e})),oa=({style:e,children:n,type:r})=>{const a=N(),s={backgroundColor:a.palette.background.alternative,color:a.palette.common.white};return r==="secondary"&&(s.backgroundColor=a.palette.background.paper,s.color=a.palette.text.secondary),t.jsx(sa,{style:{...s,...e},children:n})},ge=({headerText:e,bodyText:n,sectionNumber:r})=>t.jsx(k,{sx:{display:"flex",alignItems:"flex-start",mt:2,flexDirection:"column"},children:t.jsxs(k,{sx:{display:"flex"},children:[t.jsx(k,{children:t.jsx(oa,{children:r})}),t.jsxs(k,{sx:{ml:2,display:"flex",flexDirection:"column"},children:[t.jsx($,{variant:"body1",sx:{fontWeight:"bold"},children:e}),t.jsx(L,{condition:!!n,show:t.jsx($,{variant:"body1",sx:{mt:1},children:n})})]})]})}),ut=()=>t.jsxs(k,{sx:{ml:4},children:[t.jsx($,{variant:"body1",children:"Unleash playground is for helping you to understand how Unleash works, how feature flags are evaluated and for you to easily debug your feature flags."}),t.jsx(Kt,{sx:{mt:2,mb:2}}),t.jsx($,{variant:"body1",sx:{mb:1},children:"What you need to do is:"}),t.jsx(ge,{headerText:`Select in which environment you want to test your
1
+ import{u as Tt,g as It,r as g,_ as Pt,j as t,a as xe,s as E,U as Rt,b as N,B as k,C as L,d as Ot,c as Bt,e as Ge,f as Ft,h as Z,T as $,F as Lt,I as Nt,S as At,M as $t,i as se,p as Ee,k as Te,l as te,A as _e,m as Dt,n as Wt,o as Ht,q as zt,t as Mt,v as Ut,w as Gt,x as _t,y as Ie,P as Vt,z as Pe,D as G,L as qt,E as Kt,G as Ve,H as qe,J as X,K as Jt,N as Ke,O as oe,Q as Je,R as Yt,V as Q,W as pe,X as Zt,Y as Qt,Z as Xt,$ as Ye,a0 as re,a1 as en,a2 as tn,a3 as nn,a4 as rn,a5 as an,a6 as sn,a7 as on,a8 as ln,a9 as cn,aa as dn,ab as un,ac as B,ad as ie,ae as hn,af as gn,ag as fn,ah as pn,ai as mn,aj as xn,ak as Re,al as Ze,am as ye,an as be,ao as Qe,ap as ve,aq as Xe,ar as et,as as tt,at as nt,au as yn,av as Oe,aw as bn,ax as vn,ay as de,az as jn,aA as Cn,aB as Sn,aC as kn,aD as wn,aE as En,aF as Tn}from"./index-CBxzHo9v.js";import{c as In,d as Pn,s as Rn,h as On,f as Bn,a as Fn,l as Ln,b as Nn,e as An,g as $n,i as Dn,j as Wn,k as Hn,m as zn,E as ae,n as Mn,o as je,p as Un,q as Gn,r as _n,t as Vn,u as qn,v as Kn,w as Jn,x as Yn,y as Zn,z as rt,A as U,H as at,B as i,C as Qn,D as Xn,S as er,F as tr,L as nr,G as rr,I as ar,J as sr,K as Be,M as or,N as ir}from"./index-Bj8wwcOa.js";import{u as lr}from"./useApiTokens-CUb6SDEP.js";const cr=()=>{const{makeRequest:e,createRequest:n,errors:r,loading:a}=Tt({propagateErrors:!0}),s="api/admin/playground";return{evaluateAdvancedPlayground:async l=>{const u=`${s}/advanced`,f=n(u,{method:"POST",body:JSON.stringify(l)});return(await e(f.caller,f.id)).json()},evaluateChangeRequestPlayground:async(l,u)=>{const f=`${s}/change-request/${l}`,o=n(f,{method:"POST",body:JSON.stringify(u)});return(await e(o.caller,o.id)).json()},errors:r,loading:a}};var Ce={exports:{}};function st(e,n=100,r={}){if(typeof e!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(n<0)throw new RangeError("`wait` must not be negative.");const{immediate:a}=typeof r=="boolean"?{immediate:r}:r;let s,c,d,l,u;function f(){const h=s,b=c;return s=void 0,c=void 0,u=e.apply(h,b),u}function o(){const h=Date.now()-l;h<n&&h>=0?d=setTimeout(o,n-h):(d=void 0,a||(u=f()))}const p=function(...h){if(s&&this!==s&&Object.getPrototypeOf(this)===Object.getPrototypeOf(s))throw new Error("Debounced method called with different contexts of the same prototype.");s=this,c=h,l=Date.now();const b=a&&!d;return d||(d=setTimeout(o,n)),b&&(u=f()),u};return Object.defineProperty(p,"isPending",{get(){return d!==void 0}}),p.clear=()=>{d&&(clearTimeout(d),d=void 0)},p.flush=()=>{d&&p.trigger()},p.trigger=()=>{u=f(),p.clear()},p}Ce.exports.debounce=st;Ce.exports=st;var dr=Ce.exports;const ur=It(dr);var Fe=function(n){n===void 0&&(n={});var{crosshairCursor:r=!1}=n,a=[];n.closeBracketsKeymap!==!1&&(a=a.concat(In)),n.defaultKeymap!==!1&&(a=a.concat(Pn)),n.searchKeymap!==!1&&(a=a.concat(Rn)),n.historyKeymap!==!1&&(a=a.concat(On)),n.foldKeymap!==!1&&(a=a.concat(Bn)),n.completionKeymap!==!1&&(a=a.concat(Fn)),n.lintKeymap!==!1&&(a=a.concat(Ln));var s=[];return n.lineNumbers!==!1&&s.push(Nn()),n.highlightActiveLineGutter!==!1&&s.push(An()),n.highlightSpecialChars!==!1&&s.push($n()),n.history!==!1&&s.push(Dn()),n.foldGutter!==!1&&s.push(Wn()),n.drawSelection!==!1&&s.push(Hn()),n.dropCursor!==!1&&s.push(zn()),n.allowMultipleSelections!==!1&&s.push(ae.allowMultipleSelections.of(!0)),n.indentOnInput!==!1&&s.push(Mn()),n.syntaxHighlighting!==!1&&s.push(je(Un,{fallback:!0})),n.bracketMatching!==!1&&s.push(Gn()),n.closeBrackets!==!1&&s.push(_n()),n.autocompletion!==!1&&s.push(Vn()),n.rectangularSelection!==!1&&s.push(qn()),r!==!1&&s.push(Kn()),n.highlightActiveLine!==!1&&s.push(Jn()),n.highlightSelectionMatches!==!1&&s.push(Yn()),n.tabSize&&typeof n.tabSize=="number"&&s.push(Zn.of(" ".repeat(n.tabSize))),s.concat([rt.of(a.flat())]).filter(Boolean)};const hr="#e5c07b",Le="#e06c75",gr="#56b6c2",fr="#ffffff",ne="#abb2bf",me="#7d8799",pr="#61afef",mr="#98c379",Ne="#d19a66",xr="#c678dd",yr="#21252b",Ae="#2c313a",$e="#282c34",ue="#353a42",br="#3E4451",De="#528bff",vr=U.theme({"&":{color:ne,backgroundColor:$e},".cm-content":{caretColor:De},".cm-cursor, .cm-dropCursor":{borderLeftColor:De},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:br},".cm-panels":{backgroundColor:yr,color:ne},".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 #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:$e,color:me,border:"none"},".cm-activeLineGutter":{backgroundColor:Ae},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ue},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ue,borderBottomColor:ue},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Ae,color:ne}}},{dark:!0}),jr=at.define([{tag:i.keyword,color:xr},{tag:[i.name,i.deleted,i.character,i.propertyName,i.macroName],color:Le},{tag:[i.function(i.variableName),i.labelName],color:pr},{tag:[i.color,i.constant(i.name),i.standard(i.name)],color:Ne},{tag:[i.definition(i.name),i.separator],color:ne},{tag:[i.typeName,i.className,i.number,i.changed,i.annotation,i.modifier,i.self,i.namespace],color:hr},{tag:[i.operator,i.operatorKeyword,i.url,i.escape,i.regexp,i.link,i.special(i.string)],color:gr},{tag:[i.meta,i.comment],color:me},{tag:i.strong,fontWeight:"bold"},{tag:i.emphasis,fontStyle:"italic"},{tag:i.strikethrough,textDecoration:"line-through"},{tag:i.link,color:me,textDecoration:"underline"},{tag:i.heading,fontWeight:"bold",color:Le},{tag:[i.atom,i.bool,i.special(i.variableName)],color:Ne},{tag:[i.processingInstruction,i.string,i.inserted],color:mr},{tag:i.invalid,color:fr}]),Cr=[vr,je(jr)];var Sr=U.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),kr=function(n){n===void 0&&(n={});var{indentWithTab:r=!0,editable:a=!0,readOnly:s=!1,theme:c="light",placeholder:d="",basicSetup:l=!0}=n,u=[];switch(r&&u.unshift(rt.of([Qn])),l&&(typeof l=="boolean"?u.unshift(Fe()):u.unshift(Fe(l))),d&&u.unshift(Xn(d)),c){case"light":u.push(Sr);break;case"dark":u.push(Cr);break;case"none":break;default:u.push(c);break}return a===!1&&u.push(U.editable.of(!1)),s&&u.push(ae.readOnly.of(!0)),[...u]},wr=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(n=>e.state.sliceDoc(n.from,n.to)),selectedText:e.state.selection.ranges.some(n=>!n.empty)}),We=tr.define(),Er=[];function Tr(e){var{value:n,selection:r,onChange:a,onStatistics:s,onCreateEditor:c,onUpdate:d,extensions:l=Er,autoFocus:u,theme:f="light",height:o=null,minHeight:p=null,maxHeight:h=null,width:b=null,minWidth:T=null,maxWidth:I=null,placeholder:v="",editable:R=!0,readOnly:P=!1,indentWithTab:F=!0,basicSetup:y=!0,root:m,initialState:w}=e,[x,j]=g.useState(),[C,A]=g.useState(),[D,z]=g.useState(),J=U.theme({"&":{height:o,minHeight:p,maxHeight:h,width:b,minWidth:T,maxWidth:I},"& .cm-scroller":{height:"100% !important"}}),V=U.updateListener.of(O=>{if(O.docChanged&&typeof a=="function"&&!O.transactions.some(le=>le.annotation(We))){var _=O.state.doc,q=_.toString();a(q,O)}s&&s(wr(O))}),Y=kr({theme:f,editable:R,readOnly:P,placeholder:v,indentWithTab:F,basicSetup:y}),W=[V,J,...Y];return d&&typeof d=="function"&&W.push(U.updateListener.of(d)),W=W.concat(l),g.useLayoutEffect(()=>{if(x&&!D){var O={doc:n,selection:r,extensions:W},_=w?ae.fromJSON(w.json,O,w.fields):ae.create(O);if(z(_),!C){var q=new U({state:_,parent:x,root:m});A(q),c&&c(q,_)}}return()=>{C&&(z(void 0),A(void 0))}},[x,D]),g.useEffect(()=>{e.container&&j(e.container)},[e.container]),g.useEffect(()=>()=>{C&&(C.destroy(),A(void 0))},[C]),g.useEffect(()=>{u&&C&&C.focus()},[u,C]),g.useEffect(()=>{C&&C.dispatch({effects:er.reconfigure.of(W)})},[f,l,o,p,h,b,T,I,v,R,P,F,y,a,d]),g.useEffect(()=>{if(n!==void 0){var O=C?C.state.doc.toString():"";C&&n!==O&&C.dispatch({changes:{from:0,to:O.length,insert:n||""},annotations:[We.of(!0)]})}},[n,C]),{state:D,setState:z,view:C,setView:A,container:x,setContainer:j}}var Ir=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],ot=g.forwardRef((e,n)=>{var{className:r,value:a="",selection:s,extensions:c=[],onChange:d,onStatistics:l,onCreateEditor:u,onUpdate:f,autoFocus:o,theme:p="light",height:h,minHeight:b,maxHeight:T,width:I,minWidth:v,maxWidth:R,basicSetup:P,placeholder:F,indentWithTab:y,editable:m,readOnly:w,root:x,initialState:j}=e,C=Pt(e,Ir),A=g.useRef(null),{state:D,view:z,container:J,setContainer:V}=Tr({root:x,value:a,autoFocus:o,theme:p,height:h,minHeight:b,maxHeight:T,width:I,minWidth:v,maxWidth:R,basicSetup:P,placeholder:F,indentWithTab:y,editable:m,readOnly:w,selection:s,onChange:d,onStatistics:l,onCreateEditor:u,onUpdate:f,extensions:c,initialState:j});g.useImperativeHandle(n,()=>({editor:A.current,state:D,view:z}),[A,J,D,z]);var Y=g.useCallback(O=>{A.current=O,V(O)},[V]);if(typeof a!="string")throw new Error("value must be typeof string but got "+typeof a);var W=typeof p=="string"?"cm-theme-"+p:"cm-theme";return t.jsx("div",xe({ref:Y,className:""+W+(r?" "+r:"")},C))});ot.displayName="CodeMirror";const Pr=rr.define({name:"json",parser:ar.configure({props:[sr.add({Object:Be({except:/^\s*\}/}),Array:Be({except:/^\s*\]/})}),or.add({"Object Array":ir})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Rr(){return new nr(Pr)}var it=e=>{var{theme:n,settings:r={},styles:a=[]}=e,s={".cm-gutters":{}},c={};r.background&&(c.backgroundColor=r.background),r.backgroundImage&&(c.backgroundImage=r.backgroundImage),r.foreground&&(c.color=r.foreground),r.fontSize&&(c.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=c),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var d={};r.gutterActiveForeground&&(d.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},d.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=d,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var l=U.theme(s,{dark:n==="dark"}),u=at.define(a),f=[l,je(u)];return f},Or={background:"#faf8f5",foreground:"#b29762",caret:"#93abdc",selection:"#e3dcce",selectionMatch:"#e3dcce",gutterBackground:"#faf8f5",gutterForeground:"#cdc4b1",gutterBorder:"transparent",lineHighlight:"#ddceb154"},Br=[{tag:[i.comment,i.bracket],color:"#b6ad9a"},{tag:[i.atom,i.number,i.keyword,i.link,i.attributeName,i.quote],color:"#063289"},{tag:[i.emphasis,i.heading,i.tagName,i.propertyName,i.variableName],color:"#2d2006"},{tag:[i.typeName,i.url,i.string],color:"#896724"},{tag:[i.operator,i.string],color:"#1659df"},{tag:[i.propertyName],color:"#b29762"},{tag:[i.unit,i.punctuation],color:"#063289"}],Fr=e=>{var{theme:n="light",settings:r={},styles:a=[]}={};return it({theme:n,settings:xe({},Or,r),styles:[...Br,...a]})},Lr=Fr(),Nr={background:"#2a2734",foreground:"#6c6783",caret:"#ffad5c",selection:"#91ff6c26",selectionMatch:"#91ff6c26",gutterBackground:"#2a2734",gutterForeground:"#545167",lineHighlight:"#36334280"},Ar=[{tag:[i.comment,i.bracket],color:"#6c6783"},{tag:[i.atom,i.number,i.keyword,i.link,i.attributeName,i.quote],color:"#ffcc99"},{tag:[i.emphasis,i.heading,i.tagName,i.propertyName,i.className,i.variableName],color:"#eeebff"},{tag:[i.typeName,i.url],color:"#7a63ee"},{tag:i.operator,color:"#ffad5c"},{tag:i.string,color:"#ffb870"},{tag:[i.propertyName],color:"#9a86fd"},{tag:[i.unit,i.punctuation],color:"#e09142"}],$r=e=>{var{theme:n="dark",settings:r={},styles:a=[]}={};return it({theme:n,settings:xe({},Nr,r),styles:[...Ar,...a]})},Dr=$r();const Wr=E("aside")(({theme:e})=>({height:"50px",backgroundColor:e.palette.background.paper,borderTopRightRadius:e.shape.borderRadiusMedium,borderTopLeftRadius:e.shape.borderRadiusMedium,padding:e.spacing(1,2),color:e.palette.text.primary,display:"flex",justifyContent:"space-between",alignItems:"center",border:`1px solid ${e.palette.divider}`})),lt=E("div")(({theme:e,style:n})=>({width:e.spacing(3),height:e.spacing(3),display:"flex",alignItems:"center",color:e.palette.background.paper,justifyContent:"center",transition:"background-color 0.5s ease-in-out",borderRadius:"50%",...n})),Hr=E("div")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.error.dark,marginRight:e.spacing(1)})),zr=()=>{const e=N();return t.jsx(lt,{style:{backgroundColor:e.palette.success.main},children:t.jsx(Ot,{sx:n=>({width:n.spacing(2),height:n.spacing(2)})})})},Mr=()=>{const e=N();return t.jsx(lt,{style:{backgroundColor:e.palette.error.main},children:t.jsx(Bt,{})})},Ur=({context:e,setContext:n,error:r})=>{const{themeMode:a}=g.useContext(Rt),s=N(),c=g.useCallback(l=>{n(l)},[n]),d=`calc(6 * ${s.typography.body1.fontSize} * ${s.typography.body1.lineHeight}) + 8px`;return t.jsxs(k,{sx:{width:"100%"},children:[t.jsxs(Wr,{children:["JSON",t.jsx(L,{condition:!!r,show:t.jsxs(k,{sx:l=>({display:"flex",alignItems:"center"}),children:[t.jsx(Hr,{children:r}),t.jsx(Mr,{})]}),elseShow:t.jsx(zr,{})})]}),t.jsx(ot,{value:e,minHeight:d,theme:a==="dark"?Dr:Lr,extensions:[Rr()],onChange:c,style:{border:`1px solid ${s.palette.divider}`,borderTop:"none"},placeholder:JSON.stringify({currentTime:"2022-07-04T14:13:03.929Z",appName:"playground",userId:"test",remoteAddress:"127.0.0.1"},null,2)})]})};function ct(e){return Array.isArray(e)?e:[e]}const Gr=e=>!e||e.length===0||e.length===1&&e[0]==="*"?"*":ct(e),_r=e=>ct(e),Vr=e=>{const n=qr(e);return n.length>0?n[0]:""},qr=e=>e.filter(({enabled:n})=>!!n).sort((n,r)=>n.sortOrder-r.sortOrder).map(({name:n})=>n),Kr=(e,n)=>"100%",Jr=e=>typeof e=="string"?!0:Array.isArray(e)?e.every(n=>typeof n=="string"):!1,Yr=e=>{const n=new Set(["appName","environment","userId","sessionId","remoteAddress","currentTime","properties"]),r={...e};let a=!1;for(const s in e)n.has(s)||(r.properties||(r.properties={}),r.properties[s]=e[s],delete r[s],a=!0);return!a&&!e.properties&&delete r.properties,r},Zr=e=>{const[n]=e.split("."),[r,a]=n.split(":");if(!r||!a)throw new Error("Invalid token format");if(a==="*")throw new Error("Admin tokens are not supported in the playground")},Qr=e=>{const[n]=e.split(".");return n.split(":")},Xr=({context:e,setContext:n})=>{const r=N(),{setToastData:a}=Ge(),{context:s}=Ft(),c=s.sort((y,m)=>y.sortOrder-m.sortOrder).map(({name:y})=>y),[d,l]=g.useState(),[u,f]=g.useState(!1),[o,p]=g.useState(""),[h,b]=g.useState(""),T=g.useMemo(()=>ur(y=>{var m;if(!y)return l(void 0);try{const w=JSON.parse(y);f(w[o]!==void 0||((m=w==null?void 0:w.properties)==null?void 0:m[o])!==void 0)}catch(w){return l(Z(w))}return l(void 0)},250),[l,o,f]);g.useEffect(()=>{T(e)},[T,e]);const I=()=>{try{const y=JSON.parse(e||"{}");n(JSON.stringify(Yr({...y,[o]:h}),null,2));const m=s.find(w=>w.name===o);if(m!=null&&m.legalValues&&m.legalValues.length>0||o==="currentTime")return b("")}catch(y){a({type:"error",text:`Error parsing context: ${Z(y)}`})}},v=(y,m)=>{if(Jr(m)){if(Array.isArray(m)){const w=(m||[]).length>1?m.join(","):m[0];return b(w)}b(m)}},R=()=>{if(!h||h==="")return[];const y=s.find(w=>w.name===o),m=((y==null?void 0:y.legalValues)||[]).length>1;return h.includes(",")&&m?h.split(","):[h]},P=()=>{if(o==="currentTime"){const m=Ee(h),x=m?Te(m.toISOString()):Te(new Date().toISOString());return t.jsx(te,{id:"date",label:"Date",size:"small",type:"datetime-local",value:x,sx:{width:200,maxWidth:"100%"},onChange:j=>{const C=Ee(j.target.value),A=C==null?void 0:C.toISOString();A&&b(A)},InputLabelProps:{shrink:!0},required:!0})}const y=s.find(m=>m.name===o);if(y!=null&&y.legalValues&&y.legalValues.length>0){const m=y.legalValues.map(({value:w})=>w);return t.jsx(_e,{disablePortal:!0,limitTags:3,id:"context-legal-values",multiple:!0,options:m,disableCloseOnSelect:!0,size:"small",value:R(),onChange:v,getOptionLabel:w=>w,renderOption:(w,x,{selected:j})=>t.jsxs("li",{...w,children:[t.jsx(Dt,{icon:t.jsx(Wt,{fontSize:"small"}),checkedIcon:t.jsx(Ht,{fontSize:"small"}),sx:C=>({marginRight:C.spacing(.5)}),checked:j}),x]}),sx:{width:370,maxWidth:"100%"},renderInput:w=>t.jsx(te,{...w,label:"Value"})})}return t.jsx(te,{label:"Value",id:"context-value",sx:{width:370,maxWidth:"100%"},placeholder:"value1,value2,value3",size:"small",value:h,onChange:m=>b(m.target.value||"")})},F=y=>{if(p(y.target.value||""),y.target.value==="currentTime")return b(new Date().toISOString());b("")};return t.jsxs(k,{children:[t.jsx(k,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx($,{variant:"body2",color:r.palette.text.primary,sx:{ml:1},children:"Unleash context"})}),t.jsxs(k,{sx:{display:"flex",gap:2,flexWrap:"wrap",mb:2},children:[t.jsxs(Lt,{children:[t.jsx(Nt,{id:"context-field-label",size:"small",children:"Context field"}),t.jsx(At,{label:"Context field",labelId:"context-field-label",id:"context-field",value:o,onChange:F,variant:"outlined",size:"small",sx:{width:200,maxWidth:"100%"},children:c.map(y=>t.jsx($t,{value:y,children:y},y))})]}),P(),t.jsx(se,{variant:"outlined",disabled:!o||!!d,onClick:I,sx:{width:"95px",maxHeight:"40px"},children:`${u?"Replace":"Add"} `})]}),t.jsx(Ur,{context:e,setContext:n,error:d})]})},ea=({environments:e,setEnvironments:n,availableEnvironments:r,disabled:a})=>{const s=[...r.map(l=>({label:l,id:l}))],c=s.filter(({id:l})=>e.includes(l)),d=(l,u,f)=>{const o=u;return f==="clear"||o===null?n([]):Array.isArray(o)?o.length===0?n([]):n(o.map(({id:p})=>p)):n([o.id])};return t.jsx(_e,{disablePortal:!0,limitTags:3,id:"environment",multiple:!0,options:s,sx:{flex:1},renderInput:l=>t.jsx(te,{...l,label:"Environments"}),renderOption:zt,renderTags:(l,u)=>l.map((f,o)=>{const{key:p,...h}=u({index:o});return t.jsx(Mt,{size:"small",...h,label:f.label},p)}),getOptionLabel:({label:l})=>l,disableCloseOnSelect:!1,size:"small",value:c,onChange:d,disabled:a,"data-testid":"PLAYGROUND_ENVIRONMENT_SELECT"})},he={label:"ALL",id:"*"},He=E(Ut)({fontSize:"1.25rem"}),dt=E(Gt)(()=>({width:"100%"})),ta=E(k)(({theme:e})=>({display:"grid",columnGap:e.spacing(2),rowGap:e.spacing(2),gridTemplateColumns:"1fr",[e.breakpoints.up("md")]:{gridTemplateColumns:"1fr 1fr"}})),na=E(dt)(({theme:e})=>({"& label":{WebkitTextFillColor:e.palette.text.secondary},"& input.Mui-disabled":{WebkitTextFillColor:e.palette.text.secondary}})),ra=({environments:e,projects:n,token:r,setProjects:a,setEnvironments:s,setToken:c,availableEnvironments:d,changeRequest:l,onClearChangeRequest:u})=>{const f=N(),{tokens:o}=lr(),[p,h]=g.useState(),{projects:b}=_t(),T=[he,...b.map(({name:x,id:j})=>({label:x,id:j}))],I=async x=>{const j=x.target.value;if(c==null||c(j),j===""){m();return}try{Zr(j),h(void 0),v(j)}catch(C){h(C.message)}},v=x=>{const[j,C]=Qr(x);switch(s([C]),j){case"[]":P(x);break;case"*":F();break;default:y(j)}},R=x=>{!x.projects||x.projects==="*"?a([he.id]):typeof x.projects=="string"?a([x.projects]):Array.isArray(x.projects)&&a(x.projects)},P=x=>{const j=o.find(({secret:C})=>C===x);j?R(j):h("Invalid token. Ensure you use a valid token from this Unleash instance.")},F=()=>{a([he.id])},y=x=>{T.map(j=>j.id).includes(x)?a([x]):h(`Invalid token. Project ${x} does not exist.`)},m=()=>{h(void 0)},w=()=>{c==null||c(""),m()};return t.jsxs(k,{sx:{pb:2},children:[t.jsx(k,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx($,{variant:"body2",color:f.palette.text.primary,sx:{ml:1},children:"Access configuration"})}),t.jsxs(ta,{children:[t.jsx(k,{children:t.jsx(Ie,{arrow:!0,title:r?"Environment is automatically selected because you are using a token":"Select environments to use in the playground",children:t.jsx(k,{children:t.jsx(ea,{environments:e,setEnvironments:s,availableEnvironments:d,disabled:!!(r||l)})})})}),t.jsx(k,{children:t.jsx(Ie,{arrow:!0,title:r?"Project is automatically selected because you are using a token":"Select projects to use in the playground",children:t.jsx(Vt,{selectedProjects:n,onChange:a,dataTestId:"PLAYGROUND_PROJECT_SELECT",disabled:!!(r||l),limitTags:3})})}),t.jsx(k,{children:t.jsx(dt,{label:"API token",value:r||(l?" ":""),onChange:I,type:"text",error:!!p,errorText:p,placeholder:"Enter your API token","data-testid":"PLAYGROUND_TOKEN_INPUT",InputProps:{endAdornment:r?t.jsx(Pe,{position:"end","data-testid":"TOKEN_INPUT_CLEAR_BTN",children:t.jsx(G,{"aria-label":"clear API token",onClick:w,edge:"end",children:t.jsx(He,{})})}):null},disabled:!!l})}),t.jsx(L,{condition:!!l,show:t.jsxs(k,{sx:{display:"flex",gap:2},children:[t.jsx(k,{sx:{flex:1},children:t.jsx(na,{label:"Change request",value:l?`Change request #${l}`:"",onChange:()=>{},type:"text",disabled:!0,InputProps:{endAdornment:t.jsx(Pe,{position:"end",children:t.jsx(G,{"aria-label":"clear Change request results",onClick:u,edge:"end",children:t.jsx(He,{})})})}})}),t.jsx(se,{variant:"outlined",size:"small",to:`/projects/${n[0]}/change-requests/${l}`,component:qt,children:"View change request"})]})})]})]})},aa=({availableEnvironments:e,environments:n,onSubmit:r,projects:a,token:s,setToken:c,setProjects:d,setEnvironments:l,context:u,setContext:f,changeRequest:o,onClearChangeRequest:p})=>t.jsxs(k,{component:"form",onSubmit:r,sx:{display:"flex",flexDirection:"column"},children:[t.jsx(ra,{environments:Array.isArray(n)?n:[n],projects:a,token:s,setToken:c,setEnvironments:l,setProjects:d,availableEnvironments:e.map(({name:h})=>h),changeRequest:o,onClearChangeRequest:p}),t.jsx(Xr,{context:u,setContext:f}),t.jsx(k,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between"},children:t.jsx(se,{variant:"contained",size:"large",type:"submit",sx:{marginLeft:"auto"},children:"Try configuration"})})]}),sa=E("div")(({style:e,theme:n})=>({width:"25px",height:"25px",borderRadius:"50%",color:n.palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",...e})),oa=({style:e,children:n,type:r})=>{const a=N(),s={backgroundColor:a.palette.background.alternative,color:a.palette.common.white};return r==="secondary"&&(s.backgroundColor=a.palette.background.paper,s.color=a.palette.text.secondary),t.jsx(sa,{style:{...s,...e},children:n})},ge=({headerText:e,bodyText:n,sectionNumber:r})=>t.jsx(k,{sx:{display:"flex",alignItems:"flex-start",mt:2,flexDirection:"column"},children:t.jsxs(k,{sx:{display:"flex"},children:[t.jsx(k,{children:t.jsx(oa,{children:r})}),t.jsxs(k,{sx:{ml:2,display:"flex",flexDirection:"column"},children:[t.jsx($,{variant:"body1",sx:{fontWeight:"bold"},children:e}),t.jsx(L,{condition:!!n,show:t.jsx($,{variant:"body1",sx:{mt:1},children:n})})]})]})}),ut=()=>t.jsxs(k,{sx:{ml:4},children:[t.jsx($,{variant:"body1",children:"Unleash playground is for helping you to understand how Unleash works, how feature flags are evaluated and for you to easily debug your feature flags."}),t.jsx(Kt,{sx:{mt:2,mb:2}}),t.jsx($,{variant:"body1",sx:{mb:1},children:"What you need to do is:"}),t.jsx(ge,{headerText:`Select in which environment you want to test your
2
2
  feature flag configuration`,bodyText:`You can also specify specific projects, or check
3
3
  flags in all projects.`,sectionNumber:"1"}),t.jsx(ge,{headerText:"Select a context field that you'd like to check",bodyText:"You can configure as many context fields as you want. You can also leave the context empty to test against an empty context.",sectionNumber:"2"}),t.jsx(ge,{headerText:"Submit the form to try the configuration",bodyText:"The results of evaluating your feature flags will appear after you submit the form. Then view the results.",sectionNumber:"3"})]});var Se={},ia=qe;Object.defineProperty(Se,"__esModule",{value:!0});var ht=Se.default=void 0,la=ia(Ve()),ca=t,da=(0,la.default)((0,ca.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}),"Help");ht=Se.default=da;const ua=E(X)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:e.shape.borderRadiusExtraLarge,border:`1px solid ${e.palette.divider}`,padding:e.spacing(8,4),maxWidth:"500px"}})),ha=()=>{const[e,n]=g.useState(null),r=c=>n(c.currentTarget),a=()=>n(null),s=!!e;return t.jsxs(k,{children:[t.jsx(G,{onClick:r,"aria-label":"Open Playground guidance",children:t.jsx(ht,{})}),t.jsxs(ua,{open:s,anchorEl:e,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},sx:c=>({zIndex:c.zIndex.tooltip,background:"none"}),children:[t.jsx(G,{onClick:a,sx:{position:"absolute",right:25,top:15},children:t.jsx(Jt,{})}),t.jsx(ut,{})]})]})},ga=e=>g.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.84818 0.184159C8.56367 -0.0789547 8.1234 -0.0575747 7.86482 0.231912C7.60623 0.521399 7.62724 0.96937 7.91175 1.23248C9.48292 2.68551 10.6076 4.74934 10.6076 7C10.6076 9.25066 9.48292 11.3145 7.91175 12.7675C7.62724 13.0306 7.60623 13.4786 7.86482 13.7681C8.1234 14.0576 8.56367 14.079 8.84818 13.8158C10.6396 12.1592 11.9998 9.73702 11.9998 7C11.9998 4.26298 10.6396 1.84083 8.84818 0.184159ZM6.04105 2.23302C6.29109 1.93586 6.73054 1.90121 7.02259 2.15563C8.33146 3.29586 9.35426 5.02309 9.35426 6.99995C9.35426 8.97682 8.33145 10.7039 7.02259 11.8441C6.73054 12.0986 6.29109 12.0639 6.04105 11.7668C5.79101 11.4696 5.82506 11.0225 6.11711 10.768C7.19425 9.82969 7.96199 8.46967 7.96199 6.99995C7.96199 5.53021 7.19423 4.17007 6.11711 3.23173C5.82506 2.97731 5.79101 2.53017 6.04105 2.23302ZM6.56908 7.00015C6.56908 8.56492 5.3224 9.83342 3.78454 9.83342C2.24668 9.83342 1 8.56492 1 7.00015C1 5.43539 2.24668 4.16689 3.78454 4.16689C5.3224 4.16689 6.56908 5.43539 6.56908 7.00015Z",fill:"currentColor"})),fa=e=>g.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.84835 0.184159C8.56384 -0.0789547 8.12358 -0.0575747 7.86499 0.231912C7.6064 0.521399 7.62741 0.96937 7.91192 1.23248C9.4831 2.68551 10.6078 4.74934 10.6078 7C10.6078 7.40738 10.5709 7.80863 10.5012 8.20125L11.6597 9.35972C11.8783 8.60937 12 7.81877 12 7C12 4.26298 10.6397 1.84083 8.84835 0.184159ZM9.35443 6.99995L9.35418 7.0542L7.63252 5.33255C7.30901 4.52372 6.76993 3.80029 6.11728 3.23173C5.82523 2.97731 5.79118 2.53017 6.04122 2.23302C6.29127 1.93586 6.73072 1.90121 7.02276 2.15563C8.33164 3.29586 9.35443 5.02309 9.35443 6.99995ZM7.57827 8.79752L6.48307 7.70233C6.17606 8.92745 5.08437 9.83342 3.78471 9.83342C2.24685 9.83342 1.00017 8.56492 1.00017 7.00015C1.00017 5.69492 1.8676 4.59583 3.04789 4.26714L0.458225 1.67748C0.172794 1.39205 0.178843 0.923223 0.471736 0.63033C0.764629 0.337437 1.23345 0.331388 1.51889 0.616819L13.2132 12.3111C13.4986 12.5965 13.4926 13.0654 13.1997 13.3583C12.9068 13.6511 12.4379 13.6572 12.1525 13.3718L10.556 11.7753C10.0694 12.539 9.48623 13.2259 8.84835 13.8158C8.56384 14.079 8.12358 14.0576 7.86499 13.7681C7.6064 13.4786 7.62741 13.0306 7.91192 12.7675C8.54021 12.1865 9.0971 11.5078 9.53922 10.7585L8.62356 9.84281C8.20906 10.6195 7.64861 11.2989 7.02276 11.8441C6.73072 12.0986 6.29127 12.0639 6.04122 11.7668C5.79118 11.4696 5.82523 11.0225 6.11728 10.768C6.73471 10.2302 7.25048 9.55374 7.57827 8.79752Z",fill:"currentColor"})),pa=e=>e==="unknown"||e==="unevaluated"?[oe,"info"]:e===!0?[ga,"success"]:[fa,"error"],K=({enabled:e,label:n,showIcon:r=!0})=>{const[a,s]=pa(e);return t.jsx(Ke,{color:s,icon:r?t.jsx(a,{"aria-hidden":!0,color:s,strokeWidth:"0.25"}):void 0,children:n})},ma=E(k)(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing(1,0,1,2)})),xa=E(k)(()=>({marginRight:"auto"})),gt=({feature:e})=>{const[n,r]=(()=>{var a;return e!=null&&e.isEnabled?[!0,"True"]:((a=e==null?void 0:e.strategies)==null?void 0:a.result)==="unknown"?["unknown","Unknown"]:[!1,"False"]})();return t.jsx(ma,{children:t.jsx(xa,{"data-loading":!0,children:t.jsx(K,{enabled:n,label:r,showIcon:n!=="unknown"})})})};function ft(e){return e===void 0?!0:Object.values(e).every(n=>n&&typeof n=="object"?ft(n):n===null)}const ze=e=>{var n,r;return(r=(n=e.strategies)==null?void 0:n.data)==null?void 0:r.find(a=>!Je.includes(a.name))},ya=e=>{var n,r,a,s;return((r=(n=e.strategies)==null?void 0:n.data)==null?void 0:r.length)>0&&!((s=(a=e.strategies)==null?void 0:a.data)!=null&&s.find(c=>Je.includes(c.name)))},ba=E("div")({display:"flex",justifyContent:"space-between",width:"100%"}),va=E("hgroup")(({theme:e})=>({display:"inline-flex",alignItems:"center",gap:e.spacing(1.5)})),ja=E("h3")(({theme:e})=>({fontWeight:"bold",fontSize:e.typography.subtitle1.fontSize,margin:0})),Ca=({feature:e,input:n,onClose:r})=>{var o;const a=N(),[s,c,d]=e.isEnabled?[`This feature flag is True in ${n==null?void 0:n.environment} because `,"at least one strategy is True",a.palette.success.contrastText]:e.hasUnsatisfiedDependency&&!e.isEnabledInCurrentEnvironment?[`This feature flag is False in ${n==null?void 0:n.environment} because `,"parent dependency is not satisfied and the environment is disabled",a.palette.error.contrastText]:e.isEnabledInCurrentEnvironment?ya(e)?[`This feature flag is Unknown in ${n==null?void 0:n.environment} because `,"no strategies could be fully evaluated",a.palette.warning.contrastText]:ze(e)?[`This feature flag is Unknown in ${n==null?void 0:n.environment} because `,"not all strategies could be fully evaluated",a.palette.warning.contrastText]:e.hasUnsatisfiedDependency?[`This feature flag is False in ${n==null?void 0:n.environment} because `,"parent dependency is not satisfied",a.palette.error.contrastText]:[`This feature flag is False in ${n==null?void 0:n.environment} because `,"all strategies are either False or could not be fully evaluated",a.palette.error.contrastText]:[`This feature flag is False in ${n==null?void 0:n.environment} because `,"the environment is disabled",a.palette.error.contrastText],l=ft(n==null?void 0:n.context)?"You did not provide a value for your context field in step 2 of the configuration":void 0,u=ze(e)?"This feature uses custom strategies. Custom strategies can't be evaluated, so they will be marked accordingly.":void 0,f=r&&(p=>{p.stopPropagation(),r()});return t.jsxs(t.Fragment,{children:[t.jsxs(ba,{children:[t.jsxs(va,{children:[t.jsx(ja,{children:e.name}),t.jsx("p",{children:((o=e==null?void 0:e.strategies)==null?void 0:o.result)!=="unknown"?t.jsx(K,{enabled:e.isEnabled,label:e.isEnabled?"True":"False"}):t.jsx(K,{enabled:"unknown",label:"Unknown",showIcon:!1})})]}),t.jsx(G,{"aria-label":"Close",onClick:f,children:t.jsx(Yt,{})})]}),t.jsxs("p",{children:[s,t.jsx($,{color:d,component:"span",children:c}),"."]}),l?t.jsx(Q,{color:"info",children:l}):null,u?t.jsx(Q,{severity:"warning",color:"info",children:u}):null]})},pt=E("div",{shouldForwardProp:e=>e!=="variant"})(({theme:e,variant:n})=>({"--font-size":e.typography.body2.fontSize,display:"flex",alignItems:"center",gap:e.spacing(1),padding:e.spacing(.5,.25),color:n==="ok"?e.palette.success.dark:e.palette.error.dark,fontSize:"var(--font-size)",svg:{fontSize:"calc(var(--font-size) * 1.25)"}})),Sa=()=>t.jsxs(pt,{variant:"ok",children:[t.jsx(Qt,{"aria-hidden":"true"}),t.jsx("p",{children:"Constraint met by value in context"})]}),ka=({text:e})=>t.jsxs(pt,{variant:"error",children:[t.jsx(Xt,{"aria-hidden":"true"}),t.jsx("p",{children:e})]}),mt=({constraint:e,input:n})=>{if(!e)return null;const r=()=>{const a=n==null?void 0:n.context[e.contextName];return a?`Constraint not met – the value in the context: { ${a} } is not ${e.operator} ${e.contextName}`:`Constraint not met – no value was specified for ${e.contextName}`};return t.jsx(pe,{children:t.jsxs("div",{children:[t.jsx(Zt,{...e}),e.result?t.jsx(Sa,{}):t.jsx(ka,{text:r()})]})})},wa=E(k)(({theme:e})=>({width:"auto",height:"auto",padding:e.spacing(2,3),borderRadius:e.shape.borderRadiusMedium,border:`1px solid ${e.palette.divider}`})),Ea=({segment:e,input:n})=>{const r=e.constraints.length>0?t.jsx(Ye,{children:e.constraints.map(a=>t.jsx(mt,{constraint:a,input:n},re(a)))}):void 0;return t.jsx(en,{segment:e,constraintList:r,isExpanded:!0})},Ta=({strategyResult:e,input:n})=>{const{name:r,constraints:a,segments:s,parameters:c}=e,d=tn(e),{strategies:l}=nn(),{isCustomStrategy:u,customStrategyParameters:f}=rn(e,l),o=!!(s&&s.length>0),p=!!(a&&(a==null?void 0:a.length)>0),h=r!=="default"&&Object.keys(an).includes(r);if(!c)return null;const b=[...o?s.map(v=>t.jsx(Ea,{segment:v,input:n},re(v))):[],...p?a.map(v=>t.jsx(mt,{constraint:v,input:n},re(v))):[],h&&d.map((v,R)=>t.jsx(pe,{children:v},R)),u&&f.map((v,R)=>t.jsx(pe,{children:v},R)),r==="default"&&t.jsxs(wa,{sx:{width:"100%"},children:["The standard strategy is ",t.jsx(Ke,{color:"success",children:"ON"})," for all users."]},"default-on")].filter(Boolean),{variant:T,variants:I}=e.result;return t.jsxs(t.Fragment,{children:[t.jsx(Ye,{children:b}),I!=null&&I.length?t.jsx(sn,{variants:I,selected:T==null?void 0:T.name}):null]})},Ia=({strategy:e,input:n,className:r})=>{const{result:a}=e,s=a.evaluationStatus==="incomplete"||a.evaluationStatus==="unevaluated"?"Not evaluated":a.enabled?"True":"False";return t.jsx(on,{strategy:{...e,id:`${re(e)}`},strategyHeaderLevel:4,className:r,headerItemsLeft:e.disabled?null:t.jsx(K,{showIcon:!1,enabled:a.enabled,label:s}),children:t.jsx(Ta,{strategyResult:e,input:n})})},Pa=E("hgroup")(({theme:e})=>({paddingBottom:e.spacing(2)})),Ra=E("h4")(({theme:e})=>({fontWeight:"normal",fontSize:e.typography.body1.fontSize,margin:0})),Oa=E("p")(({theme:e})=>({fontWeight:"bold",fontSize:e.typography.body2.fontSize})),Ba=E(ln)(({theme:e})=>({marginInline:"calc(var(--popover-inline-padding) * -1)",borderTop:`1px solid ${e.palette.divider}`,"> li:last-of-type":{paddingBottom:0}})),Me=({strategies:e,input:n,titlePrefix:r,infoText:a})=>e.length===0?null:t.jsxs("div",{children:[t.jsxs(Pa,{children:[t.jsx(Ra,{children:`${r?r.concat(" strategies"):"Strategies"} (${e==null?void 0:e.length})`}),a?t.jsx(Oa,{children:a}):null]}),t.jsx(Ba,{children:e==null?void 0:e.map((s,c)=>t.jsxs(cn,{children:[c>0?t.jsx(dn,{}):"",t.jsx(Ia,{strategy:s,input:n})]},s.id))})]}),Fa=({feature:e})=>{var r,a;if(!((r=e==null?void 0:e.strategies)!=null&&r.data))return null;let n;if(e.hasUnsatisfiedDependency&&!e.isEnabledInCurrentEnvironment)n="If the environment was enabled and parent dependencies were satisfied";else if(e.hasUnsatisfiedDependency)n="If parent dependencies were satisfied";else if(!e.isEnabledInCurrentEnvironment)n="If the environment was enabled";else return;return t.jsxs(Q,{severity:"info",color:"info",children:[n,", then this feature flag would be"," ",(a=e.strategies)!=null&&a.result?"TRUE":"FALSE"," with strategies evaluated like this:"]})},La=({feature:e,input:n})=>{var c,d,l,u,f;const r=(d=(c=e.strategies)==null?void 0:c.data)==null?void 0:d.filter(o=>!o.disabled),a=(u=(l=e.strategies)==null?void 0:l.data)==null?void 0:u.filter(o=>o.disabled),s=(a==null?void 0:a.length)>0;return(((f=e==null?void 0:e.strategies)==null?void 0:f.data.length)??0)===0?t.jsx(Q,{severity:"info",children:"There are no strategies added to this feature flag in the selected environment."}):t.jsxs(t.Fragment,{children:[t.jsx(Fa,{feature:e}),t.jsx(Me,{strategies:r||[],input:n,titlePrefix:s?"Enabled":void 0}),s?t.jsx(Me,{strategies:a,input:n,titlePrefix:"Disabled",infoText:"Disabled strategies are not evaluated for the overall result."}):null]})},Na=E("div")(({theme:e})=>({alignItems:"flex-end",color:e.palette.divider})),Aa=({feature:e,input:n})=>{const[r,a]=g.useState(!1),s=g.useRef(null),c=()=>{a(!r)};return t.jsxs(Na,{children:[t.jsx(G,{onClick:c,children:t.jsx(oe,{ref:s})}),t.jsxs(X,{open:r,onClose:()=>a(!1),anchorEl:s.current,PaperProps:{sx:d=>({"--popover-inline-padding":d.spacing(4),paddingInline:"var(--popover-inline-padding)",paddingBlock:d.spacing(3),display:"flex",flexDirection:"column",width:728,maxWidth:"100%",height:"auto",gap:d.spacing(3),overflowY:"auto",backgroundColor:d.palette.background.elevation1,borderRadius:d.shape.borderRadius})},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:[t.jsx(Ca,{feature:e,input:n,onClose:()=>a(!1)}),t.jsx(La,{feature:e,input:n})]})]})},xt=e=>e.feature?t.jsx(Aa,{...e}):null;var ke={},$a=qe;Object.defineProperty(ke,"__esModule",{value:!0});var yt=ke.default=void 0,Da=$a(Ve()),Wa=t,Ha=(0,Da.default)((0,Wa.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined");yt=ke.default=Ha;const za=E("div")(({theme:e})=>({padding:e.spacing(4),maxWidth:"400px"})),fe=E($)(({theme:e})=>({marginBottom:e.spacing(2)})),Ma=E(yt)(({theme:e})=>({color:e.palette.success.main})),Ua=({variants:e,selectedVariant:n})=>{const r=N(),a=g.useMemo(()=>e.map(o=>({name:o.name,weight:`${un(o.weight)}%`,selected:o.name===n})),[e,n]),s=g.useMemo(()=>({sortBy:[{id:"name",desc:!1}]}),[]),{getTableProps:c,getTableBodyProps:d,headerGroups:l,rows:u,prepareRow:f}=B.useTable({initialState:s,columns:Ga,data:a,sortTypes:ie,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},B.useGlobalFilter,B.useSortBy);return t.jsxs(za,{children:[t.jsx(fe,{variant:"subtitle2",children:"Variant Information"}),t.jsx(fe,{variant:"body2",children:"The following table shows the variants defined on this feature toggle and the variant result based on your context configuration."}),t.jsx(fe,{variant:"body2",children:'If you include "userId" or "sessionId" in your context, the variant will be the same every time because unleash uses these properties to ensure that the user receives the same experience.'}),t.jsxs(hn,{...c(),rowHeight:"dense",children:[t.jsx(gn,{headerGroups:l}),t.jsx(fn,{...d(),children:u.map(o=>{const p={};o.original.selected||(p.color=r.palette.text.secondary),f(o);const{key:h,...b}=o.getRowProps();return t.jsx(pn,{hover:!0,...b,children:o.cells.map(T=>{const{key:I,...v}=T.getCellProps();return t.jsx(mn,{...v,style:p,children:T.render("Cell")},I)})},h)})})]})]})},Ga=[{id:"Icon",Cell:({row:{original:{selected:e}}})=>t.jsx(t.Fragment,{children:t.jsx(L,{condition:e,show:t.jsx(xn,{icon:t.jsx(Ma,{})})})}),maxWidth:25,disableGlobalFilter:!0},{Header:"Name",accessor:"name",searchable:!0,Cell:({row:{original:{name:e}}})=>t.jsx(Re,{children:e}),maxWidth:175,width:175},{Header:"Weight",accessor:"weight",sortType:"alphanumeric",searchable:!0,maxWidth:75,Cell:({row:{original:{weight:e}}})=>t.jsx(Re,{children:e})}],_a=E("div")(()=>({maxWidth:"100%",display:"flex",alignItems:"center",wordBreak:"break-all"})),Va=({variant:e,variants:n,feature:r,isEnabled:a})=>{const s=N(),[c,d]=g.useState(null),l=o=>d(o.currentTarget),u=()=>d(null),f=!!c;return t.jsxs(_a,{children:[e,t.jsx(L,{condition:!!n&&n.length>0&&a,show:t.jsxs(t.Fragment,{children:[t.jsx(G,{onClick:l,children:t.jsx(oe,{})}),t.jsx(X,{open:f,id:`${r}-result-variants`,PaperProps:{sx:{borderRadius:`${s.shape.borderRadiusLarge}px`}},onClose:u,anchorEl:c,anchorOrigin:{vertical:"bottom",horizontal:-320},children:t.jsx(Ua,{variants:n,selectedVariant:e})})]})})]})},qa=({features:e})=>{const n=N(),r=Ze(n.breakpoints.down("sm")),a=Object.keys(e[0].context).map(o=>({Header:ye(o),accessor:p=>p.context[o],minWidth:160,Cell:be})),s=g.useMemo(()=>[...a,{Header:"Variant",id:"variant",accessor:"variant.name",sortType:"alphanumeric",filterName:"variant",maxWidth:200,Cell:({value:o,row:{original:{variant:p,feature:h,variants:b,isEnabled:T}}})=>t.jsx(Va,{variant:p!=null&&p.enabled?o:"",variants:b,feature:h,isEnabled:T})},{id:"isEnabled",Header:"isEnabled",filterName:"isEnabled",accessor:o=>{var p;return o!=null&&o.isEnabled?"true":((p=o==null?void 0:o.strategies)==null?void 0:p.result)==="unknown"?"unknown":"false"},Cell:({row:o})=>t.jsx(gt,{feature:o.original}),sortType:"playgroundResultState",maxWidth:120,sortInverted:!0},{Header:"",maxWidth:70,id:"info",Cell:({row:o})=>t.jsx(xt,{feature:o.original,input:{environment:o.original.environment,context:o.original.context}})}],[]),{headerGroups:c,rows:d,prepareRow:l,setHiddenColumns:u}=B.useTable({columns:s,data:e,sortTypes:ie,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},B.useGlobalFilter,B.useFlexLayout,B.useSortBy);Qe([{condition:r,columns:["variant"]}],u,s);const f=g.useRef(null);return t.jsx(k,{ref:f,sx:{overflow:"auto",maxHeight:"800px"},children:t.jsx(ve,{parentRef:f,rows:d,headerGroups:c,prepareRow:l})})},Ka=E("div",{})(({theme:e})=>({flexGrow:0,...Xe,justifyContent:"flex-start",margin:e.spacing(0,1.5)})),Ja=E(k)(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing(1)})),Ya=({value:e})=>{const n=N(),[r,a]=g.useState(null),s=f=>a(f.currentTarget),c=()=>a(null),d=!!r,l=(e||[]).filter(f=>f.isEnabled),u=(e||[]).filter(f=>!f.isEnabled);return t.jsxs(Ka,{children:[t.jsxs(Ja,{children:[t.jsx(L,{condition:l.length>0,show:t.jsx(K,{enabled:!0,label:`${l.length}`,showIcon:!0})}),t.jsx(L,{condition:u.length>0,show:t.jsx(K,{enabled:!1,label:`${u.length}`,showIcon:!0})})]}),t.jsxs(t.Fragment,{children:[t.jsx(G,{onClick:s,children:t.jsx(oe,{})}),t.jsxs(X,{open:d,id:`${e}-result-details`,PaperProps:{sx:{borderRadius:`${n.shape.borderRadiusLarge}px`,padding:n.spacing(3)}},onClose:c,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:-320},children:[t.jsx($,{variant:"subtitle2",sx:{mb:3},children:e[0].environment}),t.jsx(qa,{features:e})]})]})]})},Za=({features:e})=>{const n=Object.keys(e),r=e[n[0]],a=r[0].context,s=g.useMemo(()=>r.map((h,b)=>({...Object.fromEntries(n.map(T=>[T,e[T][b]]))})),[JSON.stringify(e)]),c=Object.keys(a).map(h=>({Header:ye(h),accessor:b=>b[n[0]].context[h],minWidth:160,Cell:be})),d=n.map(h=>({Header:h,accessor:b=>{var T,I,v;return(T=b[h])!=null&&T.isEnabled?"true":((v=(I=b[h])==null?void 0:I.strategies)==null?void 0:v.result)==="unknown"?"unknown":"false"},Cell:({row:b})=>t.jsxs(k,{sx:{display:"flex"},children:[t.jsx(gt,{feature:b.original[h]}),t.jsx(xt,{feature:b.original[h],input:{environment:b.original[h].environment,context:b.original[h].context}})]}),sortType:"playgroundResultState",maxWidth:140})),l=g.useMemo(()=>[...c,...d],[]),{headerGroups:u,rows:f,prepareRow:o}=B.useTable({columns:l,data:s,sortTypes:ie,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},B.useGlobalFilter,B.useFlexLayout,B.useSortBy),p=g.useRef(null);return t.jsx(k,{ref:p,sx:{overflow:"auto",maxHeight:"800px"},children:t.jsx(ve,{parentRef:p,rows:f,headerGroups:u,prepareRow:o})})},Qa=E("div",{})(({theme:e})=>({flexGrow:0,...Xe,justifyContent:"flex-start",margin:e.spacing(0,1.5)})),Xa=E(se)(({theme:e})=>({textAlign:"left",textDecorationStyle:"dotted",textDecorationLine:"underline",textUnderlineOffset:e.spacing(.75),color:e.palette.neutral.dark,padding:0,fontWeight:"normal"})),es=({value:e})=>{const n=N(),[r,a]=g.useState(null),s=l=>a(l.currentTarget),c=()=>a(null),d=!!r;return t.jsx(Qa,{children:t.jsxs(t.Fragment,{children:[t.jsx(Xa,{variant:"text",onClick:s,children:"View diff"}),t.jsxs(X,{open:d,id:`${e}-result-details`,PaperProps:{sx:{borderRadius:`${n.shape.borderRadiusLarge}px`,padding:n.spacing(3)}},onClose:c,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:-320},children:[t.jsx($,{variant:"subtitle2",sx:{mb:3},children:"Environments diff"}),t.jsx(Za,{features:e})]})]})})},ts=e=>e.reduce((n,r)=>n+Object.values(r.environments).flatMap(a=>Object.keys(a)).length,0),ns=e=>e<0?"invalid bucket":e>=2e4?"20000+":e>=1e4?"10000-20000":e>=1e3?"1000-10000":e>=100?"100-1000":"0-100",rs={id:"name"},{value:Ue,setValue:as}=et("AdvancedPlaygroundResultsTable:v1",rs),ss=({features:e,input:n,loading:r})=>{const{trackEvent:a}=tt();e&&a("playground",{props:{eventType:"number-of-combinations",count:ns(ts(e))}});const[s,c]=nt(),d=yn(r),[l,u]=g.useState(s.get("search")||""),f=N(),o=Ze(f.breakpoints.down("md")),p=e&&e.length>0?Object.keys(e[0].environments).length:0,h=g.useMemo(()=>{var x;return[{Header:"Name",accessor:"name",searchable:!0,minWidth:160,Cell:({value:j,row:{original:C}})=>t.jsx(Oe,{title:j,to:`/projects/${C==null?void 0:C.projectId}/features/${j}`})},{Header:"Project ID",accessor:"projectId",sortType:"alphanumeric",filterName:"projectId",searchable:!0,minWidth:150,Cell:({value:j})=>t.jsx(Oe,{title:j,to:`/projects/${j}`})},...((x=n==null?void 0:n.environments)==null?void 0:x.map(j=>({Header:r?()=>"":ye(j),maxWidth:150,id:`environments.${j}`,align:"flex-start",Cell:({row:C})=>t.jsx(Ya,{value:C.original.environments[j]})})))||[],...p>1?[{Header:"Diff",minWidth:150,id:"diff",align:"left",Cell:({row:j})=>t.jsx(es,{value:j.original.environments})}]:[]]},[n]),{data:b,getSearchText:T,getSearchContext:I}=bn(h,l,e||[]),v=g.useMemo(()=>r?Array(5).fill({name:"Feature name",projectId:"Feature Project",environments:{name:"Feature Environments",variants:[]},enabled:!0}):b,[b,r]),[R]=g.useState(()=>({sortBy:[{id:s.get("sort")||Ue.id,desc:s.has("order")?s.get("order")==="desc":Ue.desc}]})),{headerGroups:P,rows:F,state:{sortBy:y},prepareRow:m,setHiddenColumns:w}=B.useTable({initialState:R,columns:h,data:v,sortTypes:ie,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0,defaultColumn:{Cell:be}},B.useGlobalFilter,B.useFlexLayout,B.useSortBy);return Qe([{condition:o,columns:["projectId"]}],w,h),g.useEffect(()=>{if(r)return;const x=Object.fromEntries(s);x.sort=y[0].id,y[0].desc?x.order="desc":x.order&&delete x.order,l?x.search=l:delete x.search,c(x,{replace:!0}),as({id:y[0].id,desc:y[0].desc||!1})},[r,y,l]),t.jsxs(t.Fragment,{children:[t.jsxs(k,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[t.jsx($,{variant:"subtitle1",sx:{ml:1},children:e!==void 0&&!r?`Results (${F.length<v.length?`${F.length} of ${v.length}`:v.length})`:"Results"}),t.jsx(vn,{initialValue:l,onChange:u,hasFilters:!0,getSearchContext:I,disabled:r,containerStyles:{marginLeft:"1rem",maxWidth:"400px"}})]}),t.jsx(L,{condition:!r&&!v,show:()=>t.jsx(de,{children:v===void 0?"None of the feature flags were evaluated yet.":"No results found."}),elseShow:()=>t.jsxs(k,{ref:d,sx:{overflow:"auto"},children:[t.jsx(jn,{value:T(l),children:t.jsx(ve,{rows:F,headerGroups:P,prepareRow:m})}),t.jsx(L,{condition:v.length===0&&(l==null?void 0:l.length)>0,show:t.jsxs(de,{children:["No feature flags found matching “",l,"”"]})}),t.jsx(L,{condition:v&&v.length===0&&!l,show:t.jsx(de,{children:"No features flags to display"})})]})})]})},bt=E(Q)(({theme:e})=>({marginBottom:e.spacing(3)})),os=({response:e})=>{var r;const n=(r=e==null?void 0:e.warnings)==null?void 0:r.invalidContextProperties;if(n&&n.length>0){n.sort();const a="Some context properties were not taken into account during evaluation",s=E("details")(({theme:c})=>({"* + *":{marginBlockStart:c.spacing(1)}}));return t.jsx(bt,{severity:"warning",children:t.jsxs(s,{children:[t.jsx("summary",{children:a}),t.jsx("p",{children:"The context you provided for this query contained top-level properties with invalid values. These properties were not taken into consideration when evaluating your query. The properties are:"}),t.jsx("ul",{children:n.map(c=>t.jsx("li",{"data-testid":"context-warning-list-element",children:t.jsx("code",{children:c})},c))}),t.jsxs("p",{children:["Remember that context fields (with the exception of the"," ",t.jsx("code",{children:"properties"})," object) must be strings."]}),t.jsx("p",{children:"Because we didn't take these properties into account during the feature flag evaluation, they will not appear in the results table."})]})})}else return null},ds=({FormComponent:e=aa})=>{const n={projects:[],environments:[]},{value:r,setValue:a}=et("AdvancedPlayground:v1",n),{trackEvent:s}=tt(),{environments:c}=Cn(),d=N(),l=!0,[u,f]=g.useState(),[o,p]=g.useState(r.environments),[h,b]=g.useState(r.projects),[T,I]=g.useState(r.token),[v,R]=g.useState(r.context),[P,F]=g.useState(),{setToastData:y}=Ge(),[m,w]=nt(),[x,j]=g.useState(),{evaluateAdvancedPlayground:C,evaluateChangeRequestPlayground:A,loading:D,errors:z}=cr(),[J,V]=g.useState(!1);g.useEffect(()=>{(o==null?void 0:o.length)===0&&c.length>0&&p([Vr(c)])},[JSON.stringify(o),JSON.stringify(c)]),g.useEffect(()=>{Y()},[]);const Y=async()=>{try{const S=W(),H=O(),ee=_();q(),le(),S&&ee&&await we(S||[],H||"*",ee)}catch(S){y({type:"error",text:`Failed to parse URL parameters: ${Z(S)}`})}},W=()=>{let S=null;const H=m.get("environments");return H&&(S=H.split(","),p(S)),S},O=()=>{let S=null;const H=m.get("projects");return H&&(S=H.split(","),b(S)),S},_=()=>{let S=m.get("context");return S&&(S=decodeURI(S),R(S)),S},q=()=>{let S=m.get("token");return S&&(S=decodeURI(S),I(S)),S},le=()=>{const S=m.get("changeRequest");S&&j(S)},we=async(S,H,ee,ce)=>{try{f(void 0);const M={appName:"playground",...JSON.parse(ee||"{}")},Et=x?await A(x,{context:M}):await C({environments:_r(S),projects:Gr(H),context:M});ce&&typeof ce=="function"&&ce(),F(Et)}catch(M){M instanceof Sn?f(M.message):M instanceof SyntaxError?y({type:"error",text:`Error parsing context: ${Z(M)}`}):y({type:"error",text:Z(M)})}},vt=()=>{let S="default";T&&T!==""?S="api_token":x&&(S="change_request"),s("playground",{props:{eventType:"try-configuration",mode:S}})},jt=async S=>{S.preventDefault(),V(!0),vt(),await we(o,h,v,()=>{St(),x||a({environments:o,projects:h,context:v})})},Ct=()=>{j(void 0)},St=()=>{m.set("context",encodeURI(v||"")),Array.isArray(o)&&o.length>0&&!(o.length===1&&o[0]==="*")?m.set("environments",o.join(",")):m.delete("projects"),Array.isArray(h)&&h.length>0&&!(h.length===1&&h[0]==="*")?m.set("projects",h.join(",")):m.delete("projects"),x?m.set("changeRequest",x):m.delete("changeRequest"),w(m)},kt=P&&!l?"35%":"auto",wt=Kr();return t.jsx(kn,{header:t.jsx(wn,{title:"Unleash playground",actions:t.jsx(ha,{})}),disableLoading:!0,bodyClass:"no-padding",children:t.jsxs(k,{sx:{display:"flex",flexDirection:"column"},children:[t.jsx(k,{sx:{background:d.palette.background.elevation2,borderBottomLeftRadius:d.shape.borderRadiusMedium,isolation:"isolate",zIndex:2},children:t.jsx(En,{elevation:0,sx:{px:4,py:3,background:d.palette.background.elevation2,transition:"width 0.4s ease",minWidth:"auto",width:kt,position:"sticky",top:0},children:t.jsx(e,{onSubmit:jt,context:v,setContext:R,availableEnvironments:c,projects:h,environments:o,token:T,setToken:I,setProjects:b,setEnvironments:p,changeRequest:x||void 0,onClearChangeRequest:Ct})})}),t.jsxs(k,{sx:S=>({width:wt,transition:"width 0.4s ease",padding:S.spacing(4,4),isolation:"isolate",zIndex:1}),children:[t.jsx(L,{condition:!!u,show:t.jsx(bt,{severity:"warning",children:u})}),t.jsx(L,{condition:D,show:t.jsx(Tn,{}),elseShow:t.jsxs(t.Fragment,{children:[t.jsx(L,{condition:!!P&&Object.values(z).length===0,show:t.jsxs(t.Fragment,{children:[t.jsx(os,{response:P}),t.jsx(ss,{loading:D,features:P==null?void 0:P.features,input:P==null?void 0:P.input})]})}),t.jsx(L,{condition:!P&&!J,show:t.jsx(ut,{})})]})})]})]})})};export{ds as AdvancedPlayground,ds as default};
@@ -1 +1 @@
1
- import{s as l,B as n,cT as c,bc as d,j as e,C as p,V as a,T as h,y as g,hA as u,j4 as x,iZ as j,i_ as m,i$ as y,j0 as C,j1 as S,j2 as f,j3 as B}from"./index-7Xiv8xBJ.js";import{u as T,b,S as v,T as P,P as w,c as D,g as _}from"./useChartDataSelection-CJ_ODQpO.js";import{a as k}from"./formatTickValue-CnEuS4gg.js";import"./LazyAdminExport-WZgqtZjz.js";import"./RoleCell-ycKPyNvK.js";import"./useApiTokens-D7Sffu1E.js";const q=l(n)(({theme:s})=>({display:"flex",alignItems:"center",gap:s.spacing(.5)})),H=()=>{c("Network - Backend Connections");const{isOss:s}=d(),{chartDataSelection:t,setChartDataSelection:i,options:o}=T(),{chartData:r}=b(t);return e.jsx(p,{condition:s(),show:e.jsx(a,{severity:"warning",children:"Not enabled."}),elseShow:e.jsx(e.Fragment,{children:e.jsxs(v,{children:[e.jsxs(P,{children:[e.jsx(n,{children:e.jsx(a,{severity:"info",icon:!1,children:e.jsxs(q,{children:[e.jsx(h,{children:"1 connection = 7200 backend SDK requests per day"}),e.jsx(g,{title:"1 connection involves polling every 15 seconds and sending metrics every 60 seconds. This translates to 5 requests per minute, 300 requests per hour, and 7200 requests per day.",children:e.jsx(u,{})})]})})}),e.jsx(w,{selectedPeriod:t,setPeriod:i})]}),e.jsx(x,{data:r,plugins:[D()],options:o,"aria-label":_(t)})]})})})};j.register(k,m,y,C,S,f,B);export{H as BackendConnections,H as default};
1
+ import{s as l,B as n,cT as c,bc as d,j as e,C as p,V as a,T as h,y as g,hA as u,j4 as x,iZ as j,i_ as m,i$ as y,j0 as C,j1 as S,j2 as f,j3 as B}from"./index-CBxzHo9v.js";import{u as T,b,S as v,T as P,P as w,c as D,g as _}from"./useChartDataSelection-oJZtWCYi.js";import{a as k}from"./formatTickValue-UVMjaxYs.js";import"./LazyAdminExport-B8NZvb6Q.js";import"./RoleCell-C2bUEPUX.js";import"./useApiTokens-CUb6SDEP.js";const q=l(n)(({theme:s})=>({display:"flex",alignItems:"center",gap:s.spacing(.5)})),H=()=>{c("Network - Backend Connections");const{isOss:s}=d(),{chartDataSelection:t,setChartDataSelection:i,options:o}=T(),{chartData:r}=b(t);return e.jsx(p,{condition:s(),show:e.jsx(a,{severity:"warning",children:"Not enabled."}),elseShow:e.jsx(e.Fragment,{children:e.jsxs(v,{children:[e.jsxs(P,{children:[e.jsx(n,{children:e.jsx(a,{severity:"info",icon:!1,children:e.jsxs(q,{children:[e.jsx(h,{children:"1 connection = 7200 backend SDK requests per day"}),e.jsx(g,{title:"1 connection involves polling every 15 seconds and sending metrics every 60 seconds. This translates to 5 requests per minute, 300 requests per hour, and 7200 requests per day.",children:e.jsx(u,{})})]})})}),e.jsx(w,{selectedPeriod:t,setPeriod:i})]}),e.jsx(x,{data:r,plugins:[D()],options:o,"aria-label":_(t)})]})})})};j.register(k,m,y,C,S,f,B);export{H as BackendConnections,H as default};
@@ -1 +1 @@
1
- import{j as e,e0 as t}from"./index-7Xiv8xBJ.js";const a=()=>e.jsx(t,{to:"/projects?create=true",replace:!0});export{a as default};
1
+ import{j as e,e0 as t}from"./index-CBxzHo9v.js";const a=()=>e.jsx(t,{to:"/projects?create=true",replace:!0});export{a as default};
@@ -1,2 +1,2 @@
1
- import{ja as c,dc as m,iX as u,bv as x,b as g,bs as f,r as d,j as b,jm as C,iZ as j,i_ as v,i$ as M,jg as S,jn as q,jj as $,j3 as D,j2 as E,j1 as T}from"./index-7Xiv8xBJ.js";import{d as L}from"./FeatureViewLazyExport-DaVKFqvO.js";import"./MarkCompletedDialogue-B5yr7GS5.js";import"./aggregateFeatureMetrics-D6Ts8R60.js";import"./FeatureStaleDialog-B4kuZsir.js";const h=(e,l,s)=>{const a={label:"Total requests",borderColor:e.palette.primary.main,backgroundColor:e.palette.primary.main,data:p(l,s,o=>o.yes+o.no),elements:{point:{radius:6,pointStyle:"circle"},line:{borderDash:[8,4]}}},t={label:"Exposed",borderColor:e.palette.success.main,backgroundColor:e.palette.success.main,data:p(l,s,o=>o.yes),elements:{point:{radius:6,pointStyle:"triangle"}}},r={label:"Not exposed",borderColor:e.palette.error.main,backgroundColor:e.palette.error.main,data:p(l,s,o=>o.no),elements:{point:{radius:6,pointStyle:"triangle",pointRotation:180}}};return{datasets:[t,r,a]}},p=(e,l,s)=>e.map(a=>({x:a.timestamp,y:s(a),variants:a.variants||{}})),k=(e,l)=>{if(l===0)return"";const[s,a]=e,t=Math.floor(Number(a)/l*100);return`${a} (${t}%) - ${s}`},O=(e,l,s,a)=>({locale:a.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},color:e.palette.text.secondary,plugins:{tooltip:{backgroundColor:e.palette.background.paper,bodyColor:e.palette.text.primary,titleColor:e.palette.text.secondary,borderColor:e.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,itemSort:(t,r)=>{const o=["Total requests","Exposed","Not exposed"],n=o.indexOf(t.dataset.label),i=o.indexOf(r.dataset.label);return n-i},callbacks:{label:t=>`${t.formattedValue} - ${t.dataset.label}`,afterLabel:t=>{const r=t.dataset.data[t.dataIndex];if(t.dataset.label!=="Exposed"||r.variants===void 0)return"";const{disabled:o,...n}=r.variants;return Object.entries(n).map(i=>k(i,r.y)).join(`
1
+ import{ja as c,dc as m,iX as u,bv as x,b as g,bs as f,r as d,j as b,jm as C,iZ as j,i_ as v,i$ as M,jg as S,jn as q,jj as $,j3 as D,j2 as E,j1 as T}from"./index-CBxzHo9v.js";import{d as L}from"./FeatureViewLazyExport-3Y6uMkoC.js";import"./MarkCompletedDialogue-BxpNwvZk.js";import"./aggregateFeatureMetrics-B9YGjDrl.js";import"./FeatureStaleDialog-DOiJpKNC.js";const h=(e,l,s)=>{const a={label:"Total requests",borderColor:e.palette.primary.main,backgroundColor:e.palette.primary.main,data:p(l,s,o=>o.yes+o.no),elements:{point:{radius:6,pointStyle:"circle"},line:{borderDash:[8,4]}}},t={label:"Exposed",borderColor:e.palette.success.main,backgroundColor:e.palette.success.main,data:p(l,s,o=>o.yes),elements:{point:{radius:6,pointStyle:"triangle"}}},r={label:"Not exposed",borderColor:e.palette.error.main,backgroundColor:e.palette.error.main,data:p(l,s,o=>o.no),elements:{point:{radius:6,pointStyle:"triangle",pointRotation:180}}};return{datasets:[t,r,a]}},p=(e,l,s)=>e.map(a=>({x:a.timestamp,y:s(a),variants:a.variants||{}})),k=(e,l)=>{if(l===0)return"";const[s,a]=e,t=Math.floor(Number(a)/l*100);return`${a} (${t}%) - ${s}`},O=(e,l,s,a)=>({locale:a.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},color:e.palette.text.secondary,plugins:{tooltip:{backgroundColor:e.palette.background.paper,bodyColor:e.palette.text.primary,titleColor:e.palette.text.secondary,borderColor:e.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,itemSort:(t,r)=>{const o=["Total requests","Exposed","Not exposed"],n=o.indexOf(t.dataset.label),i=o.indexOf(r.dataset.label);return n-i},callbacks:{label:t=>`${t.formattedValue} - ${t.dataset.label}`,afterLabel:t=>{const r=t.dataset.data[t.dataIndex];if(t.dataset.label!=="Exposed"||r.variants===void 0)return"";const{disabled:o,...n}=r.variants;return Object.entries(n).map(i=>k(i,r.y)).join(`
2
2
  `)},title:t=>`Time: ${s>48?m(t[0].parsed.x,a.locale,"UTC"):u(t[0].parsed.x,a.locale)}`}},legend:{position:"top",align:"end",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0}},title:{text:P(s),position:"top",align:"start",display:!0,font:{size:16,weight:"400"},color:e.palette.text.primary}},scales:{y:{type:"linear",title:{display:!0,text:"Number of requests",color:e.palette.text.secondary},suggestedMin:0,ticks:{precision:0,color:e.palette.text.secondary},grid:{color:e.palette.divider,borderColor:e.palette.divider}},x:{type:"time",time:{unit:s>48?"day":"hour"},grid:{display:!1},ticks:{callback:(t,r,o)=>s>48?x(o[r].value,a.locale,"UTC"):u(o[r].value,a.locale),color:e.palette.text.secondary}}}}),P=e=>e===1?"Requests in the last hour":`Requests in the last ${L(e)}`;c.font={...c.font,family:"Sen",size:13,weight:"400"};const I=({metrics:e,hoursBack:l,statsSectionId:s})=>{const a=g(),{locationSettings:t}=f(),r=d.useMemo(()=>[...e].sort((i,y)=>i.timestamp.localeCompare(y.timestamp)),[e]),o=d.useMemo(()=>O(a,r,l,t),[a,r,l,t]),n=d.useMemo(()=>h(a,r,t),[a,r,t]);return b.jsx("div",{style:{height:400},children:b.jsx(C,{options:o,data:n,"aria-label":"A feature metrics line chart, with three lines: all requests, positive requests, and negative requests.","aria-describedby":s})})};j.register(v,M,S,q,$,D,E,T);export{I as FeatureMetricsChart,I as default};
@@ -1,4 +1,4 @@
1
- import{G as re,H as oe,j as t,A as M,l as W,C as P,bh as ie,m as le,o as ce,ix as de,n as ue,s as j,b as J,T as C,u as pe,ba as ge,r as b,b9 as he,bb as me,bd as fe,as as Y,d2 as U,eB as xe,c0 as be,iy as ye,d0 as Se,d5 as z,b5 as B,iz as ve,d4 as Te,d3 as je,iA as Ee,cr as Ce,bE as K,bt as Q,bc as X,iB as Ae,iC as we,iD as Re,iE as ke,hL as Ie,hB as Z,iF as Pe,i as De,iG as Fe,dp as ee,aQ as q,bB as Oe,fL as Ve,e as _,bF as Be,bD as _e,bK as $e,b$ as qe,hO as Le,iH as Ne,h as V,eR as Ue,b8 as ze,dh as Ge,bp as He,aU as Me,aV as te,aY as L,V as We,d6 as Je,aR as Ye,bi as G,bf as ae,iI as Ke,iJ as Qe,B as Xe,aq as Ze,hz as et,iK as tt}from"./index-7Xiv8xBJ.js";var N={},at=oe;Object.defineProperty(N,"__esModule",{value:!0});var se=N.default=void 0,st=at(re()),nt=t,rt=(0,st.default)((0,nt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");se=N.default=rt;const ot=de(),Bt=({options:e,selectedOptions:r,indeterminateOptions:s,tagType:u,existingTags:o,disabled:i=!1,onChange:a})=>{const l=t.jsx(ue,{fontSize:"small"}),d=p=>p.inputValue?p.inputValue:p.title,m=({key:p,...g},n,{selected:h})=>{const S=(s==null?void 0:s.some(y=>y.title===n.title))??!1;return t.jsxs("li",{...g,children:[t.jsx(P,{condition:!!n.inputValue,show:t.jsx(ie,{sx:{mr:y=>y.spacing(.5)}}),elseShow:t.jsx(le,{icon:l,checkedIcon:t.jsx(ce,{fontSize:"small"}),indeterminateIcon:t.jsx(se,{fontSize:"small"}),sx:{mr:y=>y.spacing(.5)},checked:h&&!S,indeterminate:S})}),n.title]},p)},f=(p,g)=>{const n=g.inputValue.trim(),h=ot(p,{...g,inputValue:n}),S=p.some(y=>n===y.title);return n.length>=2&&!S&&h.push({inputValue:n,title:`Create new value "${n}"`}),h};return t.jsx(M,{multiple:!0,id:"checkboxes-tag",sx:{marginTop:p=>p.spacing(2),width:500},disableCloseOnSelect:!0,options:e,value:r,isOptionEqualToValue:(p,g)=>g.inputValue&&g.inputValue!==""?p.title===g.inputValue:p.title===g.title,getOptionLabel:d,renderOption:m,filterOptions:f,ListboxProps:{style:{maxHeight:200,overflow:"auto"}},onChange:a,renderInput:p=>t.jsx(W,{...p,label:"Select values",placeholder:"Select values"}),disabled:i})},it=j("li")({flexDirection:"column"}),_t=({options:e,value:r,disabled:s=!1,onChange:u})=>{const o=J();return t.jsx(M,{disablePortal:!0,disabled:s,id:"tag-type-select",sx:{marginTop:i=>i.spacing(2),width:500},options:e,disableClearable:!0,value:r,getOptionLabel:i=>i.name,renderOption:({key:i,...a},l)=>t.jsxs(it,{...a,style:{alignItems:"flex-start",gap:o.spacing(.5)},children:[t.jsx(C,{variant:"body1",children:l.name}),t.jsx(C,{variant:"caption",children:l.description})]},i),renderInput:i=>t.jsx(W,{...i,label:"Tag type",value:r}),onChange:u,ListboxProps:{style:{maxHeight:200,overflow:"auto"}}})},$t=()=>{const{makeRequest:e,createRequest:r,errors:s,loading:u}=pe({propagateErrors:!0});return{createTag:async a=>{const d=r("api/admin/tags",{method:"POST",body:JSON.stringify(a)});return e(d.caller,d.id)},bulkUpdateTags:async(a,l)=>{const d=`api/admin/projects/${l}/tags`,m=r(d,{method:"PUT",body:JSON.stringify(a)});return e(m.caller,m.id)},errors:s,loading:u}},qt=(e,r={})=>{const s=async()=>{const m=he(`api/admin/tags/${e}`);return(await fetch(m,{method:"GET"}).then(me("Tags"))).json()},u=`api/admin/tags/${e}`,{data:o,error:i}=ge(!!e,{tags:[]},u,s,r),[a,l]=b.useState(!i&&!o),d=()=>{fe(u)};return b.useEffect(()=>{l(!i&&!o)},[o,i]),{tags:(o==null?void 0:o.tags)||[],error:i,loading:a,refetch:d}},lt=j("div")({display:"flex",flexDirection:"column"}),ct=({strategy:e,setStrategy:r,projectId:s,environment:u,editable:o,permission:i=Te})=>{const{trackEvent:a}=Y(),[l,d]=b.useState([]),m=J(),f=e!=null&&e.parameters&&"stickiness"in(e==null?void 0:e.parameters)?String(e.parameters.stickiness):"default";b.useEffect(()=>{d((e.variants||[]).map(n=>({...n,new:o||!1,isValid:!0,id:U(),overrides:[]})))},[]),b.useEffect(()=>{r(n=>({...n,variants:l.map(h=>({stickiness:f,name:h.name,weight:h.weight,payload:h.payload,weightType:h.weightType}))}))},[f,JSON.stringify(l)]);const p=(n,h)=>{d(S=>z(S.map(y=>y.id===h?n:y),1e3))},g=()=>{const n=U();d(h=>[...h,{name:"",weightType:je.VARIABLE,weight:0,stickiness:f,new:!0,isValid:!1,id:n}]),a("strategy-variants",{props:{eventType:"variant added"}})};return t.jsxs(t.Fragment,{children:[t.jsxs(C,{component:"h3",sx:{m:0,display:"flex",gap:"1ch"},variant:"h3",children:["Variants",t.jsx(xe,{htmlTooltip:!0,tooltip:t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"Variants allow to attach one or more values to this strategy. Variants at the strategy level override variants at the feature level."}),t.jsx(be,{target:"_blank",href:"https://docs.getunleash.io/reference/strategy-variants",children:"Learn more"})]})})]}),t.jsxs(lt,{children:[t.jsx(ye,{}),l.map((n,h)=>t.jsx(Se,{disableOverrides:!0,variant:n,variants:l,updateVariant:S=>p(S,n.id),removeVariant:()=>d(S=>z(S.filter(y=>y.id!==n.id),1e3)),decorationColor:m.palette.variants[h%m.palette.variants.length]},n.id))]}),t.jsx(B,{onClick:g,variant:"outlined",permission:i,projectId:s,environmentId:u,"data-testid":"ADD_STRATEGY_VARIANT_BUTTON",children:"Add variant"}),t.jsx(ve,{variants:l})]})},dt=j("form")(({theme:e})=>({display:"grid",gap:e.spacing(2)})),H=j("hr")(({theme:e})=>({width:"100%",height:"1px",margin:e.spacing(2,0),border:"none",background:e.palette.background.elevation2})),ut=j("div")(({theme:e})=>({display:"flex",justifyContent:"end",gap:e.spacing(2),paddingBottom:e.spacing(10)})),pt=({projectId:e,environmentId:r,permission:s,onSubmit:u,onCancel:o,loading:i,strategy:a,setStrategy:l,segments:d,setSegments:m,errors:f})=>{const p=Ee(a.constraints),g=Ce(s,e,r),{strategyDefinition:n}=K(a==null?void 0:a.name),h=Q(),{uiConfig:S,error:y,loading:D}=X();if(y)throw y;if(D||!n)return null;const F=v=>n.parameters.find(E=>E.name===v),A=(v,E)=>{const w=F(v);if(v!=="groupId"){const I=Fe(w,E);return I?(f.setFormError(v,I),!1):(f.removeFormError(v),!0)}return!0},c=()=>n.parameters.map(v=>v.name).map(v=>{var E;return A(v,(E=a.parameters)==null?void 0:E[v])}).every(Boolean),k=()=>{h(`/projects/${e}/settings/default-strategy`)},O=async v=>{if(v.preventDefault(),c())u();else return};return t.jsxs(dt,{onSubmit:O,children:[t.jsx(Ae,{title:a.title||"",setTitle:v=>{l(E=>({...E,title:v}))}}),t.jsx(we,{segments:d,setSegments:m,projectId:e}),t.jsx(Re,{projectId:e,environmentId:r,strategy:a,setStrategy:l}),t.jsx(H,{}),t.jsx(ke,{strategy:a,strategyDefinition:n,setStrategy:l,validateParameter:A,errors:f,hasAccess:g}),t.jsx(P,{condition:a.parameters!=null&&"stickiness"in a.parameters,show:t.jsx(ct,{strategy:a,setStrategy:l,environment:r,projectId:e,permission:[Ie,Z]})}),t.jsx(H,{}),t.jsxs(ut,{children:[t.jsx(B,{permission:s,projectId:e,environmentId:r,variant:"contained",color:"primary",type:"submit",disabled:i||!p||f.hasFormErrors(),"data-testid":Pe,children:"Save strategy"}),t.jsx(De,{type:"button",color:"primary",onClick:o||k,disabled:i,children:"Cancel"})]})]})},gt=(e,r)=>{var a,l;const{project:s,refetch:u}=ee(e),o={name:"flexibleRollout",constraints:[],parameters:{rollout:"100",stickiness:s.defaultStickiness||"default",groupId:""}},i=(l=(a=s.environments)==null?void 0:a.find(d=>d.environment===r))==null?void 0:l.defaultStrategy;return{defaultStrategyFallback:o,strategy:i,refetch:u}},Lt=()=>{const e=q("projectId"),r=Oe("environmentId"),{refetch:s}=ee(e),{defaultStrategyFallback:u,strategy:o,refetch:i}=gt(e,r),[a,l]=b.useState(o||u),[d,m]=b.useState([]),{updateDefaultStrategy:f,loading:p}=Ve(),{strategyDefinition:g}=K(a==null?void 0:a.name),{setToastData:n,setToastApiError:h}=_(),S=Be(),{uiConfig:y}=X(),{unleashUrl:D}=y,F=Q(),{trackEvent:A}=Y(),{segments:c,refetchSegments:k}=_e();b.useEffect(()=>{if(c&&(o!=null&&o.segments)){const w=[];for(const I of o==null?void 0:o.segments)w.push(...c.filter(T=>T.id===I));m(w)}},[JSON.stringify(c),JSON.stringify(o==null?void 0:o.segments)]);const O=ht(a,d),v=async w=>{await f(e,r,w),A("default_strategy",{props:{action:"edit",hasTitle:!!w.title}}),k(),s(),n({text:"Default Strategy updated",type:"success"})},E=async()=>{const w=`/projects/${e}/settings/default-strategy`;try{await v(O),await i(),F(w)}catch(I){h(V(I))}};return!g||!a?null:t.jsx($e,{modal:!0,title:qe((a==null?void 0:a.name)??""),description:ft,documentationLink:xt,documentationLinkLabel:bt,formatApiCode:()=>mt(e,r,O,g,D),children:t.jsx(pt,{projectId:e,strategy:a,setStrategy:l,segments:d,setSegments:m,environmentId:r,onSubmit:E,loading:p,permission:[Le,Z],errors:S,isChangeRequest:!1})})},ht=(e,r)=>({name:e.name,title:e.title,constraints:e.constraints??[],parameters:e.parameters??{},variants:e.variants??[],segments:r.map(s=>s.id),disabled:e.disabled??!1}),mt=(e,r,s,u,o)=>{if(!o)return"";const i={...s,parameters:Ne(s.parameters??{},u)},a=`${o}/api/admin/projects/${e}/environments/${r}/default-strategy}`,l=JSON.stringify(i,void 0,2);return`curl --location --request PUT '${a}' \\
1
+ import{G as re,H as oe,j as t,A as M,l as W,C as P,bh as ie,m as le,o as ce,ix as de,n as ue,s as j,b as J,T as C,u as pe,ba as ge,r as b,b9 as he,bb as me,bd as fe,as as Y,d2 as U,eB as xe,c0 as be,iy as ye,d0 as Se,d5 as z,b5 as B,iz as ve,d4 as Te,d3 as je,iA as Ee,cr as Ce,bE as K,bt as Q,bc as X,iB as Ae,iC as we,iD as Re,iE as ke,hL as Ie,hB as Z,iF as Pe,i as De,iG as Fe,dp as ee,aQ as q,bB as Oe,fL as Ve,e as _,bF as Be,bD as _e,bK as $e,b$ as qe,hO as Le,iH as Ne,h as V,eR as Ue,b8 as ze,dh as Ge,bp as He,aU as Me,aV as te,aY as L,V as We,d6 as Je,aR as Ye,bi as G,bf as ae,iI as Ke,iJ as Qe,B as Xe,aq as Ze,hz as et,iK as tt}from"./index-CBxzHo9v.js";var N={},at=oe;Object.defineProperty(N,"__esModule",{value:!0});var se=N.default=void 0,st=at(re()),nt=t,rt=(0,st.default)((0,nt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");se=N.default=rt;const ot=de(),Bt=({options:e,selectedOptions:r,indeterminateOptions:s,tagType:u,existingTags:o,disabled:i=!1,onChange:a})=>{const l=t.jsx(ue,{fontSize:"small"}),d=p=>p.inputValue?p.inputValue:p.title,m=({key:p,...g},n,{selected:h})=>{const S=(s==null?void 0:s.some(y=>y.title===n.title))??!1;return t.jsxs("li",{...g,children:[t.jsx(P,{condition:!!n.inputValue,show:t.jsx(ie,{sx:{mr:y=>y.spacing(.5)}}),elseShow:t.jsx(le,{icon:l,checkedIcon:t.jsx(ce,{fontSize:"small"}),indeterminateIcon:t.jsx(se,{fontSize:"small"}),sx:{mr:y=>y.spacing(.5)},checked:h&&!S,indeterminate:S})}),n.title]},p)},f=(p,g)=>{const n=g.inputValue.trim(),h=ot(p,{...g,inputValue:n}),S=p.some(y=>n===y.title);return n.length>=2&&!S&&h.push({inputValue:n,title:`Create new value "${n}"`}),h};return t.jsx(M,{multiple:!0,id:"checkboxes-tag",sx:{marginTop:p=>p.spacing(2),width:500},disableCloseOnSelect:!0,options:e,value:r,isOptionEqualToValue:(p,g)=>g.inputValue&&g.inputValue!==""?p.title===g.inputValue:p.title===g.title,getOptionLabel:d,renderOption:m,filterOptions:f,ListboxProps:{style:{maxHeight:200,overflow:"auto"}},onChange:a,renderInput:p=>t.jsx(W,{...p,label:"Select values",placeholder:"Select values"}),disabled:i})},it=j("li")({flexDirection:"column"}),_t=({options:e,value:r,disabled:s=!1,onChange:u})=>{const o=J();return t.jsx(M,{disablePortal:!0,disabled:s,id:"tag-type-select",sx:{marginTop:i=>i.spacing(2),width:500},options:e,disableClearable:!0,value:r,getOptionLabel:i=>i.name,renderOption:({key:i,...a},l)=>t.jsxs(it,{...a,style:{alignItems:"flex-start",gap:o.spacing(.5)},children:[t.jsx(C,{variant:"body1",children:l.name}),t.jsx(C,{variant:"caption",children:l.description})]},i),renderInput:i=>t.jsx(W,{...i,label:"Tag type",value:r}),onChange:u,ListboxProps:{style:{maxHeight:200,overflow:"auto"}}})},$t=()=>{const{makeRequest:e,createRequest:r,errors:s,loading:u}=pe({propagateErrors:!0});return{createTag:async a=>{const d=r("api/admin/tags",{method:"POST",body:JSON.stringify(a)});return e(d.caller,d.id)},bulkUpdateTags:async(a,l)=>{const d=`api/admin/projects/${l}/tags`,m=r(d,{method:"PUT",body:JSON.stringify(a)});return e(m.caller,m.id)},errors:s,loading:u}},qt=(e,r={})=>{const s=async()=>{const m=he(`api/admin/tags/${e}`);return(await fetch(m,{method:"GET"}).then(me("Tags"))).json()},u=`api/admin/tags/${e}`,{data:o,error:i}=ge(!!e,{tags:[]},u,s,r),[a,l]=b.useState(!i&&!o),d=()=>{fe(u)};return b.useEffect(()=>{l(!i&&!o)},[o,i]),{tags:(o==null?void 0:o.tags)||[],error:i,loading:a,refetch:d}},lt=j("div")({display:"flex",flexDirection:"column"}),ct=({strategy:e,setStrategy:r,projectId:s,environment:u,editable:o,permission:i=Te})=>{const{trackEvent:a}=Y(),[l,d]=b.useState([]),m=J(),f=e!=null&&e.parameters&&"stickiness"in(e==null?void 0:e.parameters)?String(e.parameters.stickiness):"default";b.useEffect(()=>{d((e.variants||[]).map(n=>({...n,new:o||!1,isValid:!0,id:U(),overrides:[]})))},[]),b.useEffect(()=>{r(n=>({...n,variants:l.map(h=>({stickiness:f,name:h.name,weight:h.weight,payload:h.payload,weightType:h.weightType}))}))},[f,JSON.stringify(l)]);const p=(n,h)=>{d(S=>z(S.map(y=>y.id===h?n:y),1e3))},g=()=>{const n=U();d(h=>[...h,{name:"",weightType:je.VARIABLE,weight:0,stickiness:f,new:!0,isValid:!1,id:n}]),a("strategy-variants",{props:{eventType:"variant added"}})};return t.jsxs(t.Fragment,{children:[t.jsxs(C,{component:"h3",sx:{m:0,display:"flex",gap:"1ch"},variant:"h3",children:["Variants",t.jsx(xe,{htmlTooltip:!0,tooltip:t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"Variants allow to attach one or more values to this strategy. Variants at the strategy level override variants at the feature level."}),t.jsx(be,{target:"_blank",href:"https://docs.getunleash.io/reference/strategy-variants",children:"Learn more"})]})})]}),t.jsxs(lt,{children:[t.jsx(ye,{}),l.map((n,h)=>t.jsx(Se,{disableOverrides:!0,variant:n,variants:l,updateVariant:S=>p(S,n.id),removeVariant:()=>d(S=>z(S.filter(y=>y.id!==n.id),1e3)),decorationColor:m.palette.variants[h%m.palette.variants.length]},n.id))]}),t.jsx(B,{onClick:g,variant:"outlined",permission:i,projectId:s,environmentId:u,"data-testid":"ADD_STRATEGY_VARIANT_BUTTON",children:"Add variant"}),t.jsx(ve,{variants:l})]})},dt=j("form")(({theme:e})=>({display:"grid",gap:e.spacing(2)})),H=j("hr")(({theme:e})=>({width:"100%",height:"1px",margin:e.spacing(2,0),border:"none",background:e.palette.background.elevation2})),ut=j("div")(({theme:e})=>({display:"flex",justifyContent:"end",gap:e.spacing(2),paddingBottom:e.spacing(10)})),pt=({projectId:e,environmentId:r,permission:s,onSubmit:u,onCancel:o,loading:i,strategy:a,setStrategy:l,segments:d,setSegments:m,errors:f})=>{const p=Ee(a.constraints),g=Ce(s,e,r),{strategyDefinition:n}=K(a==null?void 0:a.name),h=Q(),{uiConfig:S,error:y,loading:D}=X();if(y)throw y;if(D||!n)return null;const F=v=>n.parameters.find(E=>E.name===v),A=(v,E)=>{const w=F(v);if(v!=="groupId"){const I=Fe(w,E);return I?(f.setFormError(v,I),!1):(f.removeFormError(v),!0)}return!0},c=()=>n.parameters.map(v=>v.name).map(v=>{var E;return A(v,(E=a.parameters)==null?void 0:E[v])}).every(Boolean),k=()=>{h(`/projects/${e}/settings/default-strategy`)},O=async v=>{if(v.preventDefault(),c())u();else return};return t.jsxs(dt,{onSubmit:O,children:[t.jsx(Ae,{title:a.title||"",setTitle:v=>{l(E=>({...E,title:v}))}}),t.jsx(we,{segments:d,setSegments:m,projectId:e}),t.jsx(Re,{projectId:e,environmentId:r,strategy:a,setStrategy:l}),t.jsx(H,{}),t.jsx(ke,{strategy:a,strategyDefinition:n,setStrategy:l,validateParameter:A,errors:f,hasAccess:g}),t.jsx(P,{condition:a.parameters!=null&&"stickiness"in a.parameters,show:t.jsx(ct,{strategy:a,setStrategy:l,environment:r,projectId:e,permission:[Ie,Z]})}),t.jsx(H,{}),t.jsxs(ut,{children:[t.jsx(B,{permission:s,projectId:e,environmentId:r,variant:"contained",color:"primary",type:"submit",disabled:i||!p||f.hasFormErrors(),"data-testid":Pe,children:"Save strategy"}),t.jsx(De,{type:"button",color:"primary",onClick:o||k,disabled:i,children:"Cancel"})]})]})},gt=(e,r)=>{var a,l;const{project:s,refetch:u}=ee(e),o={name:"flexibleRollout",constraints:[],parameters:{rollout:"100",stickiness:s.defaultStickiness||"default",groupId:""}},i=(l=(a=s.environments)==null?void 0:a.find(d=>d.environment===r))==null?void 0:l.defaultStrategy;return{defaultStrategyFallback:o,strategy:i,refetch:u}},Lt=()=>{const e=q("projectId"),r=Oe("environmentId"),{refetch:s}=ee(e),{defaultStrategyFallback:u,strategy:o,refetch:i}=gt(e,r),[a,l]=b.useState(o||u),[d,m]=b.useState([]),{updateDefaultStrategy:f,loading:p}=Ve(),{strategyDefinition:g}=K(a==null?void 0:a.name),{setToastData:n,setToastApiError:h}=_(),S=Be(),{uiConfig:y}=X(),{unleashUrl:D}=y,F=Q(),{trackEvent:A}=Y(),{segments:c,refetchSegments:k}=_e();b.useEffect(()=>{if(c&&(o!=null&&o.segments)){const w=[];for(const I of o==null?void 0:o.segments)w.push(...c.filter(T=>T.id===I));m(w)}},[JSON.stringify(c),JSON.stringify(o==null?void 0:o.segments)]);const O=ht(a,d),v=async w=>{await f(e,r,w),A("default_strategy",{props:{action:"edit",hasTitle:!!w.title}}),k(),s(),n({text:"Default Strategy updated",type:"success"})},E=async()=>{const w=`/projects/${e}/settings/default-strategy`;try{await v(O),await i(),F(w)}catch(I){h(V(I))}};return!g||!a?null:t.jsx($e,{modal:!0,title:qe((a==null?void 0:a.name)??""),description:ft,documentationLink:xt,documentationLinkLabel:bt,formatApiCode:()=>mt(e,r,O,g,D),children:t.jsx(pt,{projectId:e,strategy:a,setStrategy:l,segments:d,setSegments:m,environmentId:r,onSubmit:E,loading:p,permission:[Le,Z],errors:S,isChangeRequest:!1})})},ht=(e,r)=>({name:e.name,title:e.title,constraints:e.constraints??[],parameters:e.parameters??{},variants:e.variants??[],segments:r.map(s=>s.id),disabled:e.disabled??!1}),mt=(e,r,s,u,o)=>{if(!o)return"";const i={...s,parameters:Ne(s.parameters??{},u)},a=`${o}/api/admin/projects/${e}/environments/${r}/default-strategy}`,l=JSON.stringify(i,void 0,2);return`curl --location --request PUT '${a}' \\
2
2
  --header 'Authorization: INSERT_API_KEY' \\
3
3
  --header 'Content-Type: application/json' \\
4
4
  --data-raw '${l}'`},ft=`