{"version":3,"file":"tour.mjs","names":[],"sources":["../../../../../../packages/components/tour/src/tour.ts"],"sourcesContent":["import {\n  buildProps,\n  definePropType,\n  iconPropType,\n  isBoolean,\n  isNumber,\n} from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { tourContentProps } from './content'\n\nimport type { TourContentProps } from './content'\nimport type { CSSProperties, ExtractPublicPropTypes } from 'vue'\nimport type { IconPropType } from '@element-plus/utils'\nimport type Tour from './tour.vue'\nimport type { TourGap, TourMask } from './types'\n\nexport interface TourProps {\n  /**\n   * @description open tour\n   */\n  modelValue?: boolean\n  /**\n   * @description what is the current step\n   */\n  current?: number\n  /**\n   * @description whether to show the arrow\n   */\n  showArrow?: boolean\n  /**\n   * @description whether to show a close button\n   */\n  showClose?: boolean\n  /**\n   * @description custom close icon\n   */\n  closeIcon?: IconPropType\n  /**\n   * @description position of the guide card relative to the target element\n   */\n  placement?: TourContentProps['placement']\n  /**\n   * @description custom style for content\n   */\n  contentStyle?: CSSProperties\n  /**\n   * @description whether to enable masking, change mask style and fill color by pass custom props\n   */\n  mask?: TourMask\n  /**\n   * @description transparent gap between mask and target\n   */\n  gap?: TourGap\n  /**\n   * @description tour's zIndex\n   */\n  zIndex?: number\n  /**\n   * @description support pass custom scrollIntoView options\n   */\n  scrollIntoViewOptions?: boolean | ScrollIntoViewOptions\n  /**\n   * @description type, affects the background color and text color\n   */\n  type?: 'default' | 'primary'\n  /**\n   * @description which element the TourContent appends to\n   */\n  appendTo?: string | HTMLElement\n  /**\n   * @description whether the Tour can be closed by pressing ESC\n   */\n  closeOnPressEscape?: boolean\n  /**\n   * @description whether the target element can be clickable, when using mask\n   */\n  targetAreaClickable?: boolean\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `TourProps` instead.\n */\nexport const tourProps = buildProps({\n  /**\n   * @description open tour\n   */\n  modelValue: Boolean,\n  /**\n   * @description what is the current step\n   */\n  current: {\n    type: Number,\n  },\n  /**\n   * @description whether to show the arrow\n   */\n  showArrow: {\n    type: Boolean,\n    default: true,\n  },\n  /**\n   * @description whether to show a close button\n   */\n  showClose: {\n    type: Boolean,\n    default: true,\n  },\n  /**\n   * @description custom close icon\n   */\n  closeIcon: {\n    type: iconPropType,\n  },\n  /**\n   * @description position of the guide card relative to the target element\n   */\n  placement: tourContentProps.placement,\n  /**\n   * @description custom style for content\n   */\n  contentStyle: {\n    type: definePropType<CSSProperties>([Object]),\n  },\n  /**\n   * @description whether to enable masking, change mask style and fill color by pass custom props\n   */\n  mask: {\n    type: definePropType<TourMask>([Boolean, Object]),\n    default: true,\n  },\n  /**\n   * @description transparent gap between mask and target\n   */\n  gap: {\n    type: definePropType<TourGap>(Object),\n    default: () => ({\n      offset: 6,\n      radius: 2,\n    }),\n  },\n  /**\n   * @description tour's zIndex\n   */\n  zIndex: {\n    type: Number,\n  },\n  /**\n   * @description support pass custom scrollIntoView options\n   */\n  scrollIntoViewOptions: {\n    type: definePropType<boolean | ScrollIntoViewOptions>([Boolean, Object]),\n    default: () => ({\n      block: 'center',\n    }),\n  },\n  /**\n   * @description type, affects the background color and text color\n   */\n  type: {\n    type: definePropType<'default' | 'primary'>(String),\n  },\n  /**\n   * @description which element the TourContent appends to\n   */\n  appendTo: {\n    type: definePropType<string | HTMLElement>([String, Object]),\n    default: 'body',\n  },\n  /**\n   * @description whether the Tour can be closed by pressing ESC\n   */\n  closeOnPressEscape: {\n    type: Boolean,\n    default: true,\n  },\n  /**\n   * @description whether the target element can be clickable, when using mask\n   */\n  targetAreaClickable: {\n    type: Boolean,\n    default: true,\n  },\n})\n\n/**\n * @deprecated Removed after 3.0.0, Use `TourProps` instead.\n */\nexport type TourPropsPublic = ExtractPublicPropTypes<typeof tourProps>\nexport type TourInstance = InstanceType<typeof Tour> & unknown\n\nexport const tourEmits = {\n  [UPDATE_MODEL_EVENT]: (value: boolean) => isBoolean(value),\n  ['update:current']: (current: number) => isNumber(current),\n  close: (current: number) => isNumber(current),\n  finish: () => true,\n  change: (current: number) => isNumber(current),\n}\nexport type TourEmits = typeof tourEmits\n"],"mappings":";;;;;;;;;AAkFA,MAAa,YAAY,WAAW;;;;CAIlC,YAAY;;;;CAIZ,SAAS,EACP,MAAM,OACR;;;;CAIA,WAAW;EACT,MAAM;EACN,SAAS;CACX;;;;CAIA,WAAW;EACT,MAAM;EACN,SAAS;CACX;;;;CAIA,WAAW,EACT,MAAM,aACR;;;;CAIA,WAAW,iBAAiB;;;;CAI5B,cAAc,EACZ,MAAM,eAA8B,CAAC,MAAM,CAAC,EAC9C;;;;CAIA,MAAM;EACJ,MAAM,eAAyB,CAAC,SAAS,MAAM,CAAC;EAChD,SAAS;CACX;;;;CAIA,KAAK;EACH,MAAM,eAAwB,MAAM;EACpC,gBAAgB;GACd,QAAQ;GACR,QAAQ;EACV;CACF;;;;CAIA,QAAQ,EACN,MAAM,OACR;;;;CAIA,uBAAuB;EACrB,MAAM,eAAgD,CAAC,SAAS,MAAM,CAAC;EACvE,gBAAgB,EACd,OAAO,SACT;CACF;;;;CAIA,MAAM,EACJ,MAAM,eAAsC,MAAM,EACpD;;;;CAIA,UAAU;EACR,MAAM,eAAqC,CAAC,QAAQ,MAAM,CAAC;EAC3D,SAAS;CACX;;;;CAIA,oBAAoB;EAClB,MAAM;EACN,SAAS;CACX;;;;CAIA,qBAAqB;EACnB,MAAM;EACN,SAAS;CACX;AACF,CAAC;AAQD,MAAa,YAAY;EACtB,sBAAsB,UAAmB,UAAU,KAAK;EACxD,oBAAoB,YAAoB,SAAS,OAAO;CACzD,QAAQ,YAAoB,SAAS,OAAO;CAC5C,cAAc;CACd,SAAS,YAAoB,SAAS,OAAO;AAC/C"}