{"version":3,"file":"masterteam-components-empty-state.mjs","sources":["../../../../packages/masterteam/components/empty-state/empty-state.ts","../../../../packages/masterteam/components/empty-state/empty-state.html","../../../../packages/masterteam/components/empty-state/masterteam-components-empty-state.ts"],"sourcesContent":["import {\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  computed,\r\n  inject,\r\n  input,\r\n  output,\r\n} from '@angular/core';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { Icon, MTIcon } from '@masterteam/icons';\r\n\r\n/**\r\n * Which story an empty list is telling. They are different situations and they\r\n * need different words: \"nothing here yet\" invites the user to create the first\r\n * record, \"nothing matched\" invites them to widen the filter. Rendering the\r\n * same magnifying glass for both actively misleads — it implies a search is\r\n * hiding results when none was applied (finding H-12).\r\n */\r\nexport type EmptyStateVariant = 'empty' | 'filtered';\r\n\r\n/** Artwork slot. `none` for tight surfaces (a sidebar menu, a small panel). */\r\nexport type EmptyStateIllustration = 'box' | 'filter' | 'none';\r\n\r\n/**\r\n * The one empty state.\r\n *\r\n * Before this the product had three: the table's illustrated \"No data found\",\r\n * the cards view's bare grey \"No cards found.\", and a hardcoded, untranslated\r\n * \"No data found\" in the client page menu. Three patterns across one product\r\n * read as three teams, and none of them said what the list holds or offered a\r\n * way to fill it.\r\n *\r\n * Everything is optional: with no inputs at all it renders exactly what the\r\n * table used to, so adopting it is never a regression.\r\n */\r\n@Component({\r\n  selector: 'mt-empty-state',\r\n  standalone: true,\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n  imports: [Button, Icon],\r\n  templateUrl: './empty-state.html',\r\n  host: {\r\n    class: 'block w-full',\r\n  },\r\n})\r\nexport class EmptyState {\r\n  private readonly transloco = inject(TranslocoService);\r\n\r\n  readonly variant = input<EmptyStateVariant>('empty');\r\n\r\n  /** Defaults to the variant's illustration; `none` opts out entirely. */\r\n  readonly illustration = input<EmptyStateIllustration>();\r\n\r\n  /** Heading. Falls back to the variant's default copy. */\r\n  readonly title = input<string>();\r\n\r\n  /** One line saying what the list holds, or why nothing matched. */\r\n  readonly description = input<string>();\r\n\r\n  /** Renders the call to action when set — \"New risk\", \"Clear filters\". */\r\n  readonly actionLabel = input<string>();\r\n  readonly actionIcon = input<MTIcon>();\r\n\r\n  readonly actionClick = output<void>();\r\n\r\n  readonly resolvedTitle = computed(\r\n    () =>\r\n      this.title()?.trim() ||\r\n      this.transloco.translate(\r\n        this.variant() === 'filtered'\r\n          ? 'components.emptyState.filteredTitle'\r\n          : 'components.emptyState.emptyTitle',\r\n      ),\r\n  );\r\n\r\n  readonly resolvedIllustration = computed<EmptyStateIllustration>(\r\n    () =>\r\n      this.illustration() ?? (this.variant() === 'filtered' ? 'filter' : 'box'),\r\n  );\r\n\r\n  readonly resolvedDescription = computed(\r\n    () => this.description()?.trim() || '',\r\n  );\r\n}\r\n","<div\r\n  class=\"mt-empty-state flex flex-col items-center justify-center gap-3 px-6 py-10 text-center\"\r\n  role=\"status\"\r\n>\r\n  @if (resolvedIllustration() !== \"none\") {\r\n    <div aria-hidden=\"true\">\r\n      @if (resolvedIllustration() === \"filter\") {\r\n        <mt-icon\r\n          icon=\"general.filter-funnel-01\"\r\n          class=\"text-5xl text-surface-300\"\r\n        />\r\n      } @else {\r\n        <svg\r\n          width=\"152\"\r\n          height=\"120\"\r\n          viewBox=\"0 0 152 120\"\r\n          fill=\"none\"\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n        >\r\n          <circle cx=\"76\" cy=\"52\" r=\"52\" fill=\"#E9EAEB\" />\r\n          <g filter=\"url(#filter0_ddd_2474_28277)\">\r\n            <path\r\n              d=\"M77.6 16C66.8273 16 57.2978 21.3233 51.4987 29.4829C49.605 29.0363 47.6301 28.8 45.6 28.8C31.4615 28.8 20 40.2615 20 54.4C20 68.5385 31.4615 80 45.6 80L109.6 80C121.971 80 132 69.9712 132 57.6C132 45.2288 121.971 35.2 109.6 35.2C108.721 35.2 107.854 35.2506 107.002 35.349C102.098 23.9677 90.7797 16 77.6 16Z\"\r\n              fill=\"#FAFAFA\"\r\n            />\r\n            <ellipse\r\n              cx=\"45.6\"\r\n              cy=\"54.3998\"\r\n              rx=\"25.6\"\r\n              ry=\"25.6\"\r\n              fill=\"url(#paint0_linear_2474_28277)\"\r\n            />\r\n            <circle\r\n              cx=\"77.6016\"\r\n              cy=\"48\"\r\n              r=\"32\"\r\n              fill=\"url(#paint1_linear_2474_28277)\"\r\n            />\r\n            <ellipse\r\n              cx=\"109.599\"\r\n              cy=\"57.6002\"\r\n              rx=\"22.4\"\r\n              ry=\"22.4\"\r\n              fill=\"url(#paint2_linear_2474_28277)\"\r\n            />\r\n          </g>\r\n          <circle cx=\"21\" cy=\"19\" r=\"5\" fill=\"#F5F5F5\" />\r\n          <circle cx=\"18\" cy=\"109\" r=\"7\" fill=\"#F5F5F5\" />\r\n          <circle cx=\"145\" cy=\"35\" r=\"7\" fill=\"#F5F5F5\" />\r\n          <circle cx=\"134\" cy=\"8\" r=\"4\" fill=\"#F5F5F5\" />\r\n          <foreignObject x=\"44\" y=\"54\" width=\"64\" height=\"64\">\r\n            <div\r\n              xmlns=\"http://www.w3.org/1999/xhtml\"\r\n              style=\"\r\n                backdrop-filter: blur(4px);\r\n                clip-path: url(#bgblur_0_2474_28277_clip_path);\r\n                height: 100%;\r\n                width: 100%;\r\n              \"\r\n            ></div>\r\n          </foreignObject>\r\n          <g data-figma-bg-blur-radius=\"8\">\r\n            <path\r\n              d=\"M52 86C52 72.7452 62.7452 62 76 62C89.2548 62 100 72.7452 100 86C100 99.2548 89.2548 110 76 110C62.7452 110 52 99.2548 52 86Z\"\r\n              fill=\"#344054\"\r\n              fill-opacity=\"0.4\"\r\n            />\r\n            <path\r\n              d=\"M85 95L81.5001 91.5M84 85.5C84 90.1944 80.1944 94 75.5 94C70.8056 94 67 90.1944 67 85.5C67 80.8056 70.8056 77 75.5 77C80.1944 77 84 80.8056 84 85.5Z\"\r\n              stroke=\"white\"\r\n              stroke-width=\"2\"\r\n              stroke-linecap=\"round\"\r\n              stroke-linejoin=\"round\"\r\n            />\r\n          </g>\r\n          <defs>\r\n            <filter\r\n              id=\"filter0_ddd_2474_28277\"\r\n              x=\"0\"\r\n              y=\"16\"\r\n              width=\"152\"\r\n              height=\"104\"\r\n              filterUnits=\"userSpaceOnUse\"\r\n              color-interpolation-filters=\"sRGB\"\r\n            >\r\n              <feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\" />\r\n              <feColorMatrix\r\n                in=\"SourceAlpha\"\r\n                type=\"matrix\"\r\n                values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\r\n                result=\"hardAlpha\"\r\n              />\r\n              <feMorphology\r\n                radius=\"1.5\"\r\n                operator=\"erode\"\r\n                in=\"SourceAlpha\"\r\n                result=\"effect1_dropShadow_2474_28277\"\r\n              />\r\n              <feOffset dy=\"3\" />\r\n              <feGaussianBlur stdDeviation=\"1.5\" />\r\n              <feComposite in2=\"hardAlpha\" operator=\"out\" />\r\n              <feColorMatrix\r\n                type=\"matrix\"\r\n                values=\"0 0 0 0 0.0392157 0 0 0 0 0.0496732 0 0 0 0 0.0705882 0 0 0 0.04 0\"\r\n              />\r\n              <feBlend\r\n                mode=\"normal\"\r\n                in2=\"BackgroundImageFix\"\r\n                result=\"effect1_dropShadow_2474_28277\"\r\n              />\r\n              <feColorMatrix\r\n                in=\"SourceAlpha\"\r\n                type=\"matrix\"\r\n                values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\r\n                result=\"hardAlpha\"\r\n              />\r\n              <feMorphology\r\n                radius=\"4\"\r\n                operator=\"erode\"\r\n                in=\"SourceAlpha\"\r\n                result=\"effect2_dropShadow_2474_28277\"\r\n              />\r\n              <feOffset dy=\"8\" />\r\n              <feGaussianBlur stdDeviation=\"4\" />\r\n              <feComposite in2=\"hardAlpha\" operator=\"out\" />\r\n              <feColorMatrix\r\n                type=\"matrix\"\r\n                values=\"0 0 0 0 0.0392157 0 0 0 0 0.0496732 0 0 0 0 0.0705882 0 0 0 0.03 0\"\r\n              />\r\n              <feBlend\r\n                mode=\"normal\"\r\n                in2=\"effect1_dropShadow_2474_28277\"\r\n                result=\"effect2_dropShadow_2474_28277\"\r\n              />\r\n              <feColorMatrix\r\n                in=\"SourceAlpha\"\r\n                type=\"matrix\"\r\n                values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\r\n                result=\"hardAlpha\"\r\n              />\r\n              <feMorphology\r\n                radius=\"4\"\r\n                operator=\"erode\"\r\n                in=\"SourceAlpha\"\r\n                result=\"effect3_dropShadow_2474_28277\"\r\n              />\r\n              <feOffset dy=\"20\" />\r\n              <feGaussianBlur stdDeviation=\"12\" />\r\n              <feComposite in2=\"hardAlpha\" operator=\"out\" />\r\n              <feColorMatrix\r\n                type=\"matrix\"\r\n                values=\"0 0 0 0 0.0392157 0 0 0 0 0.0496732 0 0 0 0 0.0705882 0 0 0 0.08 0\"\r\n              />\r\n              <feBlend\r\n                mode=\"normal\"\r\n                in2=\"effect2_dropShadow_2474_28277\"\r\n                result=\"effect3_dropShadow_2474_28277\"\r\n              />\r\n              <feBlend\r\n                mode=\"normal\"\r\n                in=\"SourceGraphic\"\r\n                in2=\"effect3_dropShadow_2474_28277\"\r\n                result=\"shape\"\r\n              />\r\n            </filter>\r\n            <clipPath\r\n              id=\"bgblur_0_2474_28277_clip_path\"\r\n              transform=\"translate(-44 -54)\"\r\n            >\r\n              <path\r\n                d=\"M52 86C52 72.7452 62.7452 62 76 62C89.2548 62 100 72.7452 100 86C100 99.2548 89.2548 110 76 110C62.7452 110 52 99.2548 52 86Z\"\r\n              />\r\n            </clipPath>\r\n            <linearGradient\r\n              id=\"paint0_linear_2474_28277\"\r\n              x1=\"25.9429\"\r\n              y1=\"37.4855\"\r\n              x2=\"71.2\"\r\n              y2=\"79.9998\"\r\n              gradientUnits=\"userSpaceOnUse\"\r\n            >\r\n              <stop stop-color=\"#D0D5DD\" />\r\n              <stop offset=\"0.350715\" stop-color=\"white\" stop-opacity=\"0\" />\r\n            </linearGradient>\r\n            <linearGradient\r\n              id=\"paint1_linear_2474_28277\"\r\n              x1=\"53.0301\"\r\n              y1=\"26.8571\"\r\n              x2=\"109.602\"\r\n              y2=\"80\"\r\n              gradientUnits=\"userSpaceOnUse\"\r\n            >\r\n              <stop stop-color=\"#D0D5DD\" />\r\n              <stop offset=\"0.350715\" stop-color=\"white\" stop-opacity=\"0\" />\r\n            </linearGradient>\r\n            <linearGradient\r\n              id=\"paint2_linear_2474_28277\"\r\n              x1=\"92.3992\"\r\n              y1=\"42.8002\"\r\n              x2=\"131.999\"\r\n              y2=\"80.0002\"\r\n              gradientUnits=\"userSpaceOnUse\"\r\n            >\r\n              <stop stop-color=\"#D0D5DD\" />\r\n              <stop offset=\"0.350715\" stop-color=\"white\" stop-opacity=\"0\" />\r\n            </linearGradient>\r\n          </defs>\r\n        </svg>\r\n      }\r\n    </div>\r\n  }\r\n\r\n  <p class=\"m-0 text-base font-medium text-surface-600 dark:text-surface-200\">\r\n    {{ resolvedTitle() }}\r\n  </p>\r\n\r\n  @if (resolvedDescription(); as description) {\r\n    <p\r\n      class=\"m-0 max-w-md text-sm font-normal text-surface-500 dark:text-surface-400\"\r\n    >\r\n      {{ description }}\r\n    </p>\r\n  }\r\n\r\n  @if (actionLabel(); as label) {\r\n    <mt-button\r\n      class=\"mt-1\"\r\n      [label]=\"label\"\r\n      [icon]=\"actionIcon()\"\r\n      [severity]=\"variant() === 'filtered' ? 'secondary' : 'primary'\"\r\n      [variant]=\"variant() === 'filtered' ? 'outlined' : undefined\"\r\n      size=\"small\"\r\n      (onClick)=\"actionClick.emit()\"\r\n    />\r\n  }\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAwBA;;;;;;;;;;;AAWG;MAWU,UAAU,CAAA;AACJ,IAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CA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