gsintegrations 0.0.484 → 0.0.486

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 (28) hide show
  1. package/dist/bundle.cjs.js +987 -54
  2. package/dist/bundle.cjs.js.map +2 -2
  3. package/dist/bundle.esm.js +985 -55
  4. package/dist/bundle.esm.js.map +2 -2
  5. package/dist/index.d.ts +177 -42
  6. package/dist/types/components/social/EditedMark.d.ts +7 -0
  7. package/dist/types/components/social/ExperienceCard.d.ts +5 -0
  8. package/dist/types/components/social/ExperienceCommentRow.d.ts +3 -0
  9. package/dist/types/components/social/ExperienceCommentsSheet.d.ts +3 -0
  10. package/dist/types/components/social/ExperienceDetailView.d.ts +5 -0
  11. package/dist/types/components/social/SocialDeleteConfirmDialog.d.ts +11 -0
  12. package/dist/types/components/social/SocialEditTextDialog.d.ts +19 -0
  13. package/dist/types/components/social/index.d.ts +4 -0
  14. package/dist/types/components/social/types.d.ts +11 -0
  15. package/dist/types/pages/FinancialAccountPage/FinancialAccountPage.types.d.ts +12 -12
  16. package/dist/types/pages/FinancialRegisterPage/FinancialRegister.types.d.ts +28 -28
  17. package/dist/types/pages/NearbyTerreiroSearchPage/NearbyTerreiroSearchPage.d.ts +4 -0
  18. package/dist/types/pages/NearbyTerreiroSearchPage/NearbyTerreiroSearchPage.types.d.ts +42 -0
  19. package/dist/types/pages/NearbyTerreiroSearchPage/TerreiroLocationSearch.d.ts +8 -0
  20. package/dist/types/pages/NearbyTerreiroSearchPage/TerreiroResultMap.d.ts +16 -0
  21. package/dist/types/pages/NearbyTerreiroSearchPage/index.d.ts +3 -0
  22. package/dist/types/pages/Social/ExperienceDetailPage/ExperienceDetailPage.d.ts +7 -0
  23. package/dist/types/pages/Social/JourneyProfilePage/JourneyProfilePage.d.ts +8 -0
  24. package/dist/types/pages/Social/SocialDiscoverPage/SocialDiscoverPage.d.ts +6 -0
  25. package/dist/types/pages/Social/SocialHomePage/SocialHomePage.d.ts +7 -0
  26. package/dist/types/pages/Social/SocialSavedPage/SocialSavedPage.d.ts +7 -0
  27. package/dist/types/pages/index.d.ts +1 -0
  28. package/package.json +1 -1
@@ -58797,6 +58797,10 @@ var DeleteOutline = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
58797
58797
  d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"
58798
58798
  }), 'DeleteOutline');
58799
58799
 
58800
+ var DirectionsOutlined = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
58801
+ d: "m22.43 10.59-9.01-9.01c-.75-.75-2.07-.76-2.83 0l-9 9c-.78.78-.78 2.04 0 2.82l9 9c.39.39.9.58 1.41.58.51 0 1.02-.19 1.41-.58l8.99-8.99c.79-.76.8-2.02.03-2.82m-10.42 10.4-9-9 9-9 9 9zM8 11v4h2v-3h4v2.5l3.5-3.5L14 7.5V10H9c-.55 0-1 .45-1 1"
58802
+ }), 'DirectionsOutlined');
58803
+
58800
58804
  var DirectionsWalk = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
58801
58805
  d: "M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2M9.8 8.9 7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1L6 8.3V13h2V9.6z"
58802
58806
  }), 'DirectionsWalk');
@@ -59046,6 +59050,10 @@ var MoreVert = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
59046
59050
  d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"
59047
59051
  }), 'MoreVert');
59048
59052
 
59053
+ var MyLocation = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
59054
+ d: "M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"
59055
+ }), 'MyLocation');
59056
+
59049
59057
  var NavigateNext = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
59050
59058
  d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
59051
59059
  }), 'NavigateNext');
@@ -80018,7 +80026,7 @@ const TYPE = 16191; /* i: waiting for type bits, including last-flag
80018
80026
  const TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */
80019
80027
  const STORED = 16193; /* i: waiting for stored size (length and complement) */
80020
80028
  const COPY_ = 16194; /* i/o: same as COPY below, but only first time in */
80021
- const COPY$1 = 16195; /* i/o: waiting for input or output to copy stored block */
80029
+ const COPY$2 = 16195; /* i/o: waiting for input or output to copy stored block */
80022
80030
  const TABLE = 16196; /* i: waiting for dynamic block table lengths */
80023
80031
  const LENLENS = 16197; /* i: waiting for code length code lengths */
80024
80032
  const CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */
@@ -80823,9 +80831,9 @@ const inflate$2 = (strm, flush) => {
80823
80831
  if (flush === Z_TREES) { break inf_leave; }
80824
80832
  /* falls through */
80825
80833
  case COPY_:
80826
- state.mode = COPY$1;
80834
+ state.mode = COPY$2;
80827
80835
  /* falls through */
80828
- case COPY$1:
80836
+ case COPY$2:
80829
80837
  copy = state.length;
80830
80838
  if (copy) {
80831
80839
  if (copy > have) { copy = have; }
@@ -128247,6 +128255,7 @@ const ExperienceSchema = objectType({
128247
128255
  eventId: stringType().nullable().optional(),
128248
128256
  terreiroId: stringType().nullable().optional(),
128249
128257
  publishedAt: unionType([stringType(), dateType()]).nullable().optional(),
128258
+ editedAt: unionType([stringType(), dateType()]).nullable().optional(),
128250
128259
  createdAt: unionType([stringType(), dateType()]).optional(),
128251
128260
  });
128252
128261
  const QuestionSchema = objectType({
@@ -128289,6 +128298,7 @@ const ExperienceCommentSchema = objectType({
128289
128298
  likeCount: numberType().optional(),
128290
128299
  viewerHasLiked: booleanType().optional(),
128291
128300
  repliesHasMore: booleanType().optional(),
128301
+ editedAt: unionType([stringType(), dateType()]).nullable().optional(),
128292
128302
  createdAt: unionType([stringType(), dateType()]).optional(),
128293
128303
  });
128294
128304
  const SocialProfileSchema = objectType({
@@ -128778,26 +128788,89 @@ const AlsoExperiencedButton = ({ count = 0, active = false, loading = false, dis
128778
128788
  ? `Eu também passei por isso · ${count}`
128779
128789
  : "Eu também passei por isso"));
128780
128790
 
128791
+ const EditedMark = ({ editedAt, fontSize = "0.9375rem", }) => {
128792
+ if (!editedAt)
128793
+ return null;
128794
+ return (React$1.createElement(React$1.Fragment, null,
128795
+ React$1.createElement(Typography$1, { component: "span", color: "text.secondary", sx: { fontSize }, "data-testid": "edited-mark" }, "\u00B7"),
128796
+ React$1.createElement(Typography$1, { component: "span", color: "text.secondary", sx: { fontSize } }, "Editado")));
128797
+ };
128798
+
128799
+ const COPY$1 = {
128800
+ post: {
128801
+ title: "Excluir publicação",
128802
+ body: "Excluir esta publicação? Essa ação não pode ser desfeita.",
128803
+ },
128804
+ comment: {
128805
+ title: "Excluir comentário",
128806
+ body: "Excluir este comentário? As respostas também serão removidas.",
128807
+ },
128808
+ reply: {
128809
+ title: "Excluir resposta",
128810
+ body: "Excluir esta resposta? Essa ação não pode ser desfeita.",
128811
+ },
128812
+ };
128813
+ const SocialDeleteConfirmDialog = ({ open, kind, submitting = false, onClose, onConfirm, }) => {
128814
+ const copy = COPY$1[kind];
128815
+ return (React$1.createElement(Dialog$1, { open: open, onClose: submitting ? undefined : onClose, fullWidth: true, maxWidth: "xs", "data-testid": "social-delete-confirm-dialog" },
128816
+ React$1.createElement(DialogTitle$1, null, copy.title),
128817
+ React$1.createElement(DialogContent$1, null,
128818
+ React$1.createElement(DialogContentText$1, null, copy.body)),
128819
+ React$1.createElement(DialogActions$1, null,
128820
+ React$1.createElement(Button$1, { onClick: onClose, disabled: submitting }, "Cancelar"),
128821
+ React$1.createElement(Button$1, { variant: "contained", color: "error", disabled: submitting, onClick: () => void onConfirm() }, "Excluir"))));
128822
+ };
128823
+
128824
+ const SocialEditTextDialog = ({ open, dialogTitle, contentLabel, initialContent, initialTitle = null, showTitle = false, submitting = false, maxLength = 10000, onClose, onSave, }) => {
128825
+ const [title, setTitle] = React$1.useState(initialTitle !== null && initialTitle !== void 0 ? initialTitle : "");
128826
+ const [content, setContent] = React$1.useState(initialContent);
128827
+ React$1.useEffect(() => {
128828
+ if (!open)
128829
+ return;
128830
+ setTitle(initialTitle !== null && initialTitle !== void 0 ? initialTitle : "");
128831
+ setContent(initialContent);
128832
+ }, [open, initialContent, initialTitle]);
128833
+ const trimmed = content.trim();
128834
+ const canSave = trimmed.length > 0 && !submitting;
128835
+ return (React$1.createElement(Dialog$1, { open: open, onClose: submitting ? undefined : onClose, fullWidth: true, maxWidth: "xs", "data-testid": "social-edit-text-dialog" },
128836
+ React$1.createElement(DialogTitle$1, null, dialogTitle),
128837
+ React$1.createElement(DialogContent$1, null,
128838
+ showTitle ? (React$1.createElement(TextField$1, { label: "T\u00EDtulo", value: title, onChange: (event) => setTitle(event.target.value), fullWidth: true, margin: "normal", disabled: submitting, inputProps: { maxLength: 200 } })) : null,
128839
+ React$1.createElement(TextField$1, { label: contentLabel, value: content, onChange: (event) => setContent(event.target.value), fullWidth: true, multiline: true, minRows: 3, margin: "normal", disabled: submitting, inputProps: { maxLength } })),
128840
+ React$1.createElement(DialogActions$1, null,
128841
+ React$1.createElement(Button$1, { onClick: onClose, disabled: submitting }, "Cancelar"),
128842
+ React$1.createElement(Button$1, { variant: "contained", disabled: !canSave, onClick: () => void onSave(Object.assign({ content: trimmed }, (showTitle ? { title: title.trim() || null } : {}))) }, "Salvar"))));
128843
+ };
128844
+
128781
128845
  const ActionCount$1 = ({ count, active }) => count > 0 ? (React$1.createElement(Typography$1, { variant: "caption", color: active ? "primary.main" : "text.secondary", sx: { minWidth: 16 } }, count)) : null;
128782
- const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, onReactionToggle, onShare, onReport, onComment, onBookmark, onAuthorClick, alsoExperiencedLoading = false, compact = false, }) => {
128783
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
128846
+ const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, onReactionToggle, onShare, onReport, onEdit, onDelete, onComment, onBookmark, onAuthorClick, alsoExperiencedLoading = false, compact = false, }) => {
128847
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
128784
128848
  const [menuAnchor, setMenuAnchor] = React$1.useState(null);
128849
+ const [editOpen, setEditOpen] = React$1.useState(false);
128850
+ const [deleteOpen, setDeleteOpen] = React$1.useState(false);
128851
+ const [actionPending, setActionPending] = React$1.useState(false);
128785
128852
  const authorName = authorDisplayName(experience.author, {
128786
128853
  authorId: (_b = (_a = experience.author) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : experience.authorId,
128787
128854
  viewerUserId,
128788
128855
  });
128789
128856
  const username = (_c = experience.author) === null || _c === void 0 ? void 0 : _c.username;
128790
- const verified = Boolean((_d = experience.author) === null || _d === void 0 ? void 0 : _d.verified);
128791
- const timeLabel = formatRelativeTime((_e = experience.publishedAt) !== null && _e !== void 0 ? _e : experience.createdAt);
128792
- const hasImage = Boolean((_f = experience.imageUrl) === null || _f === void 0 ? void 0 : _f.trim());
128857
+ const isAuthor = Boolean(viewerUserId) &&
128858
+ (experience.authorId === viewerUserId ||
128859
+ ((_d = experience.author) === null || _d === void 0 ? void 0 : _d.userId) === viewerUserId);
128860
+ const canEdit = isAuthor && Boolean(onEdit);
128861
+ const canDelete = isAuthor && Boolean(onDelete);
128862
+ const showMenu = Boolean(onShare || (!isAuthor && onReport) || canEdit || canDelete);
128863
+ const verified = Boolean((_e = experience.author) === null || _e === void 0 ? void 0 : _e.verified);
128864
+ const timeLabel = formatRelativeTime((_f = experience.publishedAt) !== null && _f !== void 0 ? _f : experience.createdAt);
128865
+ const hasImage = Boolean((_g = experience.imageUrl) === null || _g === void 0 ? void 0 : _g.trim());
128793
128866
  const postType = resolveExperiencePostType(experience);
128794
128867
  const alsoActive = Boolean(experience.viewerHasAlsoExperienced);
128795
128868
  const bookmarked = Boolean(experience.viewerHasBookmarked);
128796
- const commentCount = (_g = experience.commentCount) !== null && _g !== void 0 ? _g : 0;
128797
- const bookmarkCount = (_h = experience.bookmarkCount) !== null && _h !== void 0 ? _h : 0;
128798
- const shareCount = (_j = experience.shareCount) !== null && _j !== void 0 ? _j : 0;
128799
- const reactionCount = (_k = experience.reactionCount) !== null && _k !== void 0 ? _k : 0;
128800
- const alsoCount = (_l = experience.alsoExperiencedCount) !== null && _l !== void 0 ? _l : 0;
128869
+ const commentCount = (_h = experience.commentCount) !== null && _h !== void 0 ? _h : 0;
128870
+ const bookmarkCount = (_j = experience.bookmarkCount) !== null && _j !== void 0 ? _j : 0;
128871
+ const shareCount = (_k = experience.shareCount) !== null && _k !== void 0 ? _k : 0;
128872
+ const reactionCount = (_l = experience.reactionCount) !== null && _l !== void 0 ? _l : 0;
128873
+ const alsoCount = (_m = experience.alsoExperiencedCount) !== null && _m !== void 0 ? _m : 0;
128801
128874
  const openAuthor = (event) => {
128802
128875
  var _a, _b, _c;
128803
128876
  event.stopPropagation();
@@ -128805,7 +128878,7 @@ const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, o
128805
128878
  };
128806
128879
  return (React$1.createElement(Box$1, { component: "article", sx: socialTimelineRowSx, "data-testid": "experience-card", "data-experience-id": experience.id },
128807
128880
  React$1.createElement(Stack$1, { direction: "row", spacing: 1.5, alignItems: "flex-start" },
128808
- React$1.createElement(Avatar$1, { src: (_o = (_m = experience.author) === null || _m === void 0 ? void 0 : _m.avatarUrl) !== null && _o !== void 0 ? _o : undefined, alt: authorName, onClick: openAuthor, sx: {
128881
+ React$1.createElement(Avatar$1, { src: (_p = (_o = experience.author) === null || _o === void 0 ? void 0 : _o.avatarUrl) !== null && _p !== void 0 ? _p : undefined, alt: authorName, onClick: openAuthor, sx: {
128809
128882
  width: 40,
128810
128883
  height: 40,
128811
128884
  mt: 0.25,
@@ -128832,8 +128905,9 @@ const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, o
128832
128905
  timeLabel ? (React$1.createElement(React$1.Fragment, null,
128833
128906
  React$1.createElement(Typography$1, { component: "span", color: "text.secondary", sx: { fontSize: "0.9375rem" } }, "\u00B7"),
128834
128907
  React$1.createElement(Typography$1, { component: "span", color: "text.secondary", noWrap: true, sx: { fontSize: "0.9375rem" } }, timeLabel))) : null,
128908
+ React$1.createElement(EditedMark, { editedAt: experience.editedAt }),
128835
128909
  React$1.createElement(Box$1, { sx: { flex: 1 } }),
128836
- (onReport || onShare) && (React$1.createElement(React$1.Fragment, null,
128910
+ showMenu ? (React$1.createElement(React$1.Fragment, null,
128837
128911
  React$1.createElement(IconButton$1, { size: "small", "aria-label": "Mais op\u00E7\u00F5es", onClick: (event) => {
128838
128912
  event.stopPropagation();
128839
128913
  setMenuAnchor(event.currentTarget);
@@ -128844,10 +128918,18 @@ const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, o
128844
128918
  setMenuAnchor(null);
128845
128919
  onShare(experience.id);
128846
128920
  } }, "Compartilhar")) : null,
128847
- onReport ? (React$1.createElement(MenuItem$1, { onClick: () => {
128921
+ canEdit ? (React$1.createElement(MenuItem$1, { onClick: () => {
128922
+ setMenuAnchor(null);
128923
+ setEditOpen(true);
128924
+ } }, "Editar")) : null,
128925
+ canDelete ? (React$1.createElement(MenuItem$1, { onClick: () => {
128926
+ setMenuAnchor(null);
128927
+ setDeleteOpen(true);
128928
+ } }, "Excluir")) : null,
128929
+ !isAuthor && onReport ? (React$1.createElement(MenuItem$1, { onClick: () => {
128848
128930
  setMenuAnchor(null);
128849
128931
  onReport(experience.id);
128850
- } }, "Denunciar")) : null)))),
128932
+ } }, "Denunciar")) : null))) : null),
128851
128933
  React$1.createElement(Box$1, { role: onOpen ? "link" : undefined, tabIndex: onOpen ? 0 : undefined, onClick: () => onOpen === null || onOpen === void 0 ? void 0 : onOpen(experience.id), onKeyDown: (event) => {
128852
128934
  if (!onOpen)
128853
128935
  return;
@@ -128903,23 +128985,52 @@ const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, o
128903
128985
  React$1.createElement(Stack$1, { direction: "row", alignItems: "center", spacing: 0.25 },
128904
128986
  React$1.createElement(IconButton$1, { size: "small", "aria-label": "Compartilhar", onClick: () => onShare === null || onShare === void 0 ? void 0 : onShare(experience.id), disabled: !onShare, sx: socialActionIconSx },
128905
128987
  React$1.createElement(ShareOutlined$1, { sx: { fontSize: 18 } })),
128906
- React$1.createElement(ActionCount$1, { count: shareCount })))))));
128988
+ React$1.createElement(ActionCount$1, { count: shareCount }))))),
128989
+ editOpen ? (React$1.createElement(SocialEditTextDialog, { open: true, dialogTitle: "Editar publica\u00E7\u00E3o", contentLabel: "Texto", initialContent: experience.content, initialTitle: experience.title, showTitle: Boolean((_q = experience.title) === null || _q === void 0 ? void 0 : _q.trim()), submitting: actionPending, onClose: () => setEditOpen(false), onSave: (value) => __awaiter$1(void 0, void 0, void 0, function* () {
128990
+ if (!onEdit)
128991
+ return;
128992
+ setActionPending(true);
128993
+ try {
128994
+ yield onEdit(experience.id, value);
128995
+ setEditOpen(false);
128996
+ }
128997
+ finally {
128998
+ setActionPending(false);
128999
+ }
129000
+ }) })) : null,
129001
+ deleteOpen ? (React$1.createElement(SocialDeleteConfirmDialog, { open: true, kind: "post", submitting: actionPending, onClose: () => setDeleteOpen(false), onConfirm: () => __awaiter$1(void 0, void 0, void 0, function* () {
129002
+ if (!onDelete)
129003
+ return;
129004
+ setActionPending(true);
129005
+ try {
129006
+ yield onDelete(experience.id);
129007
+ setDeleteOpen(false);
129008
+ }
129009
+ finally {
129010
+ setActionPending(false);
129011
+ }
129012
+ }) })) : null));
128907
129013
  };
128908
129014
 
128909
- const ExperienceCommentRow = ({ comment, depth = 0, likeDisabled = false, onAuthorClick, onReply, onToggleLike, }) => {
128910
- var _a, _b, _c, _d;
129015
+ const ExperienceCommentRow = ({ comment, depth = 0, likeDisabled = false, viewerUserId, onAuthorClick, onReply, onToggleLike, onEdit, onDelete, }) => {
129016
+ var _a, _b, _c, _d, _e;
129017
+ const [menuAnchor, setMenuAnchor] = React$1.useState(null);
128911
129018
  const name = authorDisplayName(comment.author);
128912
- const username = (_a = comment.author) === null || _a === void 0 ? void 0 : _a.username;
129019
+ const isAuthor = Boolean(viewerUserId) &&
129020
+ (comment.authorId === viewerUserId ||
129021
+ ((_a = comment.author) === null || _a === void 0 ? void 0 : _a.userId) === viewerUserId);
129022
+ const showOwnerMenu = isAuthor && Boolean(onEdit || onDelete);
129023
+ const username = (_b = comment.author) === null || _b === void 0 ? void 0 : _b.username;
128913
129024
  const isReply = depth === 1;
128914
129025
  const avatarSize = isReply ? 28 : 36;
128915
- const likeCount = (_b = comment.likeCount) !== null && _b !== void 0 ? _b : 0;
129026
+ const likeCount = (_c = comment.likeCount) !== null && _c !== void 0 ? _c : 0;
128916
129027
  const liked = Boolean(comment.viewerHasLiked);
128917
129028
  return (React$1.createElement(Stack$1, { direction: "row", spacing: 1.25, alignItems: "flex-start", sx: {
128918
129029
  px: 2,
128919
129030
  py: 1.25,
128920
129031
  pl: isReply ? 7 : 2,
128921
129032
  }, "data-testid": "experience-comment-row" },
128922
- React$1.createElement(Avatar$1, { src: (_d = (_c = comment.author) === null || _c === void 0 ? void 0 : _c.avatarUrl) !== null && _d !== void 0 ? _d : undefined, alt: name, sx: {
129033
+ React$1.createElement(Avatar$1, { src: (_e = (_d = comment.author) === null || _d === void 0 ? void 0 : _d.avatarUrl) !== null && _e !== void 0 ? _e : undefined, alt: name, sx: {
128923
129034
  width: avatarSize,
128924
129035
  height: avatarSize,
128925
129036
  cursor: onAuthorClick ? "pointer" : "default",
@@ -128939,6 +129050,7 @@ const ExperienceCommentRow = ({ comment, depth = 0, likeDisabled = false, onAuth
128939
129050
  React$1.createElement(Box$1, { component: "span", sx: { whiteSpace: "pre-wrap" } }, comment.body)),
128940
129051
  React$1.createElement(Stack$1, { direction: "row", spacing: 1.5, alignItems: "center", sx: { mt: 0.25 } },
128941
129052
  React$1.createElement(Typography$1, { variant: "caption", color: "text.secondary" }, formatRelativeTime(comment.createdAt)),
129053
+ React$1.createElement(EditedMark, { editedAt: comment.editedAt, fontSize: "0.75rem" }),
128942
129054
  onReply ? (React$1.createElement(ButtonBase$1, { onClick: () => onReply(comment), "aria-label": "Responder", sx: {
128943
129055
  typography: "caption",
128944
129056
  fontWeight: 700,
@@ -128947,6 +129059,18 @@ const ExperienceCommentRow = ({ comment, depth = 0, likeDisabled = false, onAuth
128947
129059
  px: 0.25,
128948
129060
  "&:hover": { color: "text.primary" },
128949
129061
  } }, "Responder")) : null)),
129062
+ showOwnerMenu ? (React$1.createElement(React$1.Fragment, null,
129063
+ React$1.createElement(IconButton$1, { size: "small", "aria-label": "Mais op\u00E7\u00F5es do coment\u00E1rio", onClick: (event) => setMenuAnchor(event.currentTarget), sx: socialActionIconSx },
129064
+ React$1.createElement(MoreHoriz$1, { fontSize: "small" })),
129065
+ React$1.createElement(Menu$2, { anchorEl: menuAnchor, open: Boolean(menuAnchor), onClose: () => setMenuAnchor(null) },
129066
+ onEdit ? (React$1.createElement(MenuItem$1, { onClick: () => {
129067
+ setMenuAnchor(null);
129068
+ onEdit(comment);
129069
+ } }, "Editar")) : null,
129070
+ onDelete ? (React$1.createElement(MenuItem$1, { onClick: () => {
129071
+ setMenuAnchor(null);
129072
+ onDelete(comment);
129073
+ } }, "Excluir")) : null))) : null,
128950
129074
  onToggleLike ? (React$1.createElement(Stack$1, { alignItems: "center", sx: { pt: 0.25, minWidth: 28 } },
128951
129075
  React$1.createElement(IconButton$1, { size: "small", "aria-label": liked ? "Remover curtida" : "Curtir", disabled: likeDisabled, onClick: () => onToggleLike(comment), sx: {
128952
129076
  color: liked ? "error.main" : "text.secondary",
@@ -129045,9 +129169,12 @@ const SocialMessageComposer = ({ value, onChange, onSend, isSending = false, dis
129045
129169
  } }, isSending ? (React$1.createElement(CircularProgress$1, { size: 22, color: "inherit" })) : (React$1.createElement(Send, { fontSize: "small" })))))));
129046
129170
  };
129047
129171
 
129048
- const ExperienceCommentsSheet = ({ open, comments = [], commentCount, isLoading = false, isFetchingMore = false, hasMore = false, isSubmitting = false, error = null, composerDisabled = false, onClose, onLoadMore, onLoadMoreReplies, onSubmitComment, onRetry, onAuthorClick, onToggleLike, }) => {
129172
+ const ExperienceCommentsSheet = ({ open, comments = [], commentCount, isLoading = false, isFetchingMore = false, hasMore = false, isSubmitting = false, error = null, composerDisabled = false, onClose, onLoadMore, onLoadMoreReplies, onSubmitComment, onRetry, onAuthorClick, onToggleLike, viewerUserId, onEditComment, onDeleteComment, }) => {
129049
129173
  var _a;
129050
129174
  const [draft, setDraft] = React$1.useState("");
129175
+ const [editing, setEditing] = React$1.useState(null);
129176
+ const [deleting, setDeleting] = React$1.useState(null);
129177
+ const [actionPending, setActionPending] = React$1.useState(false);
129051
129178
  const [replyTarget, setReplyTarget] = React$1.useState(null);
129052
129179
  const [loadingRepliesFor, setLoadingRepliesFor] = React$1.useState(null);
129053
129180
  const listRef = React$1.useRef(null);
@@ -129057,6 +129184,8 @@ const ExperienceCommentsSheet = ({ open, comments = [], commentCount, isLoading
129057
129184
  setDraft("");
129058
129185
  setReplyTarget(null);
129059
129186
  setLoadingRepliesFor(null);
129187
+ setEditing(null);
129188
+ setDeleting(null);
129060
129189
  }
129061
129190
  }, [open]);
129062
129191
  React$1.useEffect(() => {
@@ -129132,8 +129261,8 @@ const ExperienceCommentsSheet = ({ open, comments = [], commentCount, isLoading
129132
129261
  (Boolean(comment.repliesHasMore) ||
129133
129262
  replyCount > replies.length);
129134
129263
  return (React$1.createElement(Box$1, { key: comment.id },
129135
- React$1.createElement(ExperienceCommentRow, { comment: comment, depth: 0, likeDisabled: composerDisabled, onAuthorClick: onAuthorClick, onReply: onSubmitComment ? startReply : undefined, onToggleLike: onToggleLike }),
129136
- replies.map((reply) => (React$1.createElement(ExperienceCommentRow, { key: reply.id, comment: reply, depth: 1, likeDisabled: composerDisabled, onAuthorClick: onAuthorClick, onReply: onSubmitComment ? startReply : undefined, onToggleLike: onToggleLike }))),
129264
+ React$1.createElement(ExperienceCommentRow, { comment: comment, depth: 0, likeDisabled: composerDisabled, viewerUserId: viewerUserId, onAuthorClick: onAuthorClick, onReply: onSubmitComment ? startReply : undefined, onToggleLike: onToggleLike, onEdit: onEditComment ? setEditing : undefined, onDelete: onDeleteComment ? setDeleting : undefined }),
129265
+ replies.map((reply) => (React$1.createElement(ExperienceCommentRow, { key: reply.id, comment: reply, depth: 1, likeDisabled: composerDisabled, viewerUserId: viewerUserId, onAuthorClick: onAuthorClick, onReply: onSubmitComment ? startReply : undefined, onToggleLike: onToggleLike, onEdit: onEditComment ? setEditing : undefined, onDelete: onDeleteComment ? setDeleting : undefined }))),
129137
129266
  showViewReplies ? (React$1.createElement(Box$1, { sx: { pl: 7, pb: 1 } },
129138
129267
  React$1.createElement(ButtonBase$1, { onClick: () => void handleLoadReplies(comment.id), disabled: loadingRepliesFor === comment.id, "aria-label": "Ver respostas", sx: {
129139
129268
  typography: "caption",
@@ -129163,7 +129292,31 @@ const ExperienceCommentsSheet = ({ open, comments = [], commentCount, isLoading
129163
129292
  React$1.createElement(default_1$N, { fontSize: "small" })))) : null,
129164
129293
  React$1.createElement(SocialMessageComposer, { variant: "drawer", value: draft, onChange: setDraft, onSend: (message) => void handleSend(message), isSending: isSubmitting, disabled: composerDisabled || !onSubmitComment, placeholder: replyTarget
129165
129294
  ? "Adicione uma resposta..."
129166
- : "Adicione um comentário...", maxLength: 2000 }))));
129295
+ : "Adicione um comentário...", maxLength: 2000 }),
129296
+ editing ? (React$1.createElement(SocialEditTextDialog, { open: true, dialogTitle: editing.parentId ? "Editar resposta" : "Editar comentário", contentLabel: "Texto", initialContent: editing.body, submitting: actionPending, maxLength: 2000, onClose: () => setEditing(null), onSave: (value) => __awaiter$1(void 0, void 0, void 0, function* () {
129297
+ if (!onEditComment)
129298
+ return;
129299
+ setActionPending(true);
129300
+ try {
129301
+ yield onEditComment(editing, value.content);
129302
+ setEditing(null);
129303
+ }
129304
+ finally {
129305
+ setActionPending(false);
129306
+ }
129307
+ }) })) : null,
129308
+ deleting ? (React$1.createElement(SocialDeleteConfirmDialog, { open: true, kind: deleting.parentId ? "reply" : "comment", submitting: actionPending, onClose: () => setDeleting(null), onConfirm: () => __awaiter$1(void 0, void 0, void 0, function* () {
129309
+ if (!onDeleteComment)
129310
+ return;
129311
+ setActionPending(true);
129312
+ try {
129313
+ yield onDeleteComment(deleting);
129314
+ setDeleting(null);
129315
+ }
129316
+ finally {
129317
+ setActionPending(false);
129318
+ }
129319
+ }) })) : null)));
129167
129320
  };
129168
129321
 
129169
129322
  const DEFAULT_OPTIONS = [
@@ -129318,9 +129471,12 @@ const SimilarExperienceCard = ({ experience, onOpen, }) => {
129318
129471
  } }, experience.title || experience.content)))));
129319
129472
  };
129320
129473
 
129321
- const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserId, alsoExperiencedLoading, onAlsoExperienced, onReactionToggle, onComment, onShare, onReport, onAuthorClick, onSimilarOpen, }) => {
129322
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
129474
+ const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserId, alsoExperiencedLoading, onAlsoExperienced, onReactionToggle, onComment, onShare, onReport, onEdit, onDelete, onAuthorClick, onSimilarOpen, }) => {
129475
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
129323
129476
  const [menuAnchor, setMenuAnchor] = React$1.useState(null);
129477
+ const [editOpen, setEditOpen] = React$1.useState(false);
129478
+ const [deleteOpen, setDeleteOpen] = React$1.useState(false);
129479
+ const [actionPending, setActionPending] = React$1.useState(false);
129324
129480
  const authorName = authorDisplayName(experience.author, {
129325
129481
  authorId: (_b = (_a = experience.author) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : experience.authorId,
129326
129482
  viewerUserId,
@@ -129330,6 +129486,9 @@ const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserI
129330
129486
  const isAuthor = Boolean(viewerUserId) &&
129331
129487
  (experience.authorId === viewerUserId ||
129332
129488
  ((_e = experience.author) === null || _e === void 0 ? void 0 : _e.userId) === viewerUserId);
129489
+ const canEdit = isAuthor && Boolean(onEdit);
129490
+ const canDelete = isAuthor && Boolean(onDelete);
129491
+ const showMenu = Boolean(onShare || (!isAuthor && onReport) || canEdit || canDelete);
129333
129492
  const hasImage = Boolean((_f = experience.imageUrl) === null || _f === void 0 ? void 0 : _f.trim());
129334
129493
  const commentCount = (_g = experience.commentCount) !== null && _g !== void 0 ? _g : 0;
129335
129494
  const shareCount = (_h = experience.shareCount) !== null && _h !== void 0 ? _h : 0;
@@ -129372,8 +129531,9 @@ const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserI
129372
129531
  timeLabel ? (React$1.createElement(React$1.Fragment, null,
129373
129532
  React$1.createElement(Typography$1, { component: "span", color: "text.secondary", sx: { fontSize: "0.9375rem" } }, "\u00B7"),
129374
129533
  React$1.createElement(Typography$1, { component: "span", color: "text.secondary", noWrap: true, sx: { fontSize: "0.9375rem" } }, timeLabel))) : null,
129534
+ React$1.createElement(EditedMark, { editedAt: experience.editedAt }),
129375
129535
  React$1.createElement(Box$1, { sx: { flex: 1 } }),
129376
- (!isAuthor && (onReport || onShare)) || (isAuthor && onShare) ? (React$1.createElement(React$1.Fragment, null,
129536
+ showMenu ? (React$1.createElement(React$1.Fragment, null,
129377
129537
  React$1.createElement(IconButton$1, { size: "small", "aria-label": "Mais op\u00E7\u00F5es", onClick: (event) => setMenuAnchor(event.currentTarget), sx: socialActionIconSx },
129378
129538
  React$1.createElement(default_1$K, { fontSize: "small" })),
129379
129539
  React$1.createElement(Menu$2, { anchorEl: menuAnchor, open: Boolean(menuAnchor), onClose: () => setMenuAnchor(null) },
@@ -129381,6 +129541,14 @@ const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserI
129381
129541
  setMenuAnchor(null);
129382
129542
  onShare();
129383
129543
  } }, "Compartilhar")) : null,
129544
+ canEdit ? (React$1.createElement(MenuItem$1, { onClick: () => {
129545
+ setMenuAnchor(null);
129546
+ setEditOpen(true);
129547
+ } }, "Editar")) : null,
129548
+ canDelete ? (React$1.createElement(MenuItem$1, { onClick: () => {
129549
+ setMenuAnchor(null);
129550
+ setDeleteOpen(true);
129551
+ } }, "Excluir")) : null,
129384
129552
  !isAuthor && onReport ? (React$1.createElement(MenuItem$1, { onClick: () => {
129385
129553
  setMenuAnchor(null);
129386
129554
  onReport();
@@ -129431,7 +129599,31 @@ const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserI
129431
129599
  borderBottom: 1,
129432
129600
  borderColor: "divider",
129433
129601
  } }, "Semelhantes"),
129434
- similarExperiences.map((item) => (React$1.createElement(SimilarExperienceCard, { key: item.id, experience: item, onOpen: onSimilarOpen }))))) : null));
129602
+ similarExperiences.map((item) => (React$1.createElement(SimilarExperienceCard, { key: item.id, experience: item, onOpen: onSimilarOpen }))))) : null,
129603
+ editOpen ? (React$1.createElement(SocialEditTextDialog, { open: true, dialogTitle: "Editar publica\u00E7\u00E3o", contentLabel: "Texto", initialContent: experience.content, initialTitle: experience.title, showTitle: Boolean((_p = experience.title) === null || _p === void 0 ? void 0 : _p.trim()), submitting: actionPending, onClose: () => setEditOpen(false), onSave: (value) => __awaiter$1(void 0, void 0, void 0, function* () {
129604
+ if (!onEdit)
129605
+ return;
129606
+ setActionPending(true);
129607
+ try {
129608
+ yield onEdit(value);
129609
+ setEditOpen(false);
129610
+ }
129611
+ finally {
129612
+ setActionPending(false);
129613
+ }
129614
+ }) })) : null,
129615
+ deleteOpen ? (React$1.createElement(SocialDeleteConfirmDialog, { open: true, kind: "post", submitting: actionPending, onClose: () => setDeleteOpen(false), onConfirm: () => __awaiter$1(void 0, void 0, void 0, function* () {
129616
+ if (!onDelete)
129617
+ return;
129618
+ setActionPending(true);
129619
+ try {
129620
+ yield onDelete();
129621
+ setDeleteOpen(false);
129622
+ }
129623
+ finally {
129624
+ setActionPending(false);
129625
+ }
129626
+ }) })) : null));
129435
129627
  };
129436
129628
 
129437
129629
  const QuestionSourceBadge = ({ source }) => {
@@ -147054,6 +147246,7 @@ const ACTION_ICON_MAP = {
147054
147246
  "🧘": React$1.createElement(Spa, null),
147055
147247
  "🎓": React$1.createElement(School$1, null),
147056
147248
  "🌐": React$1.createElement(Public, null),
147249
+ place: React$1.createElement(Place, null),
147057
147250
  social: React$1.createElement(Public, null),
147058
147251
  public: React$1.createElement(Public, null),
147059
147252
  };
@@ -147712,7 +147905,7 @@ function getEventCoordinates(event) {
147712
147905
  return null;
147713
147906
  }
147714
147907
 
147715
- const CSS = /*#__PURE__*/Object.freeze({
147908
+ const CSS$1 = /*#__PURE__*/Object.freeze({
147716
147909
  Translate: {
147717
147910
  toString(transform) {
147718
147911
  if (!transform) {
@@ -147747,7 +147940,7 @@ const CSS = /*#__PURE__*/Object.freeze({
147747
147940
  return;
147748
147941
  }
147749
147942
 
147750
- return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' ');
147943
+ return [CSS$1.Translate.toString(transform), CSS$1.Scale.toString(transform)].join(' ');
147751
147944
  }
147752
147945
 
147753
147946
  },
@@ -151586,7 +151779,7 @@ const defaultTransition = {
151586
151779
  easing: 'ease'
151587
151780
  };
151588
151781
  const transitionProperty = 'transform';
151589
- const disabledTransition = /*#__PURE__*/CSS.Transition.toString({
151782
+ const disabledTransition = /*#__PURE__*/CSS$1.Transition.toString({
151590
151783
  property: transitionProperty,
151591
151784
  duration: 0,
151592
151785
  easing: 'linear'
@@ -151820,7 +152013,7 @@ function useSortable(_ref) {
151820
152013
  }
151821
152014
 
151822
152015
  if (isSorting || shouldAnimateLayoutChanges) {
151823
- return CSS.Transition.toString({ ...transition,
152016
+ return CSS$1.Transition.toString({ ...transition,
151824
152017
  property: transitionProperty
151825
152018
  });
151826
152019
  }
@@ -152507,7 +152700,7 @@ const SortableOrderRow = ({ widget, index, total, onMove }) => {
152507
152700
  const theme = useTheme$1();
152508
152701
  const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging, } = useSortable({ id: widget.id });
152509
152702
  return (React$1.createElement(Box$1, { ref: setNodeRef, style: {
152510
- transform: CSS.Transform.toString(transform),
152703
+ transform: CSS$1.Transform.toString(transform),
152511
152704
  transition,
152512
152705
  }, sx: {
152513
152706
  display: "flex",
@@ -154843,6 +155036,14 @@ const useHomePage = (props) => {
154843
155036
  route: "/terreiro",
154844
155037
  color: "primary",
154845
155038
  },
155039
+ {
155040
+ id: "terreiro-search",
155041
+ title: "Terreiros",
155042
+ description: "Buscar casas próximas",
155043
+ icon: "place",
155044
+ route: "/terreiros/buscar",
155045
+ color: "primary",
155046
+ },
154846
155047
  {
154847
155048
  id: "mediums",
154848
155049
  title: "Médiuns",
@@ -154978,6 +155179,7 @@ const useHomePage = (props) => {
154978
155179
  // Admin + personal: include Social when feature enabled
154979
155180
  return withSocialUnreadBadge(filterByIds(withSocialPersonalOnly(withIngressos([
154980
155181
  "terreiro",
155182
+ "terreiro-search",
154981
155183
  "activities",
154982
155184
  "ritual-baths",
154983
155185
  "inventory",
@@ -154989,6 +155191,7 @@ const useHomePage = (props) => {
154989
155191
  // Admin + terreiro: no Social
154990
155192
  return filterByIds(withIngressos([
154991
155193
  "terreiro",
155194
+ "terreiro-search",
154992
155195
  "mediums",
154993
155196
  "activities",
154994
155197
  "events",
@@ -155003,6 +155206,7 @@ const useHomePage = (props) => {
155003
155206
  if (selectedTerreiro) {
155004
155207
  const filtered = filterByIds(withIngressos([
155005
155208
  "terreiro",
155209
+ "terreiro-search",
155006
155210
  "mediums",
155007
155211
  "activities",
155008
155212
  "events",
@@ -155016,6 +155220,7 @@ const useHomePage = (props) => {
155016
155220
  // Non-admin + personal profile: include Social when feature enabled
155017
155221
  return withSocialUnreadBadge(filterByIds(withSocialPersonalOnly([
155018
155222
  "terreiro",
155223
+ "terreiro-search",
155019
155224
  "activities",
155020
155225
  "ritual-baths",
155021
155226
  "inventory",
@@ -160853,7 +161058,7 @@ const FormGrid$8 = styled$1(Grid$1)(({ theme }) => ({
160853
161058
  const CEP_MIN_LENGTH = 8;
160854
161059
  const ZIP_PLACEHOLDER = "00000-000";
160855
161060
  const ADORNMENT_SPINNER_SIZE = 20;
160856
- const GOOGLE_SEARCH_PLACEHOLDER = "Digite o endereço para buscar no Google";
161061
+ const GOOGLE_SEARCH_PLACEHOLDER$1 = "Digite o endereço para buscar no Google";
160857
161062
  const AddressPage = (props) => {
160858
161063
  const theme = useTheme$1();
160859
161064
  const { data, fns } = useAddressPage(props);
@@ -160925,7 +161130,7 @@ const AddressPage = (props) => {
160925
161130
  }
160926
161131
  }, onChange: (_, newValue) => {
160927
161132
  fns.handleGoogleSuggestionSelect(newValue);
160928
- }, renderInput: (params) => (React$1.createElement(TextField$1, Object.assign({}, params, { label: "Buscar endere\u00E7o", placeholder: GOOGLE_SEARCH_PLACEHOLDER, fullWidth: true, "data-testid": "address-google-search", InputProps: Object.assign(Object.assign({}, params.InputProps), { startAdornment: (React$1.createElement(InputAdornment$1, { position: "start" },
161133
+ }, renderInput: (params) => (React$1.createElement(TextField$1, Object.assign({}, params, { label: "Buscar endere\u00E7o", placeholder: GOOGLE_SEARCH_PLACEHOLDER$1, fullWidth: true, "data-testid": "address-google-search", InputProps: Object.assign(Object.assign({}, params.InputProps), { startAdornment: (React$1.createElement(InputAdornment$1, { position: "start" },
160929
161134
  React$1.createElement(LocationOn, { sx: { color: theme.palette.text.secondary } }))) }) }))) }),
160930
161135
  data.googleSearchError && (React$1.createElement(Box$1, { sx: { mt: 1 } },
160931
161136
  React$1.createElement(Alert$1, { severity: "warning" }, data.googleSearchError))),
@@ -178311,8 +178516,8 @@ const SocialHomePage = (props) => {
178311
178516
  : undefined, onAction: tab === "para-voce"
178312
178517
  ? props.onCreateExperience
178313
178518
  : props.onOpenFollow })) : (React$1.createElement(InfiniteScroll, { hasNextPage: feedHasNextPage, isFetchingNextPage: feedIsFetchingNextPage, onLoadMore: onFeedLoadMore !== null && onFeedLoadMore !== void 0 ? onFeedLoadMore : (() => undefined) },
178314
- React$1.createElement(Box$1, { sx: { border: "none" } }, feed.map((item) => item.kind === "experience" ? (React$1.createElement(ExperienceCard, { key: `experience-${item.id}`, experience: item.experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onShare: props.onShareExperience, onReport: props.onReportExperience, onComment: openComments, onBookmark: props.onBookmarkExperience, onAuthorClick: props.onOpenPerson, alsoExperiencedLoading: props.alsoExperiencedLoadingId === item.id })) : (React$1.createElement(QuestionCard, { key: `question-${item.id}`, question: item.question, viewerUserId: props.viewerUserId, onOpen: openAnswers, onOpenAnswers: openAnswers, onBookmark: props.onBookmarkQuestion, onShare: props.onShareQuestion, onReactionToggle: props.onReactionToggleQuestion, onAuthorClick: props.onOpenPerson }))))))),
178315
- React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_k = (_j = props.commentsCount) !== null && _j !== void 0 ? _j : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _k !== void 0 ? _k : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson }),
178519
+ React$1.createElement(Box$1, { sx: { border: "none" } }, feed.map((item) => item.kind === "experience" ? (React$1.createElement(ExperienceCard, { key: `experience-${item.id}`, experience: item.experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onShare: props.onShareExperience, onReport: props.onReportExperience, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, onComment: openComments, onBookmark: props.onBookmarkExperience, onAuthorClick: props.onOpenPerson, alsoExperiencedLoading: props.alsoExperiencedLoadingId === item.id })) : (React$1.createElement(QuestionCard, { key: `question-${item.id}`, question: item.question, viewerUserId: props.viewerUserId, onOpen: openAnswers, onOpenAnswers: openAnswers, onBookmark: props.onBookmarkQuestion, onShare: props.onShareQuestion, onReactionToggle: props.onReactionToggleQuestion, onAuthorClick: props.onOpenPerson }))))))),
178520
+ React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_k = (_j = props.commentsCount) !== null && _j !== void 0 ? _j : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _k !== void 0 ? _k : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson, viewerUserId: props.viewerUserId, onEditComment: props.onEditComment, onDeleteComment: props.onDeleteComment }),
178316
178521
  React$1.createElement(QuestionAnswersSheet, { open: Boolean(answersQuestionId), questionId: answersQuestionId, questionTitle: answersTarget === null || answersTarget === void 0 ? void 0 : answersTarget.title, answers: props.answers, answerCount: (_m = (_l = props.answersCount) !== null && _l !== void 0 ? _l : answersTarget === null || answersTarget === void 0 ? void 0 : answersTarget.answerCount) !== null && _m !== void 0 ? _m : undefined, isLoading: props.answersLoading, isSubmitting: props.answersSubmitting, error: props.answersError, onClose: closeAnswers, onRetry: props.onRetryAnswers, onSubmitAnswer: props.onSubmitAnswer, onAuthorClick: props.onOpenPerson }),
178317
178522
  hasCreateActions ? (React$1.createElement(React$1.Fragment, null,
178318
178523
  React$1.createElement(Fab$1, { color: "primary", "aria-label": "Criar", "data-testid": "social-create-fab", onClick: openCreateSheet, sx: {
@@ -178614,10 +178819,10 @@ const ExperienceDetailPage = (props) => {
178614
178819
  (_a = props.onCloseComments) === null || _a === void 0 ? void 0 : _a.call(props);
178615
178820
  };
178616
178821
  return (React$1.createElement(SocialPageShell, { title: "Experi\u00EAncia", onBack: props.onBack }, props.isLoading ? (React$1.createElement(SocialSkeleton, { count: 1 })) : props.error ? (React$1.createElement(SocialErrorState, { message: props.error, onRetry: props.onRetry })) : props.experience ? (React$1.createElement(React$1.Fragment, null,
178617
- React$1.createElement(ExperienceDetailView, { experience: props.experience, similarExperiences: props.similarExperiences, viewerUserId: props.viewerUserId, alsoExperiencedLoading: props.alsoExperiencedLoading, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onComment: openComments, onShare: props.onShare, onReport: props.onReport, onAuthorClick: props.onAuthorClick, onSimilarOpen: props.onSimilarOpen }),
178822
+ React$1.createElement(ExperienceDetailView, { experience: props.experience, similarExperiences: props.similarExperiences, viewerUserId: props.viewerUserId, alsoExperiencedLoading: props.alsoExperiencedLoading, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onComment: openComments, onShare: props.onShare, onReport: props.onReport, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, onAuthorClick: props.onAuthorClick, onSimilarOpen: props.onSimilarOpen }),
178618
178823
  React$1.createElement(ShareSheet, { open: Boolean(props.shareOpen), onClose: (_b = props.onShareClose) !== null && _b !== void 0 ? _b : (() => undefined), previewText: (_c = props.sharePreviewText) !== null && _c !== void 0 ? _c : "Uma experiência na comunidade", shareUrl: (_d = props.shareUrl) !== null && _d !== void 0 ? _d : "", onWhatsAppShare: props.onWhatsAppShare, onCopyLink: props.onCopyLink, onShareStarted: props.onShareStarted }),
178619
178824
  React$1.createElement(ReportDialog, { open: Boolean(props.reportOpen), onClose: (_e = props.onReportClose) !== null && _e !== void 0 ? _e : (() => undefined), onSubmit: (_f = props.onReportSubmit) !== null && _f !== void 0 ? _f : (() => undefined) }),
178620
- React$1.createElement(ExperienceCommentsSheet, { open: commentsOpen, experienceId: props.experience.id, comments: props.comments, commentCount: (_h = (_g = props.commentsCount) !== null && _g !== void 0 ? _g : props.experience.commentCount) !== null && _h !== void 0 ? _h : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onCommentAuthorClick }))) : (React$1.createElement(SocialErrorState, { title: "Experi\u00EAncia n\u00E3o encontrada", message: "Este conte\u00FAdo pode ter sido removido ou n\u00E3o est\u00E1 dispon\u00EDvel.", onRetry: props.onRetry }))));
178825
+ React$1.createElement(ExperienceCommentsSheet, { open: commentsOpen, experienceId: props.experience.id, comments: props.comments, commentCount: (_h = (_g = props.commentsCount) !== null && _g !== void 0 ? _g : props.experience.commentCount) !== null && _h !== void 0 ? _h : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onCommentAuthorClick, viewerUserId: props.viewerUserId, onEditComment: props.onEditComment, onDeleteComment: props.onDeleteComment }))) : (React$1.createElement(SocialErrorState, { title: "Experi\u00EAncia n\u00E3o encontrada", message: "Este conte\u00FAdo pode ter sido removido ou n\u00E3o est\u00E1 dispon\u00EDvel.", onRetry: props.onRetry }))));
178621
178826
  };
178622
178827
 
178623
178828
  const QuestionsPage = ({ questions = [], isLoading, error, onBack, onRetry, onOpenQuestion, onCreateQuestion, }) => (React$1.createElement(SocialPageShell, { title: "Perguntas", onBack: onBack },
@@ -178746,12 +178951,13 @@ const stubEmptyCopy = {
178746
178951
  },
178747
178952
  };
178748
178953
  const JourneyProfilePage = (props) => {
178749
- var _a, _b, _c, _d, _e, _f, _g, _h;
178954
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
178750
178955
  const [contentTab, setContentTab] = React$1.useState("posts");
178751
178956
  const [commentsExperienceId, setCommentsExperienceId] = React$1.useState(null);
178752
178957
  const experiences = (_a = props.experiences) !== null && _a !== void 0 ? _a : [];
178753
178958
  (_b = props.similarPeople) !== null && _b !== void 0 ? _b : [];
178754
178959
  const isOwn = props.isOwnProfile || ((_c = props.profile) === null || _c === void 0 ? void 0 : _c.connectionStatus) === "SELF";
178960
+ const viewerUserId = (_d = props.viewerUserId) !== null && _d !== void 0 ? _d : (isOwn ? (_e = props.profile) === null || _e === void 0 ? void 0 : _e.userId : undefined);
178755
178961
  const commentsTarget = commentsExperienceId == null
178756
178962
  ? undefined
178757
178963
  : experiences.find((item) => item.id === commentsExperienceId);
@@ -178766,7 +178972,7 @@ const JourneyProfilePage = (props) => {
178766
178972
  (_a = props.onCloseComments) === null || _a === void 0 ? void 0 : _a.call(props);
178767
178973
  };
178768
178974
  return (React$1.createElement(SocialPageShell, { title: "Jornada", onBack: props.onBack, hideHeader: true }, props.isLoading ? (React$1.createElement(SocialSkeleton, { variant: "profile", count: 1 })) : props.error ? (React$1.createElement(SocialErrorState, { message: props.error, onRetry: props.onRetry })) : props.profile ? (React$1.createElement(React$1.Fragment, null,
178769
- React$1.createElement(JourneyProfile, { profile: props.profile, isOwnProfile: isOwn, connectionLoading: props.connectionLoading, onBack: props.onBack, onSearch: props.onSearch, onMore: (_d = props.onMore) !== null && _d !== void 0 ? _d : (isOwn ? undefined : props.onBlockOpen), onConnect: props.onConnect, onDisconnect: props.onDisconnect, onMessage: props.onMessage, onEdit: props.onEdit, onShare: props.onShare, onBlock: props.onBlockOpen, onOpenJoined: props.onOpenJoined, onOpenFollowing: props.onOpenFollowing, onOpenFollowers: props.onOpenFollowers, showVerificationBanner: Boolean(props.showVerificationBanner) && isOwn, verificationBannerMode: props.verificationBannerMode, verificationDaysRemaining: props.verificationDaysRemaining, onOpenVerificationProgress: props.onOpenVerificationProgress, onGetVerification: props.onGetVerification, onDismissVerification: props.onDismissVerification, experiencesCount: props.experiencesCount, connectionsCount: props.connectionsCount }),
178975
+ React$1.createElement(JourneyProfile, { profile: props.profile, isOwnProfile: isOwn, connectionLoading: props.connectionLoading, onBack: props.onBack, onSearch: props.onSearch, onMore: (_f = props.onMore) !== null && _f !== void 0 ? _f : (isOwn ? undefined : props.onBlockOpen), onConnect: props.onConnect, onDisconnect: props.onDisconnect, onMessage: props.onMessage, onEdit: props.onEdit, onShare: props.onShare, onBlock: props.onBlockOpen, onOpenJoined: props.onOpenJoined, onOpenFollowing: props.onOpenFollowing, onOpenFollowers: props.onOpenFollowers, showVerificationBanner: Boolean(props.showVerificationBanner) && isOwn, verificationBannerMode: props.verificationBannerMode, verificationDaysRemaining: props.verificationDaysRemaining, onOpenVerificationProgress: props.onOpenVerificationProgress, onGetVerification: props.onGetVerification, onDismissVerification: props.onDismissVerification, experiencesCount: props.experiencesCount, connectionsCount: props.connectionsCount }),
178770
178976
  React$1.createElement(Tabs$1, { value: contentTab, onChange: (_, value) => setContentTab(value), variant: "fullWidth", "aria-label": "Conte\u00FAdo da jornada", sx: {
178771
178977
  borderBottom: 1,
178772
178978
  borderColor: "divider",
@@ -178787,14 +178993,11 @@ const JourneyProfilePage = (props) => {
178787
178993
  } },
178788
178994
  React$1.createElement(Tab$1, { value: "posts", label: "Posts", disableRipple: true }),
178789
178995
  React$1.createElement(Tab$1, { value: "replies", "aria-label": "Respostas", icon: React$1.createElement(ChatBubbleOutline$1, { fontSize: "small" }), disableRipple: true })),
178790
- contentTab === "posts" ? (experiences.length === 0 ? (React$1.createElement(SocialEmptyState, { title: "Sem experi\u00EAncias p\u00FAblicas", description: "Esta jornada ainda n\u00E3o tem experi\u00EAncias vis\u00EDveis.", actionLabel: isOwn ? "Compartilhar experiência" : undefined, onAction: isOwn ? props.onCreateExperience : undefined })) : (React$1.createElement(Box$1, null, experiences.map((experience) => {
178791
- var _a;
178792
- return (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: isOwn ? (_a = props.profile) === null || _a === void 0 ? void 0 : _a.userId : undefined, onOpen: props.onOpenExperience, onComment: openComments, onAuthorClick: props.onOpenPerson, compact: true }));
178793
- })))) : (React$1.createElement(SocialEmptyState, { title: stubEmptyCopy[contentTab].title, description: stubEmptyCopy[contentTab].description })),
178996
+ contentTab === "posts" ? (experiences.length === 0 ? (React$1.createElement(SocialEmptyState, { title: "Sem experi\u00EAncias p\u00FAblicas", description: "Esta jornada ainda n\u00E3o tem experi\u00EAncias vis\u00EDveis.", actionLabel: isOwn ? "Compartilhar experiência" : undefined, onAction: isOwn ? props.onCreateExperience : undefined })) : (React$1.createElement(Box$1, null, experiences.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: viewerUserId, onOpen: props.onOpenExperience, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, onComment: openComments, onAuthorClick: props.onOpenPerson, compact: true })))))) : (React$1.createElement(SocialEmptyState, { title: stubEmptyCopy[contentTab].title, description: stubEmptyCopy[contentTab].description })),
178794
178997
  isOwn && props.onCreateExperience ? (React$1.createElement(Fab$1, { color: "primary", "aria-label": "Nova experi\u00EAncia", onClick: props.onCreateExperience, sx: { position: "fixed", bottom: 24, right: 16, zIndex: 10 } },
178795
178998
  React$1.createElement(Add$1, null))) : null,
178796
- React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_f = (_e = props.commentsCount) !== null && _e !== void 0 ? _e : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _f !== void 0 ? _f : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson }),
178797
- React$1.createElement(BlockDialog, { open: Boolean(props.blockOpen), displayName: props.profile.displayName || props.profile.username || undefined, onClose: (_g = props.onBlockClose) !== null && _g !== void 0 ? _g : (() => undefined), onConfirm: (_h = props.onBlockConfirm) !== null && _h !== void 0 ? _h : (() => undefined) }))) : (React$1.createElement(Box$1, { sx: { pt: 2 } },
178999
+ React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_h = (_g = props.commentsCount) !== null && _g !== void 0 ? _g : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _h !== void 0 ? _h : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson, viewerUserId: viewerUserId, onEditComment: props.onEditComment, onDeleteComment: props.onDeleteComment }),
179000
+ React$1.createElement(BlockDialog, { open: Boolean(props.blockOpen), displayName: props.profile.displayName || props.profile.username || undefined, onClose: (_j = props.onBlockClose) !== null && _j !== void 0 ? _j : (() => undefined), onConfirm: (_k = props.onBlockConfirm) !== null && _k !== void 0 ? _k : (() => undefined) }))) : (React$1.createElement(Box$1, { sx: { pt: 2 } },
178798
179001
  props.onBack ? (React$1.createElement(Typography$1, { component: "button", onClick: props.onBack, sx: {
178799
179002
  display: "block",
178800
179003
  mx: 2,
@@ -179554,7 +179757,7 @@ const SocialDiscoverPage = (props) => {
179554
179757
  const renderMixed = (experienceItems, questionItems, peopleItems, sectioned) => (React$1.createElement(Box$1, null,
179555
179758
  experienceItems.length > 0 ? (React$1.createElement(Box$1, null,
179556
179759
  sectioned ? (React$1.createElement(Typography$1, { component: "h2", sx: sectionTitleSx$1 }, "Experi\u00EAncias")) : null,
179557
- experienceItems.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, onOpen: props.onOpenExperience, compact: true }))),
179760
+ experienceItems.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, compact: true }))),
179558
179761
  sectioned ? (React$1.createElement(DiscoverSeeMoreRow, { label: "Ver mais experi\u00EAncias", onSeeMore: () => goToTab("experiences") })) : null)) : null,
179559
179762
  questionItems.length > 0 ? (React$1.createElement(Box$1, null,
179560
179763
  sectioned ? (React$1.createElement(Typography$1, { component: "h2", sx: sectionTitleSx$1 }, "Perguntas")) : null,
@@ -179588,7 +179791,7 @@ const SocialDiscoverPage = (props) => {
179588
179791
  return (React$1.createElement(SocialErrorState, { message: props.error, onRetry: props.onRetry }));
179589
179792
  }
179590
179793
  if (tab === "experiences" && experiences.length > 0) {
179591
- return (React$1.createElement(Box$1, null, experiences.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, onOpen: props.onOpenExperience, compact: true })))));
179794
+ return (React$1.createElement(Box$1, null, experiences.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, compact: true })))));
179592
179795
  }
179593
179796
  if (tab === "questions" && questions.length > 0) {
179594
179797
  return (React$1.createElement(Box$1, null, questions.map((question) => (React$1.createElement(QuestionCard, { key: question.id, question: question, onOpen: props.onOpenQuestion, onOpenAnswers: props.onOpenQuestionAnswers, onBookmark: props.onBookmarkQuestion, onShare: props.onShareQuestion, onReactionToggle: props.onReactionToggleQuestion, onAuthorClick: props.onOpenPerson })))));
@@ -179768,12 +179971,12 @@ const SocialSavedPage = (props) => {
179768
179971
  showExperiences && experiences.length > 0 ? (React$1.createElement(InfiniteScroll, { hasNextPage: Boolean(props.hasNextPage), isFetchingNextPage: Boolean(props.isFetchingNextPage), onLoadMore: (_d = props.onLoadMore) !== null && _d !== void 0 ? _d : (() => undefined) },
179769
179972
  React$1.createElement(Box$1, { sx: { border: "none" } },
179770
179973
  tab === "all" ? (React$1.createElement(Typography$1, { sx: sectionTitleSx }, "Experi\u00EAncias")) : null,
179771
- experiences.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onShare: props.onShareExperience, onComment: openComments, onBookmark: props.onBookmarkExperience, onAuthorClick: props.onOpenPerson, alsoExperiencedLoading: props.alsoExperiencedLoadingId === experience.id })))))) : null,
179974
+ experiences.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onShare: props.onShareExperience, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, onComment: openComments, onBookmark: props.onBookmarkExperience, onAuthorClick: props.onOpenPerson, alsoExperiencedLoading: props.alsoExperiencedLoadingId === experience.id })))))) : null,
179772
179975
  showQuestions && questions.length > 0 ? (React$1.createElement(InfiniteScroll, { hasNextPage: Boolean(props.questionsHasNextPage), isFetchingNextPage: Boolean(props.questionsFetchingNextPage), onLoadMore: (_e = props.onLoadMoreQuestions) !== null && _e !== void 0 ? _e : (() => undefined) },
179773
179976
  React$1.createElement(Box$1, { sx: { border: "none" } },
179774
179977
  tab === "all" ? (React$1.createElement(Typography$1, { sx: sectionTitleSx }, "Perguntas")) : null,
179775
179978
  questions.map((question) => (React$1.createElement(QuestionCard, { key: question.id, question: question, viewerUserId: props.viewerUserId, onOpen: openAnswers, onOpenAnswers: openAnswers, onBookmark: props.onBookmarkQuestion, onShare: props.onShareQuestion, onReactionToggle: props.onReactionToggleQuestion, onAuthorClick: props.onOpenPerson })))))) : null)),
179776
- React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_g = (_f = props.commentsCount) !== null && _f !== void 0 ? _f : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _g !== void 0 ? _g : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: false, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson }),
179979
+ React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_g = (_f = props.commentsCount) !== null && _f !== void 0 ? _f : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _g !== void 0 ? _g : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: false, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, viewerUserId: props.viewerUserId, onEditComment: props.onEditComment, onDeleteComment: props.onDeleteComment, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson }),
179777
179980
  React$1.createElement(QuestionAnswersSheet, { open: Boolean(answersQuestionId), questionId: answersQuestionId, questionTitle: answersTarget === null || answersTarget === void 0 ? void 0 : answersTarget.title, answers: props.answers, answerCount: (_j = (_h = props.answersCount) !== null && _h !== void 0 ? _h : answersTarget === null || answersTarget === void 0 ? void 0 : answersTarget.answerCount) !== null && _j !== void 0 ? _j : undefined, isLoading: props.answersLoading, isSubmitting: props.answersSubmitting, error: props.answersError, onClose: closeAnswers, onRetry: props.onRetryAnswers, onSubmitAnswer: props.onSubmitAnswer, onAuthorClick: props.onOpenPerson })));
179778
179981
  };
179779
179982
 
@@ -181235,6 +181438,733 @@ const QrLandingPagePropsSchema = objectType({
181235
181438
  .optional(),
181236
181439
  });
181237
181440
 
181441
+ const GOOGLE_SEARCH_PLACEHOLDER = "Digite o endereço para buscar no Google";
181442
+ const MIN_SEARCH_LENGTH = 3;
181443
+ const TerreiroLocationSearch = ({ apiKey, onSelect, onUnavailable, }) => {
181444
+ const theme = useTheme$1();
181445
+ const onUnavailableRef = React$1.useRef(onUnavailable);
181446
+ const onSelectRef = React$1.useRef(onSelect);
181447
+ onUnavailableRef.current = onUnavailable;
181448
+ onSelectRef.current = onSelect;
181449
+ const servicesRef = React$1.useRef({});
181450
+ const [ready, setReady] = React$1.useState(false);
181451
+ const [loading, setLoading] = React$1.useState(false);
181452
+ const [inputValue, setInputValue] = React$1.useState("");
181453
+ const [suggestions, setSuggestions] = React$1.useState([]);
181454
+ const [error, setError] = React$1.useState(null);
181455
+ React$1.useEffect(() => {
181456
+ let cancelled = false;
181457
+ loadGoogleMapsPlacesScript(apiKey, "pt-BR", "BR")
181458
+ .then(() => {
181459
+ var _a, _b;
181460
+ if (cancelled)
181461
+ return;
181462
+ const places = (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places;
181463
+ if (!(places === null || places === void 0 ? void 0 : places.AutocompleteService) || !(places === null || places === void 0 ? void 0 : places.PlacesService)) {
181464
+ onUnavailableRef.current();
181465
+ return;
181466
+ }
181467
+ servicesRef.current.autocompleteService = new places.AutocompleteService();
181468
+ const container = document.createElement("div");
181469
+ servicesRef.current.placesService = new places.PlacesService(container);
181470
+ setReady(true);
181471
+ })
181472
+ .catch(() => {
181473
+ if (!cancelled)
181474
+ onUnavailableRef.current();
181475
+ });
181476
+ return () => {
181477
+ cancelled = true;
181478
+ };
181479
+ }, [apiKey]);
181480
+ const search = (value) => {
181481
+ var _a, _b;
181482
+ const autocomplete = servicesRef.current.autocompleteService;
181483
+ const places = (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places;
181484
+ if (!autocomplete || !places)
181485
+ return;
181486
+ if (value.trim().length < MIN_SEARCH_LENGTH) {
181487
+ setSuggestions([]);
181488
+ setError(null);
181489
+ return;
181490
+ }
181491
+ setLoading(true);
181492
+ setError(null);
181493
+ autocomplete.getPlacePredictions({
181494
+ input: value,
181495
+ componentRestrictions: { country: "br" },
181496
+ types: ["address"],
181497
+ }, (predictions, status) => {
181498
+ setLoading(false);
181499
+ if (status !== places.PlacesServiceStatus.OK) {
181500
+ setSuggestions([]);
181501
+ if (status !== places.PlacesServiceStatus.ZERO_RESULTS) {
181502
+ setError("Não foi possível buscar endereços no Google");
181503
+ }
181504
+ return;
181505
+ }
181506
+ setSuggestions((predictions !== null && predictions !== void 0 ? predictions : []).map((prediction) => ({
181507
+ description: prediction.description,
181508
+ placeId: prediction.place_id,
181509
+ })));
181510
+ });
181511
+ };
181512
+ const selectSuggestion = (suggestion) => {
181513
+ var _a, _b;
181514
+ if (!suggestion)
181515
+ return;
181516
+ const placesService = servicesRef.current.placesService;
181517
+ const places = (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places;
181518
+ if (!placesService || !places) {
181519
+ setError("Não foi possível carregar os detalhes do endereço");
181520
+ return;
181521
+ }
181522
+ setInputValue(suggestion.description);
181523
+ setLoading(true);
181524
+ setError(null);
181525
+ placesService.getDetails({
181526
+ placeId: suggestion.placeId,
181527
+ fields: ["address_components", "formatted_address"],
181528
+ }, (place, status) => {
181529
+ var _a;
181530
+ setLoading(false);
181531
+ if (status !== places.PlacesServiceStatus.OK || !place) {
181532
+ setError("Não foi possível obter detalhes do endereço");
181533
+ return;
181534
+ }
181535
+ const mapped = mapGooglePlaceToAddressForm({
181536
+ address_components: place.address_components,
181537
+ formatted_address: place.formatted_address,
181538
+ });
181539
+ if (!mapped.city) {
181540
+ setError("Não foi possível identificar a cidade deste endereço");
181541
+ return;
181542
+ }
181543
+ onSelectRef.current(mapped.city, (_a = mapped.state) !== null && _a !== void 0 ? _a : "");
181544
+ });
181545
+ };
181546
+ if (!ready)
181547
+ return null;
181548
+ return (React$1.createElement(Autocomplete$1, { options: suggestions, getOptionLabel: (option) => option.description, filterOptions: (options) => options, loading: loading, inputValue: inputValue, onInputChange: (_, value, reason) => {
181549
+ if (reason !== "input" && reason !== "clear")
181550
+ return;
181551
+ setInputValue(value);
181552
+ search(value);
181553
+ }, onChange: (_, value) => selectSuggestion(value), isOptionEqualToValue: (option, value) => option.placeId === value.placeId, noOptionsText: error !== null && error !== void 0 ? error : (inputValue.trim().length >= MIN_SEARCH_LENGTH
181554
+ ? "Nenhum endereço encontrado para esta busca."
181555
+ : "Digite ao menos 3 caracteres"), renderInput: (params) => (React$1.createElement(TextField$1, Object.assign({}, params, { label: "Buscar endere\u00E7o", placeholder: GOOGLE_SEARCH_PLACEHOLDER, fullWidth: true, error: Boolean(error), helperText: error !== null && error !== void 0 ? error : undefined, inputProps: Object.assign(Object.assign({}, params.inputProps), { "data-testid": "terreiro-search-address" }), sx: {
181556
+ "& .MuiInputBase-input": { color: "text.primary" },
181557
+ "& .MuiInputBase-input::placeholder": { color: "text.secondary", opacity: 1 },
181558
+ }, InputProps: Object.assign(Object.assign({}, params.InputProps), { startAdornment: (React$1.createElement(InputAdornment$1, { position: "start" },
181559
+ React$1.createElement(LocationOn, { sx: { color: theme.palette.text.secondary } }))), endAdornment: (React$1.createElement(React$1.Fragment, null,
181560
+ loading ? React$1.createElement(CircularProgress$1, { size: 20 }) : null,
181561
+ params.InputProps.endAdornment)) }) }))) }));
181562
+ };
181563
+
181564
+ const BRAZIL_CENTER = { lat: -14.2, lng: -51.9 };
181565
+ const BRAZIL_ZOOM = 4;
181566
+ const SINGLE_RESULT_ZOOM = 15;
181567
+ const USER_LOCATION_ZOOM = 13;
181568
+ const PIN_ORANGE = "#BA4813";
181569
+ const PIN_COAL = "#201C10";
181570
+ const PIN_CREAM = "#F3E2B3";
181571
+ const mapColorScheme = (mode) => {
181572
+ var _a, _b;
181573
+ const scheme = (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.ColorScheme;
181574
+ if (!scheme)
181575
+ return undefined;
181576
+ if (scheme.FOLLOW_SYSTEM)
181577
+ return scheme.FOLLOW_SYSTEM;
181578
+ return mode === "dark" ? scheme.DARK : scheme.LIGHT;
181579
+ };
181580
+ const finitePlaces = (results) => (results !== null && results !== void 0 ? results : []).filter((place) => Number.isFinite(place.latitude) && Number.isFinite(place.longitude));
181581
+ const pinIcon = (selected, mode) => {
181582
+ var _a, _b, _c;
181583
+ const maps = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps;
181584
+ const idleFill = mode === "dark" ? PIN_CREAM : PIN_COAL;
181585
+ const idleStroke = mode === "dark" ? PIN_COAL : PIN_CREAM;
181586
+ return {
181587
+ path: (_c = (_b = maps === null || maps === void 0 ? void 0 : maps.SymbolPath) === null || _b === void 0 ? void 0 : _b.CIRCLE) !== null && _c !== void 0 ? _c : 0,
181588
+ scale: selected ? 11 : 8,
181589
+ fillColor: selected ? PIN_ORANGE : idleFill,
181590
+ fillOpacity: 1,
181591
+ strokeColor: selected ? PIN_CREAM : idleStroke,
181592
+ strokeWeight: 2,
181593
+ };
181594
+ };
181595
+ const TerreiroResultMap = ({ apiKey, results, selectedPlaceId, userCoordinates, layoutKey = null, onSelectPlace, }) => {
181596
+ var _a, _b;
181597
+ const theme = useTheme$1();
181598
+ const mode = theme.palette.mode;
181599
+ const modeRef = React$1.useRef(mode);
181600
+ modeRef.current = mode;
181601
+ const containerRef = React$1.useRef(null);
181602
+ const mapRef = React$1.useRef(null);
181603
+ const markersRef = React$1.useRef(new Map());
181604
+ const onSelectRef = React$1.useRef(onSelectPlace);
181605
+ const resultsRef = React$1.useRef(results);
181606
+ const userCoordinatesRef = React$1.useRef(userCoordinates);
181607
+ const selectedPlaceIdRef = React$1.useRef(selectedPlaceId);
181608
+ const [mapReady, setMapReady] = React$1.useState(false);
181609
+ const [mapFailed, setMapFailed] = React$1.useState(!(apiKey === null || apiKey === void 0 ? void 0 : apiKey.trim()));
181610
+ const [mapEpoch, setMapEpoch] = React$1.useState(0);
181611
+ onSelectRef.current = onSelectPlace;
181612
+ resultsRef.current = results;
181613
+ userCoordinatesRef.current = userCoordinates;
181614
+ selectedPlaceIdRef.current = selectedPlaceId;
181615
+ const trimmedKey = (_a = apiKey === null || apiKey === void 0 ? void 0 : apiKey.trim()) !== null && _a !== void 0 ? _a : "";
181616
+ const resultSignature = (_b = results === null || results === void 0 ? void 0 : results.map((place) => `${place.placeId}:${place.latitude}:${place.longitude}`).join("|")) !== null && _b !== void 0 ? _b : "";
181617
+ const userLocationKey = userCoordinates
181618
+ ? `${userCoordinates.latitude},${userCoordinates.longitude}`
181619
+ : "";
181620
+ React$1.useEffect(() => {
181621
+ if (!trimmedKey) {
181622
+ setMapFailed(true);
181623
+ setMapReady(false);
181624
+ return;
181625
+ }
181626
+ let cancelled = false;
181627
+ setMapFailed(false);
181628
+ loadGoogleMapsPlacesScript(trimmedKey, "pt-BR", "BR")
181629
+ .then(() => {
181630
+ var _a, _b, _c, _d;
181631
+ if (cancelled)
181632
+ return;
181633
+ if (!((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.Map) || !((_d = (_c = window.google) === null || _c === void 0 ? void 0 : _c.maps) === null || _d === void 0 ? void 0 : _d.Marker)) {
181634
+ setMapFailed(true);
181635
+ return;
181636
+ }
181637
+ setMapReady(true);
181638
+ })
181639
+ .catch(() => {
181640
+ if (!cancelled)
181641
+ setMapFailed(true);
181642
+ });
181643
+ return () => {
181644
+ cancelled = true;
181645
+ };
181646
+ }, [trimmedKey]);
181647
+ React$1.useEffect(() => {
181648
+ var _a, _b;
181649
+ if (!mapReady || !containerRef.current || !((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.Map))
181650
+ return;
181651
+ const colorScheme = mapColorScheme(modeRef.current);
181652
+ const map = new window.google.maps.Map(containerRef.current, Object.assign({ center: BRAZIL_CENTER, zoom: BRAZIL_ZOOM, disableDefaultUI: true, zoomControl: true, clickableIcons: false, gestureHandling: "greedy", mapTypeControl: false, streetViewControl: false, fullscreenControl: false }, (colorScheme ? { colorScheme } : {})));
181653
+ mapRef.current = map;
181654
+ setMapEpoch((epoch) => epoch + 1);
181655
+ return () => {
181656
+ markersRef.current.forEach((marker) => marker.setMap(null));
181657
+ markersRef.current.clear();
181658
+ mapRef.current = null;
181659
+ };
181660
+ }, [mapReady]);
181661
+ React$1.useEffect(() => {
181662
+ var _a;
181663
+ const map = mapRef.current;
181664
+ const maps = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps;
181665
+ if (!mapReady || !map || !(maps === null || maps === void 0 ? void 0 : maps.Marker))
181666
+ return;
181667
+ const places = finitePlaces(resultsRef.current);
181668
+ const nextIds = new Set(places.map((place) => place.placeId));
181669
+ markersRef.current.forEach((marker, id) => {
181670
+ if (!nextIds.has(id)) {
181671
+ marker.setMap(null);
181672
+ markersRef.current.delete(id);
181673
+ }
181674
+ });
181675
+ places.forEach((place) => {
181676
+ const position = { lat: place.latitude, lng: place.longitude };
181677
+ const existing = markersRef.current.get(place.placeId);
181678
+ if (existing) {
181679
+ existing.setPosition(position);
181680
+ return;
181681
+ }
181682
+ const marker = new maps.Marker({
181683
+ map,
181684
+ position,
181685
+ title: place.name,
181686
+ icon: pinIcon(place.placeId === selectedPlaceIdRef.current, modeRef.current),
181687
+ });
181688
+ marker.addListener("click", () => onSelectRef.current(place.placeId));
181689
+ markersRef.current.set(place.placeId, marker);
181690
+ });
181691
+ if (places.length === 1) {
181692
+ map.setCenter({ lat: places[0].latitude, lng: places[0].longitude });
181693
+ map.setZoom(SINGLE_RESULT_ZOOM);
181694
+ return;
181695
+ }
181696
+ if (places.length > 1) {
181697
+ const bounds = new maps.LatLngBounds();
181698
+ places.forEach((place) => {
181699
+ bounds.extend({ lat: place.latitude, lng: place.longitude });
181700
+ });
181701
+ map.fitBounds(bounds, 48);
181702
+ return;
181703
+ }
181704
+ const coords = userCoordinatesRef.current;
181705
+ if (coords && Number.isFinite(coords.latitude) && Number.isFinite(coords.longitude)) {
181706
+ map.setCenter({ lat: coords.latitude, lng: coords.longitude });
181707
+ map.setZoom(USER_LOCATION_ZOOM);
181708
+ return;
181709
+ }
181710
+ map.setCenter(BRAZIL_CENTER);
181711
+ map.setZoom(BRAZIL_ZOOM);
181712
+ }, [mapEpoch, mapReady, resultSignature, userLocationKey]);
181713
+ React$1.useEffect(() => {
181714
+ var _a;
181715
+ const map = mapRef.current;
181716
+ if (!mapReady || !map)
181717
+ return;
181718
+ const scheme = mapColorScheme(mode);
181719
+ if (scheme)
181720
+ (_a = map.setOptions) === null || _a === void 0 ? void 0 : _a.call(map, { colorScheme: scheme });
181721
+ markersRef.current.forEach((marker, id) => {
181722
+ marker.setIcon(pinIcon(id === selectedPlaceId, mode));
181723
+ });
181724
+ if (!selectedPlaceId)
181725
+ return;
181726
+ const place = finitePlaces(resultsRef.current).find((item) => item.placeId === selectedPlaceId);
181727
+ if (!place)
181728
+ return;
181729
+ map.panTo({ lat: place.latitude, lng: place.longitude });
181730
+ }, [mapEpoch, mapReady, mode, resultSignature, selectedPlaceId]);
181731
+ React$1.useEffect(() => {
181732
+ var _a, _b, _c, _d;
181733
+ const map = mapRef.current;
181734
+ if (!mapReady || !map || layoutKey === null)
181735
+ return;
181736
+ (_d = (_c = (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.trigger) === null || _d === void 0 ? void 0 : _d.call(_c, map, "resize");
181737
+ }, [layoutKey, mapEpoch, mapReady]);
181738
+ const showPlaceholder = !trimmedKey || mapFailed || !mapReady;
181739
+ return (React$1.createElement(Box$1, { sx: { position: "absolute", inset: 0 } },
181740
+ React$1.createElement(Box$1, { ref: containerRef, role: "region", "aria-label": "Mapa de terreiros", "data-testid": "terreiro-search-map", sx: { position: "absolute", inset: 0, bgcolor: "background.default" } }),
181741
+ showPlaceholder ? (React$1.createElement(Box$1, { "aria-hidden": true, "data-testid": "terreiro-search-map-placeholder", sx: {
181742
+ position: "absolute",
181743
+ inset: 0,
181744
+ bgcolor: "background.default",
181745
+ zIndex: 1,
181746
+ } })) : null));
181747
+ };
181748
+
181749
+ const TRADITIONS = ["Umbanda", "Candomblé", "Omolocô", "Quimbanda"];
181750
+ const statusLabel = (status) => {
181751
+ if (status === "CLOSED_PERMANENTLY")
181752
+ return "Fechado permanentemente";
181753
+ if (status === "CLOSED_TEMPORARILY")
181754
+ return "Fechado temporariamente";
181755
+ return null;
181756
+ };
181757
+ const traditionPressed = (query, tradition) => query.trim().localeCompare(tradition, "pt-BR", { sensitivity: "accent" }) === 0;
181758
+ const floatingControlShadow = "0 4px 16px rgba(32, 28, 16, 0.12)";
181759
+ const PEEK_HEIGHT = 72;
181760
+ const TOP_CLEARANCE = 120;
181761
+ const DRAG_SLOP = 5;
181762
+ const maxSheetHeight = () => {
181763
+ const viewport = typeof window === "undefined" ? 800 : window.innerHeight;
181764
+ return Math.max(PEEK_HEIGHT, viewport - TOP_CLEARANCE);
181765
+ };
181766
+ const defaultOpenHeight = () => {
181767
+ const viewport = typeof window === "undefined" ? 800 : window.innerHeight;
181768
+ return Math.round(Math.min(Math.max(viewport * 0.4, PEEK_HEIGHT), maxSheetHeight()));
181769
+ };
181770
+ const focusRing = {
181771
+ "&:focus-visible": {
181772
+ outline: "2px solid",
181773
+ outlineColor: "primary.main",
181774
+ outlineOffset: 2,
181775
+ },
181776
+ };
181777
+ const ResultRow = ({ place, selected, onSelect, onOpenMaps }) => {
181778
+ const closedLabel = statusLabel(place.businessStatus);
181779
+ return (React$1.createElement(Box$1, { component: "li", "data-testid": `terreiro-search-result-${place.placeId}`, sx: {
181780
+ display: "flex",
181781
+ alignItems: "center",
181782
+ gap: 0.5,
181783
+ minHeight: 56,
181784
+ listStyle: "none",
181785
+ } },
181786
+ React$1.createElement(Box$1, { component: "button", type: "button", "aria-pressed": selected, onClick: () => onSelect(place.placeId), sx: Object.assign({ flex: 1, minWidth: 0, minHeight: 56, display: "flex", alignItems: "center", gap: 1.5, py: 1, px: 0, border: 0, background: "transparent", textAlign: "left", cursor: "pointer", color: "inherit" }, focusRing) },
181787
+ React$1.createElement(Box$1, { "aria-hidden": true, sx: {
181788
+ width: 40,
181789
+ height: 40,
181790
+ borderRadius: "50%",
181791
+ display: "grid",
181792
+ placeItems: "center",
181793
+ flexShrink: 0,
181794
+ bgcolor: (theme) => alpha(selected ? theme.palette.primary.main : theme.palette.text.primary, 0.12),
181795
+ color: selected ? "primary.main" : "text.primary",
181796
+ } },
181797
+ React$1.createElement(PlaceOutlined, { fontSize: "small" })),
181798
+ React$1.createElement(Box$1, { sx: { minWidth: 0 } },
181799
+ React$1.createElement(Typography$1, { sx: {
181800
+ fontWeight: 700,
181801
+ fontSize: 16,
181802
+ color: selected ? "primary.main" : "text.primary",
181803
+ } }, place.name),
181804
+ React$1.createElement(Typography$1, { sx: { fontSize: 13, color: "text.secondary" } }, place.formattedAddress),
181805
+ closedLabel ? (React$1.createElement(Typography$1, { sx: { fontSize: 12, color: "text.secondary" } }, closedLabel)) : null)),
181806
+ React$1.createElement(Link$1, { href: place.googleMapsUrl, target: "_blank", rel: "noopener noreferrer", "aria-label": "Ver no Google Maps", "data-testid": `terreiro-search-maps-${place.placeId}`, onClick: () => onOpenMaps(place), sx: Object.assign({ width: 44, height: 44, display: "inline-flex", alignItems: "center", justifyContent: "center", flexShrink: 0, color: "text.primary", borderRadius: "50%" }, focusRing) },
181807
+ React$1.createElement(DirectionsOutlined, null))));
181808
+ };
181809
+ const NearbyTerreiroSearchPage = ({ query, onQueryChange, city, onCityChange, state, onStateChange, locationMode, geolocationNotice, isLocating = false, isLoading = false, isLoadingMore = false, results, errorMessage, hasMore = false, onSearch, onUseMyLocation, onRetry, onLoadMore, onOpenMaps, onBack, googleMapsApiKey, userCoordinates, }) => {
181810
+ const theme = useTheme$1();
181811
+ const isWide = useMediaQuery(theme.breakpoints.up("sm"));
181812
+ const [locationOpen, setLocationOpen] = React$1.useState(false);
181813
+ const [addressSearchUnavailable, setAddressSearchUnavailable] = React$1.useState(false);
181814
+ const [selectedPlaceId, setSelectedPlaceId] = React$1.useState(null);
181815
+ const [sheetHeight, setSheetHeight] = React$1.useState(null);
181816
+ const hasSheetContent = isLoading || Boolean(errorMessage) || results !== null;
181817
+ const listVisible = Boolean(results && results.length > 0);
181818
+ const previousMode = React$1.useRef(locationMode);
181819
+ const lastOpenHeight = React$1.useRef(defaultOpenHeight());
181820
+ const dragOrigin = React$1.useRef(null);
181821
+ const dragMoved = React$1.useRef(false);
181822
+ const resolvedSheetHeight = sheetHeight !== null && sheetHeight !== void 0 ? sheetHeight : defaultOpenHeight();
181823
+ const sheetOpen = resolvedSheetHeight > PEEK_HEIGHT + DRAG_SLOP;
181824
+ React$1.useEffect(() => {
181825
+ if (!listVisible || sheetHeight !== null)
181826
+ return;
181827
+ const open = defaultOpenHeight();
181828
+ lastOpenHeight.current = open;
181829
+ setSheetHeight(open);
181830
+ }, [listVisible, sheetHeight]);
181831
+ const toggleSheet = () => {
181832
+ setSheetHeight((current) => {
181833
+ const height = current !== null && current !== void 0 ? current : defaultOpenHeight();
181834
+ if (height <= PEEK_HEIGHT + DRAG_SLOP) {
181835
+ const open = lastOpenHeight.current > PEEK_HEIGHT + DRAG_SLOP
181836
+ ? lastOpenHeight.current
181837
+ : defaultOpenHeight();
181838
+ return Math.min(open, maxSheetHeight());
181839
+ }
181840
+ lastOpenHeight.current = height;
181841
+ return PEEK_HEIGHT;
181842
+ });
181843
+ };
181844
+ const onHandlePointerDown = (event) => {
181845
+ if (!listVisible)
181846
+ return;
181847
+ dragMoved.current = false;
181848
+ dragOrigin.current = {
181849
+ y: event.clientY,
181850
+ height: sheetHeight !== null && sheetHeight !== void 0 ? sheetHeight : defaultOpenHeight(),
181851
+ };
181852
+ if (event.currentTarget.setPointerCapture && Number.isFinite(event.pointerId)) {
181853
+ event.currentTarget.setPointerCapture(event.pointerId);
181854
+ }
181855
+ };
181856
+ const onHandlePointerMove = (event) => {
181857
+ const origin = dragOrigin.current;
181858
+ if (!origin)
181859
+ return;
181860
+ if (Math.abs(origin.y - event.clientY) > DRAG_SLOP)
181861
+ dragMoved.current = true;
181862
+ if (!dragMoved.current)
181863
+ return;
181864
+ const next = Math.min(maxSheetHeight(), Math.max(PEEK_HEIGHT, origin.height + (origin.y - event.clientY)));
181865
+ setSheetHeight(next);
181866
+ };
181867
+ const onHandlePointerUp = (event) => {
181868
+ if (!dragOrigin.current)
181869
+ return;
181870
+ dragOrigin.current = null;
181871
+ if (event.currentTarget.hasPointerCapture &&
181872
+ Number.isFinite(event.pointerId) &&
181873
+ event.currentTarget.hasPointerCapture(event.pointerId)) {
181874
+ event.currentTarget.releasePointerCapture(event.pointerId);
181875
+ }
181876
+ if (!dragMoved.current)
181877
+ return;
181878
+ setSheetHeight((current) => {
181879
+ if (current !== null && current > PEEK_HEIGHT + DRAG_SLOP) {
181880
+ lastOpenHeight.current = current;
181881
+ }
181882
+ return current;
181883
+ });
181884
+ };
181885
+ const onHandleClick = () => {
181886
+ if (!listVisible)
181887
+ return;
181888
+ if (dragMoved.current) {
181889
+ dragMoved.current = false;
181890
+ return;
181891
+ }
181892
+ toggleSheet();
181893
+ };
181894
+ const trimmedQuery = query.trim();
181895
+ const locationReady = locationMode === "geolocation" || city.trim().length >= 2;
181896
+ const canSearch = trimmedQuery.length >= 3 &&
181897
+ trimmedQuery.length <= 80 &&
181898
+ locationReady &&
181899
+ !isLoading &&
181900
+ !isLocating;
181901
+ React$1.useEffect(() => {
181902
+ if (previousMode.current !== "geolocation" && locationMode === "geolocation") {
181903
+ setLocationOpen(false);
181904
+ }
181905
+ previousMode.current = locationMode;
181906
+ }, [locationMode]);
181907
+ React$1.useEffect(() => {
181908
+ if (!selectedPlaceId)
181909
+ return;
181910
+ if (!(results === null || results === void 0 ? void 0 : results.some((place) => place.placeId === selectedPlaceId))) {
181911
+ setSelectedPlaceId(null);
181912
+ }
181913
+ }, [results, selectedPlaceId]);
181914
+ React$1.useEffect(() => {
181915
+ if (!selectedPlaceId || !listVisible)
181916
+ return;
181917
+ setSheetHeight((current) => {
181918
+ const height = current !== null && current !== void 0 ? current : defaultOpenHeight();
181919
+ if (height > PEEK_HEIGHT + DRAG_SLOP)
181920
+ return current;
181921
+ const open = lastOpenHeight.current > PEEK_HEIGHT + DRAG_SLOP
181922
+ ? lastOpenHeight.current
181923
+ : defaultOpenHeight();
181924
+ return Math.min(open, maxSheetHeight());
181925
+ });
181926
+ let innerFrame = 0;
181927
+ const outerFrame = requestAnimationFrame(() => {
181928
+ innerFrame = requestAnimationFrame(() => {
181929
+ var _a;
181930
+ const row = (_a = document
181931
+ .getElementById("terreiro-search-sheet-body")) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-testid="terreiro-search-result-${CSS.escape(selectedPlaceId)}"]`);
181932
+ if (row instanceof HTMLElement) {
181933
+ row.scrollIntoView({ block: "nearest" });
181934
+ }
181935
+ });
181936
+ });
181937
+ return () => {
181938
+ cancelAnimationFrame(outerFrame);
181939
+ cancelAnimationFrame(innerFrame);
181940
+ };
181941
+ }, [listVisible, selectedPlaceId]);
181942
+ const locationLabel = locationMode === "geolocation"
181943
+ ? "Perto de mim"
181944
+ : city.trim()
181945
+ ? state.trim()
181946
+ ? `${city.trim()}, ${state.trim()}`
181947
+ : city.trim()
181948
+ : "Escolher cidade";
181949
+ const peekLabel = (() => {
181950
+ if (isLoading)
181951
+ return "Buscando terreiros...";
181952
+ if (errorMessage)
181953
+ return "Não foi possível buscar";
181954
+ if (results && results.length === 1)
181955
+ return "1 terreiro";
181956
+ if (results && results.length > 1)
181957
+ return `${results.length} terreiros`;
181958
+ if (results && results.length === 0)
181959
+ return "Nenhum terreiro";
181960
+ return "Busque para ver terreiros na região";
181961
+ })();
181962
+ const submitTradition = (tradition) => {
181963
+ onQueryChange(tradition);
181964
+ if (locationReady && !isLoading && !isLocating)
181965
+ onSearch(tradition);
181966
+ };
181967
+ const notice = geolocationNotice ? (React$1.createElement(Typography$1, { role: "status", variant: "body2", "data-testid": "terreiro-search-geo-notice", sx: {
181968
+ alignSelf: "flex-start",
181969
+ maxWidth: "100%",
181970
+ bgcolor: "background.paper",
181971
+ color: "text.secondary",
181972
+ borderRadius: 2,
181973
+ px: 1.5,
181974
+ py: 1,
181975
+ fontSize: 13,
181976
+ boxShadow: floatingControlShadow,
181977
+ } }, geolocationNotice)) : null;
181978
+ return (React$1.createElement(Box$1, { sx: {
181979
+ position: "relative",
181980
+ height: "100dvh",
181981
+ display: "flex",
181982
+ overflow: "hidden",
181983
+ bgcolor: "background.default",
181984
+ } },
181985
+ React$1.createElement(Box$1, { component: "section", "aria-label": "Resultados", "data-testid": "terreiro-search-sheet", style: listVisible ? { height: resolvedSheetHeight } : undefined, sx: {
181986
+ position: listVisible ? "absolute" : { xs: "absolute", sm: "relative" },
181987
+ left: 0,
181988
+ right: { xs: 0, sm: "auto" },
181989
+ bottom: 0,
181990
+ zIndex: 2,
181991
+ display: "flex",
181992
+ flexDirection: "column",
181993
+ width: { xs: "100%", sm: 400 },
181994
+ maxWidth: { sm: 400 },
181995
+ flexShrink: 0,
181996
+ height: listVisible ? undefined : { sm: "100%" },
181997
+ maxHeight: listVisible ? `calc(100dvh - ${TOP_CLEARANCE}px)` : "none",
181998
+ bgcolor: "background.paper",
181999
+ borderTopLeftRadius: listVisible || !isWide ? "20px" : 0,
182000
+ borderTopRightRadius: listVisible || !isWide ? "20px" : 0,
182001
+ borderRight: listVisible ? 0 : { sm: 1 },
182002
+ borderColor: "divider",
182003
+ boxShadow: listVisible || !isWide ? "0 -8px 24px rgba(32, 28, 16, 0.08)" : "none",
182004
+ } },
182005
+ listVisible ? (React$1.createElement(Box$1, { component: "button", type: "button", "aria-expanded": sheetOpen, "aria-controls": "terreiro-search-sheet-body", "data-testid": "terreiro-search-sheet-handle", onPointerDown: onHandlePointerDown, onPointerMove: onHandlePointerMove, onPointerUp: onHandlePointerUp, onClick: onHandleClick, sx: Object.assign({ width: "100%", border: 0, bgcolor: "transparent", cursor: "ns-resize", touchAction: "none", display: "flex", flexDirection: "column", alignItems: "center", gap: 0.75, pt: 1, pb: 1, px: 2, minHeight: 44, color: "text.primary" }, focusRing) },
182006
+ React$1.createElement(Box$1, { "aria-hidden": true, sx: {
182007
+ width: 36,
182008
+ height: 4,
182009
+ borderRadius: RADIUS.pill,
182010
+ bgcolor: (muiTheme) => alpha(muiTheme.palette.text.primary, 0.28),
182011
+ } }),
182012
+ React$1.createElement(Box$1, { component: "span", sx: { alignSelf: "flex-start", fontSize: 16, fontWeight: 800 } }, peekLabel))) : isWide ? (React$1.createElement(Typography$1, { sx: { px: 2, pt: 2, pb: 1, fontSize: 16, fontWeight: 800 } }, peekLabel)) : (React$1.createElement(Box$1, { sx: {
182013
+ width: "100%",
182014
+ display: "flex",
182015
+ flexDirection: "column",
182016
+ alignItems: "center",
182017
+ gap: 0.75,
182018
+ pt: 1,
182019
+ pb: 1,
182020
+ px: 2,
182021
+ minHeight: 44,
182022
+ color: "text.primary",
182023
+ } },
182024
+ React$1.createElement(Box$1, { "aria-hidden": true, sx: {
182025
+ width: 36,
182026
+ height: 4,
182027
+ borderRadius: RADIUS.pill,
182028
+ bgcolor: (muiTheme) => alpha(muiTheme.palette.text.primary, 0.28),
182029
+ } }),
182030
+ React$1.createElement(Box$1, { component: "span", sx: { alignSelf: "flex-start", fontSize: 16, fontWeight: 800 } }, peekLabel))),
182031
+ React$1.createElement(Box$1, { id: "terreiro-search-sheet-body", sx: {
182032
+ display: hasSheetContent ? "flex" : "none",
182033
+ flexDirection: "column",
182034
+ flex: 1,
182035
+ minHeight: 0,
182036
+ overflowY: "auto",
182037
+ px: 2,
182038
+ pb: 2,
182039
+ } },
182040
+ isLoading ? (React$1.createElement(Stack$1, { spacing: 1, "data-testid": "terreiro-search-loading" }, [0, 1, 2].map((item) => (React$1.createElement(Skeleton$1, { key: item, variant: "rectangular", height: 56 }))))) : null,
182041
+ !isLoading && errorMessage ? (React$1.createElement(Stack$1, { spacing: 1, "data-testid": "terreiro-search-error", role: "alert" },
182042
+ React$1.createElement(Typography$1, null, errorMessage),
182043
+ onRetry ? (React$1.createElement(Button$1, { type: "button", variant: "text", onClick: onRetry, "data-testid": "terreiro-search-retry", sx: {
182044
+ alignSelf: "flex-start",
182045
+ minHeight: 44,
182046
+ fontWeight: 700,
182047
+ color: "text.primary",
182048
+ } }, "Tentar de novo")) : null)) : null,
182049
+ !isLoading && !errorMessage && results && results.length === 0 ? (React$1.createElement(Stack$1, { spacing: 1, "data-testid": "terreiro-search-empty", sx: { py: 2 } },
182050
+ React$1.createElement(PlaceOutlined, { sx: { color: "text.primary" } }),
182051
+ React$1.createElement(Typography$1, { sx: { fontWeight: 700 } }, "Nenhum terreiro encontrado para esta busca na regi\u00E3o selecionada."),
182052
+ React$1.createElement(Typography$1, { sx: { fontSize: 13, color: "text.secondary" } }, "Ajuste o termo ou a cidade e busque de novo."))) : null,
182053
+ !isLoading && !errorMessage && results && results.length > 0 ? (React$1.createElement(Box$1, { component: "ul", sx: { m: 0, p: 0 } }, results.map((place) => (React$1.createElement(ResultRow, { key: place.placeId, place: place, selected: place.placeId === selectedPlaceId, onSelect: setSelectedPlaceId, onOpenMaps: onOpenMaps }))))) : null,
182054
+ !isLoading && !errorMessage && hasMore ? (React$1.createElement(Button$1, { type: "button", variant: "text", onClick: onLoadMore, disabled: isLoadingMore, "data-testid": "terreiro-search-load-more", sx: {
182055
+ alignSelf: "flex-start",
182056
+ mt: 0.5,
182057
+ minHeight: 44,
182058
+ fontWeight: 700,
182059
+ color: "text.primary",
182060
+ } }, isLoadingMore ? "Carregando..." : "Carregar mais")) : null)),
182061
+ React$1.createElement(Box$1, { sx: { position: "relative", flex: 1, minWidth: 0 } },
182062
+ React$1.createElement(TerreiroResultMap, { apiKey: googleMapsApiKey, results: results, selectedPlaceId: selectedPlaceId, userCoordinates: userCoordinates, layoutKey: listVisible ? resolvedSheetHeight : null, onSelectPlace: setSelectedPlaceId }),
182063
+ React$1.createElement(Box$1, { component: "form", onSubmit: (event) => {
182064
+ event.preventDefault();
182065
+ if (canSearch)
182066
+ onSearch(trimmedQuery);
182067
+ }, sx: {
182068
+ position: "absolute",
182069
+ top: 16,
182070
+ left: 16,
182071
+ right: 16,
182072
+ zIndex: 3,
182073
+ display: "flex",
182074
+ flexDirection: "column",
182075
+ gap: 1,
182076
+ } },
182077
+ React$1.createElement(Box$1, { sx: { display: "flex", alignItems: "center", gap: 1 } },
182078
+ onBack ? (React$1.createElement(IconButton$1, { type: "button", "aria-label": "Voltar", onClick: onBack, sx: Object.assign({ width: 44, height: 44, flexShrink: 0, bgcolor: "background.paper", color: "text.primary", boxShadow: floatingControlShadow, "&:hover": { bgcolor: "background.paper" } }, focusRing) },
182079
+ React$1.createElement(ArrowBack$1, null))) : null,
182080
+ React$1.createElement(Box$1, { sx: {
182081
+ flex: 1,
182082
+ minWidth: 0,
182083
+ display: "flex",
182084
+ alignItems: "center",
182085
+ minHeight: 44,
182086
+ pl: 2,
182087
+ pr: 0.5,
182088
+ bgcolor: "background.paper",
182089
+ borderRadius: RADIUS.pill,
182090
+ boxShadow: floatingControlShadow,
182091
+ } },
182092
+ React$1.createElement(InputBase$1, { value: query, onChange: (event) => onQueryChange(event.target.value), placeholder: "Umbanda, Candombl\u00E9...", fullWidth: true, inputProps: {
182093
+ "aria-label": "Tradição ou nome",
182094
+ maxLength: 80,
182095
+ "data-testid": "terreiro-search-query",
182096
+ }, sx: {
182097
+ fontSize: 16,
182098
+ color: "text.primary",
182099
+ "& input::placeholder": { color: "text.secondary", opacity: 1 },
182100
+ } }),
182101
+ query ? (React$1.createElement(IconButton$1, { type: "button", "aria-label": "Limpar busca", onClick: () => onQueryChange(""), sx: { width: 44, height: 44, flexShrink: 0, color: "text.primary" } },
182102
+ React$1.createElement(Close$1, null))) : null),
182103
+ React$1.createElement(IconButton$1, { type: "submit", "aria-label": "Buscar", disabled: !canSearch, "data-testid": "terreiro-search-submit", onClick: (event) => {
182104
+ event.preventDefault();
182105
+ if (canSearch)
182106
+ onSearch(trimmedQuery);
182107
+ }, sx: Object.assign({ width: 44, height: 44, flexShrink: 0, bgcolor: "primary.main", color: "primary.contrastText", boxShadow: floatingControlShadow, "&:hover": { bgcolor: "primary.dark" }, "&.Mui-disabled": {
182108
+ bgcolor: (muiTheme) => alpha(muiTheme.palette.primary.main, 0.38),
182109
+ color: "primary.contrastText",
182110
+ } }, focusRing) },
182111
+ React$1.createElement(Search$1, null))),
182112
+ React$1.createElement(Box$1, { role: "group", "aria-label": "Tradi\u00E7\u00F5es", sx: {
182113
+ display: "flex",
182114
+ gap: 1,
182115
+ overflowX: "auto",
182116
+ scrollbarWidth: "none",
182117
+ "&::-webkit-scrollbar": { display: "none" },
182118
+ } }, TRADITIONS.map((tradition) => {
182119
+ const pressed = traditionPressed(query, tradition);
182120
+ return (React$1.createElement(Button$1, { key: tradition, type: "button", variant: "outlined", "aria-pressed": pressed, onClick: () => submitTradition(tradition), sx: {
182121
+ flexShrink: 0,
182122
+ minHeight: 44,
182123
+ px: 2,
182124
+ borderRadius: RADIUS.pill,
182125
+ textTransform: "none",
182126
+ fontWeight: 600,
182127
+ bgcolor: "background.paper",
182128
+ borderColor: pressed ? "primary.main" : "divider",
182129
+ color: pressed ? "primary.main" : "text.primary",
182130
+ "&:hover": {
182131
+ bgcolor: "background.paper",
182132
+ borderColor: pressed ? "primary.main" : "divider",
182133
+ },
182134
+ } }, tradition));
182135
+ })),
182136
+ React$1.createElement(Button$1, { type: "button", variant: "outlined", "aria-expanded": locationOpen, "aria-haspopup": "dialog", onClick: () => setLocationOpen(true), startIcon: locationMode === "geolocation" ? React$1.createElement(MyLocation, null) : React$1.createElement(PlaceOutlined, null), sx: {
182137
+ alignSelf: "flex-start",
182138
+ minHeight: 44,
182139
+ maxWidth: "100%",
182140
+ borderRadius: RADIUS.pill,
182141
+ textTransform: "none",
182142
+ fontWeight: 600,
182143
+ bgcolor: "background.paper",
182144
+ borderColor: "divider",
182145
+ color: "text.primary",
182146
+ "&:hover": { bgcolor: "background.paper", borderColor: "divider" },
182147
+ } }, locationLabel),
182148
+ !locationOpen ? notice : null)),
182149
+ React$1.createElement(GenericDrawer, { open: locationOpen, onClose: () => setLocationOpen(false), "aria-label": "Local da busca" }, locationOpen ? (React$1.createElement(Stack$1, { spacing: 2, sx: { px: 2, pb: 3 } },
182150
+ React$1.createElement(Typography$1, { sx: { fontSize: 16, fontWeight: 800 } }, "Onde buscar"),
182151
+ (googleMapsApiKey === null || googleMapsApiKey === void 0 ? void 0 : googleMapsApiKey.trim()) && !addressSearchUnavailable ? (React$1.createElement(TerreiroLocationSearch, { apiKey: googleMapsApiKey.trim(), onUnavailable: () => setAddressSearchUnavailable(true), onSelect: (nextCity, nextState) => {
182152
+ onCityChange(nextCity);
182153
+ onStateChange(nextState);
182154
+ setLocationOpen(false);
182155
+ } })) : (React$1.createElement(Stack$1, { direction: "row", spacing: 1 },
182156
+ React$1.createElement(TextField$1, { label: "Cidade", value: city, onChange: (event) => onCityChange(event.target.value), inputProps: { "data-testid": "terreiro-search-city" }, fullWidth: true, sx: {
182157
+ "& .MuiInputBase-input": { color: "text.primary" },
182158
+ "& .MuiInputBase-input::placeholder": { color: "text.secondary", opacity: 1 },
182159
+ } }),
182160
+ React$1.createElement(TextField$1, { label: "UF", value: state, onChange: (event) => onStateChange(event.target.value.toUpperCase().slice(0, 2)), inputProps: { maxLength: 2, "data-testid": "terreiro-search-state" }, sx: {
182161
+ width: 88,
182162
+ "& .MuiInputBase-input": { color: "text.primary" },
182163
+ } }))),
182164
+ React$1.createElement(Button$1, { type: "button", variant: "text", onClick: onUseMyLocation, disabled: isLocating || isLoading, "data-testid": "terreiro-search-geolocation", sx: { alignSelf: "flex-start", minHeight: 44, fontWeight: 700, color: "text.primary" } }, isLocating ? "Buscando localização..." : "Usar minha localização"),
182165
+ notice)) : null)));
182166
+ };
182167
+
181238
182168
  /**
181239
182169
  * Convert the given array buffer into a Base64URL-encoded string. Ideal for converting various
181240
182170
  * credential response ArrayBuffers to string for sending back to the server as JSON.
@@ -194879,6 +195809,7 @@ exports.MoonZodiacSchema = MoonZodiacSchema;
194879
195809
  exports.MyPermissionsDetailedSchema = MyPermissionsDetailedSchema;
194880
195810
  exports.MyPermissionsPage = MyPermissionsPage;
194881
195811
  exports.MyPermissionsPagePropsSchema = MyPermissionsPagePropsSchema;
195812
+ exports.NearbyTerreiroSearchPage = NearbyTerreiroSearchPage;
194882
195813
  exports.NotFoundPage = NotFoundPage;
194883
195814
  exports.NotificationSettingsPage = NotificationSettingsPage;
194884
195815
  exports.NotificationSettingsPagePropsSchema = NotificationSettingsPagePropsSchema;
@@ -195049,7 +195980,9 @@ exports.SocialConversationPeerSchema = SocialConversationPeerSchema;
195049
195980
  exports.SocialConversationRow = SocialConversationRow;
195050
195981
  exports.SocialConversationSchema = SocialConversationSchema;
195051
195982
  exports.SocialCreateActionsSheet = SocialCreateActionsSheet;
195983
+ exports.SocialDeleteConfirmDialog = SocialDeleteConfirmDialog;
195052
195984
  exports.SocialDiscoverPage = SocialDiscoverPage;
195985
+ exports.SocialEditTextDialog = SocialEditTextDialog;
195053
195986
  exports.SocialEmptyState = SocialEmptyState;
195054
195987
  exports.SocialErrorState = SocialErrorState;
195055
195988
  exports.SocialFeedItemSchema = SocialFeedItemSchema;