@volchoklv/socialfire-widget 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -0
  3. package/dist/core/fetcher.d.ts +8 -0
  4. package/dist/core/fetcher.d.ts.map +1 -0
  5. package/dist/core/styles.d.ts +27 -0
  6. package/dist/core/styles.d.ts.map +1 -0
  7. package/dist/core/types.d.ts +35 -0
  8. package/dist/core/types.d.ts.map +1 -0
  9. package/dist/core/utils.d.ts +8 -0
  10. package/dist/core/utils.d.ts.map +1 -0
  11. package/dist/index.d.ts +4 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +15 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/react/SocialfireWidget.d.ts +14 -0
  16. package/dist/react/SocialfireWidget.d.ts.map +1 -0
  17. package/dist/react/components/EmptyState.d.ts +2 -0
  18. package/dist/react/components/EmptyState.d.ts.map +1 -0
  19. package/dist/react/components/ErrorState.d.ts +4 -0
  20. package/dist/react/components/ErrorState.d.ts.map +1 -0
  21. package/dist/react/components/LoadingState.d.ts +2 -0
  22. package/dist/react/components/LoadingState.d.ts.map +1 -0
  23. package/dist/react/components/PostItem.d.ts +8 -0
  24. package/dist/react/components/PostItem.d.ts.map +1 -0
  25. package/dist/react/index.d.ts +4 -0
  26. package/dist/react/index.d.ts.map +1 -0
  27. package/dist/utils-BNIlvbZe.js +2 -0
  28. package/dist/utils-BNIlvbZe.js.map +1 -0
  29. package/dist/vanilla/SocialfireWidget.d.ts +12 -0
  30. package/dist/vanilla/SocialfireWidget.d.ts.map +1 -0
  31. package/dist/vanilla/index.d.ts +4 -0
  32. package/dist/vanilla/index.d.ts.map +1 -0
  33. package/dist/vanilla/renderer.d.ts +6 -0
  34. package/dist/vanilla/renderer.d.ts.map +1 -0
  35. package/dist/vanilla/templates.d.ts +7 -0
  36. package/dist/vanilla/templates.d.ts.map +1 -0
  37. package/dist/widget.d.ts +2 -0
  38. package/dist/widget.js +2 -0
  39. package/dist/widget.js.map +1 -0
  40. package/package.json +64 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Socialfire
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,162 @@
1
+ # @socialfire/widget
2
+
3
+ Embeddable Instagram feed widget for React and vanilla JavaScript.
4
+
5
+ ## Installation
6
+
7
+ ### NPM (React/Next.js)
8
+
9
+ ```bash
10
+ npm install @socialfire/widget
11
+ ```
12
+
13
+ ### CDN (Vanilla JS)
14
+
15
+ ```html
16
+ <script src="https://cdn.jsdelivr.net/npm/@socialfire/widget/dist/widget.js" type="module"></script>
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ### React Component
22
+
23
+ ```tsx
24
+ import { SocialfireWidget } from '@socialfire/widget';
25
+
26
+ function App() {
27
+ return (
28
+ <SocialfireWidget
29
+ feedId="your-feed-slug"
30
+ apiUrl="https://your-api.com"
31
+ onLoad={(feed) => console.log('Feed loaded:', feed)}
32
+ onError={(error) => console.error('Error:', error)}
33
+ />
34
+ );
35
+ }
36
+ ```
37
+
38
+ #### Props
39
+
40
+ | Prop | Type | Required | Description |
41
+ |------|------|----------|-------------|
42
+ | `feedId` | `string` | Yes | Feed slug or ID to display |
43
+ | `apiUrl` | `string` | No | API base URL (defaults to window.location.origin) |
44
+ | `className` | `string` | No | Additional CSS classes |
45
+ | `onLoad` | `(feed: SocialfireFeed) => void` | No | Callback when feed loads |
46
+ | `onError` | `(error: Error) => void` | No | Callback on error |
47
+ | `loadingComponent` | `React.ReactNode` | No | Custom loading component |
48
+ | `errorComponent` | `(error: Error) => React.ReactNode` | No | Custom error component |
49
+
50
+ ### Vanilla JavaScript (Web Component)
51
+
52
+ ```html
53
+ <!DOCTYPE html>
54
+ <html>
55
+ <head>
56
+ <script src="https://cdn.jsdelivr.net/npm/@socialfire/widget/dist/widget.js" type="module"></script>
57
+ </head>
58
+ <body>
59
+ <socialfire-widget
60
+ feed-id="your-feed-slug"
61
+ api-url="https://your-api.com">
62
+ </socialfire-widget>
63
+
64
+ <script>
65
+ const widget = document.querySelector('socialfire-widget');
66
+
67
+ widget.addEventListener('load', (event) => {
68
+ console.log('Feed loaded:', event.detail);
69
+ });
70
+
71
+ widget.addEventListener('error', (event) => {
72
+ console.error('Error:', event.detail);
73
+ });
74
+ </script>
75
+ </body>
76
+ </html>
77
+ ```
78
+
79
+ #### Attributes
80
+
81
+ | Attribute | Type | Required | Description |
82
+ |-----------|------|----------|-------------|
83
+ | `feed-id` | `string` | Yes | Feed slug or ID to display |
84
+ | `api-url` | `string` | No | API base URL (defaults to current origin) |
85
+
86
+ #### Events
87
+
88
+ | Event | Detail | Description |
89
+ |-------|--------|-------------|
90
+ | `load` | `SocialfireFeed` | Fired when feed loads successfully |
91
+ | `error` | `Error` | Fired when an error occurs |
92
+
93
+ ## TypeScript Support
94
+
95
+ Full TypeScript support is included with exported types:
96
+
97
+ ```typescript
98
+ import type { SocialfirePost, SocialfireFeed, SocialfireWidgetProps } from '@socialfire/widget';
99
+ ```
100
+
101
+ ## API Response Format
102
+
103
+ The widget expects the API endpoint to return JSON in this format:
104
+
105
+ ```json
106
+ {
107
+ "feedId": "507f1f77bcf86cd799439011",
108
+ "slug": "homepage-feed",
109
+ "name": "My Instagram Feed",
110
+ "layout": "GRID",
111
+ "columns": 3,
112
+ "rows": 3,
113
+ "gap": 16,
114
+ "showCaptions": true,
115
+ "showLikes": true,
116
+ "showComments": true,
117
+ "posts": [
118
+ {
119
+ "id": "17895695668004550",
120
+ "caption": "Post caption text",
121
+ "mediaType": "IMAGE",
122
+ "mediaUrl": "https://scontent.cdninstagram.com/...",
123
+ "permalink": "https://www.instagram.com/p/ABC123/",
124
+ "thumbnailUrl": null,
125
+ "timestamp": "2024-01-15T10:30:00+0000",
126
+ "likeCount": 42,
127
+ "commentsCount": 5
128
+ }
129
+ ],
130
+ "cachedAt": "2024-01-15T10:00:00.000Z",
131
+ "expiresAt": "2024-01-15T11:00:00.000Z"
132
+ }
133
+ ```
134
+
135
+ ## Browser Compatibility
136
+
137
+ - Chrome/Edge 90+
138
+ - Firefox 88+
139
+ - Safari 15+
140
+ - Mobile Safari iOS 15+
141
+ - Chrome Android 90+
142
+
143
+ Requires:
144
+ - Custom Elements v1 (Web Components)
145
+ - Shadow DOM v1
146
+ - Fetch API
147
+ - ES2020 features
148
+
149
+ ## Bundle Size
150
+
151
+ - React component: ~6 KB gzipped
152
+ - Vanilla Web Component: ~2 KB gzipped
153
+
154
+ ## License
155
+
156
+ MIT
157
+
158
+ ## Links
159
+
160
+ - [GitHub Repository](https://github.com/socialfire/widget)
161
+ - [NPM Package](https://www.npmjs.com/package/@socialfire/widget)
162
+ - [Documentation](https://docs.socialfire.com/widget)
@@ -0,0 +1,8 @@
1
+ import { SocialfireFeed } from './types';
2
+ export declare class FeedFetcher {
3
+ private baseUrl;
4
+ constructor(baseUrl?: string);
5
+ private getDefaultBaseUrl;
6
+ fetchFeed(feedId: string, signal?: AbortSignal): Promise<SocialfireFeed>;
7
+ }
8
+ //# sourceMappingURL=fetcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../src/core/fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAS;gBAEZ,OAAO,CAAC,EAAE,MAAM;IAI5B,OAAO,CAAC,iBAAiB;IAYnB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;CAc/E"}
@@ -0,0 +1,27 @@
1
+ import { CSSProperties } from 'react';
2
+ export declare const styles: {
3
+ grid: (columns: number, gap: number) => CSSProperties;
4
+ postLink: CSSProperties;
5
+ postLinkHover: CSSProperties;
6
+ image: CSSProperties;
7
+ mediaIcon: CSSProperties;
8
+ svgIcon: CSSProperties;
9
+ hoverOverlay: CSSProperties;
10
+ hoverOverlayVisible: CSSProperties;
11
+ statContainer: CSSProperties;
12
+ statIcon: CSSProperties;
13
+ statText: CSSProperties;
14
+ captionOverlay: CSSProperties;
15
+ captionText: CSSProperties;
16
+ loadingContainer: CSSProperties;
17
+ loadingInner: CSSProperties;
18
+ spinner: CSSProperties;
19
+ loadingText: CSSProperties;
20
+ errorContainer: CSSProperties;
21
+ errorTitle: CSSProperties;
22
+ errorMessage: CSSProperties;
23
+ emptyContainer: CSSProperties;
24
+ };
25
+ export declare const injectGlobalStyles: () => void;
26
+ export declare const shadowStyles = "\n :host {\n display: block;\n }\n\n .socialfire-widget {\n width: 100%;\n }\n\n .socialfire-grid {\n display: grid;\n }\n\n .post-link {\n position: relative;\n aspect-ratio: 1 / 1;\n overflow: hidden;\n border-radius: 8px;\n background-color: #f3f4f6;\n display: block;\n transition: opacity 0.2s;\n text-decoration: none;\n }\n\n .post-link:hover {\n opacity: 0.9;\n }\n\n .post-image {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .media-icon {\n position: absolute;\n top: 8px;\n right: 8px;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 9999px;\n padding: 4px;\n }\n\n .media-icon svg {\n width: 16px;\n height: 16px;\n color: white;\n display: block;\n }\n\n .hover-overlay {\n position: absolute;\n inset: 0;\n background-color: rgba(0, 0, 0, 0.6);\n opacity: 0;\n transition: opacity 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n color: white;\n }\n\n .post-link:hover .hover-overlay {\n opacity: 1;\n }\n\n .stat-container {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .stat-container svg {\n width: 20px;\n height: 20px;\n }\n\n .stat-text {\n font-weight: 600;\n }\n\n .caption-overlay {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);\n padding: 12px;\n }\n\n .caption-text {\n color: white;\n font-size: 12px;\n line-height: 16px;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .loading-container {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 48px;\n }\n\n .loading-inner {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n }\n\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n .spinner {\n width: 32px;\n height: 32px;\n border: 4px solid #2563eb;\n border-top-color: transparent;\n border-radius: 9999px;\n animation: spin 1s linear infinite;\n }\n\n .loading-text {\n font-size: 14px;\n color: #6b7280;\n }\n\n .error-container {\n padding: 24px;\n background-color: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 8px;\n }\n\n .error-title {\n color: #dc2626;\n font-weight: 500;\n }\n\n .error-message {\n font-size: 14px;\n color: #ef4444;\n margin-top: 4px;\n }\n\n .empty-container {\n padding: 48px;\n text-align: center;\n color: #6b7280;\n }\n";
27
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/core/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,MAAM;oBAED,MAAM,OAAO,MAAM,KAAG,aAAa;cAgB9C,aAAa;mBAIb,aAAa;WAUb,aAAa;eAUb,aAAa;aAMb,aAAa;kBAcb,aAAa;yBAIb,aAAa;mBAMb,aAAa;cAKb,aAAa;cAIb,aAAa;oBAUb,aAAa;iBAUb,aAAa;sBAQb,aAAa;kBAOb,aAAa;aASb,aAAa;iBAKb,aAAa;oBAQb,aAAa;gBAKb,aAAa;kBAMb,aAAa;oBAOb,aAAa;CACnB,CAAC;AAGF,eAAO,MAAM,kBAAkB,YAY9B,CAAC;AAGF,eAAO,MAAM,YAAY,mrFA+JxB,CAAC"}
@@ -0,0 +1,35 @@
1
+ export interface SocialfirePost {
2
+ id: string;
3
+ caption: string | null;
4
+ mediaType: 'IMAGE' | 'VIDEO' | 'CAROUSEL_ALBUM';
5
+ mediaUrl: string;
6
+ permalink: string;
7
+ thumbnailUrl: string | null;
8
+ timestamp: string;
9
+ likeCount?: number;
10
+ commentsCount?: number;
11
+ }
12
+ export interface SocialfireFeed {
13
+ feedId: string;
14
+ slug: string;
15
+ name: string;
16
+ layout: 'GRID' | 'CAROUSEL' | 'MASONRY';
17
+ columns: number;
18
+ rows: number;
19
+ gap: number;
20
+ showCaptions: boolean;
21
+ showLikes: boolean;
22
+ showComments: boolean;
23
+ posts: SocialfirePost[];
24
+ cachedAt: string;
25
+ expiresAt: string;
26
+ warning?: string;
27
+ }
28
+ export interface WidgetConfig {
29
+ feedId: string;
30
+ apiUrl?: string;
31
+ className?: string;
32
+ onLoad?: (feed: SocialfireFeed) => void;
33
+ onError?: (error: Error) => void;
34
+ }
35
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,OAAO,GAAG,OAAO,GAAG,gBAAgB,CAAC;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC"}
@@ -0,0 +1,8 @@
1
+ export declare function formatNumber(num: number): string;
2
+ export declare function getMediaUrl(post: {
3
+ mediaType: string;
4
+ thumbnailUrl: string | null;
5
+ mediaUrl: string;
6
+ }): string;
7
+ export declare function escapeHtml(text: string): string;
8
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQhD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAIT;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C"}
@@ -0,0 +1,4 @@
1
+ export { SocialfireWidget } from './react/SocialfireWidget';
2
+ export type { SocialfireWidgetProps } from './react/SocialfireWidget';
3
+ export type { SocialfirePost, SocialfireFeed, WidgetConfig } from './core/types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ import e,{useState as r,useEffect as t}from"react";import{s as n,g as o,f as a,i,F as s}from"./utils-BNIlvbZe.js";var l,c={exports:{}},u={};var f,p,y={};function d(){return f||(f=1,"production"!==process.env.NODE_ENV&&function(){var r=e,t=/* @__PURE__ */Symbol.for("react.element"),n=/* @__PURE__ */Symbol.for("react.portal"),o=/* @__PURE__ */Symbol.for("react.fragment"),a=/* @__PURE__ */Symbol.for("react.strict_mode"),i=/* @__PURE__ */Symbol.for("react.profiler"),s=/* @__PURE__ */Symbol.for("react.provider"),l=/* @__PURE__ */Symbol.for("react.context"),c=/* @__PURE__ */Symbol.for("react.forward_ref"),u=/* @__PURE__ */Symbol.for("react.suspense"),f=/* @__PURE__ */Symbol.for("react.suspense_list"),p=/* @__PURE__ */Symbol.for("react.memo"),d=/* @__PURE__ */Symbol.for("react.lazy"),v=/* @__PURE__ */Symbol.for("react.offscreen"),m=Symbol.iterator;var h=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];!function(e,r,t){var n=h.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(r+="%s",t=t.concat([n]));var o=t.map(function(e){return String(e)});o.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,o)}("error",e,t)}var b;function j(e){return e.displayName||"Context"}function x(e){if(null==e)return null;if("number"==typeof e.tag&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case n:return"Portal";case i:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case l:return j(e)+".Consumer";case s:return j(e._context)+".Provider";case c:return function(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return""!==o?t+"("+o+")":t}(e,e.render,"ForwardRef");case p:var r=e.displayName||null;return null!==r?r:x(e.type)||"Memo";case d:var t=e,y=t._payload,v=t._init;try{return x(v(y))}catch(m){return null}}return null}b=/* @__PURE__ */Symbol.for("react.module.reference");var _,k,w,O,S,E,R,C=Object.assign,T=0;function P(){}P.__reactDisabledLog=!0;var $,I=h.ReactCurrentDispatcher;function F(e,r,t){if(void 0===$)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);$=n&&n[1]||""}return"\n"+$+e}var N,D=!1,L="function"==typeof WeakMap?WeakMap:Map;function M(e,r){if(!e||D)return"";var t,n=N.get(e);if(void 0!==n)return n;D=!0;var o,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=I.current,I.current=null,function(){if(0===T){_=console.log,k=console.info,w=console.warn,O=console.error,S=console.group,E=console.groupCollapsed,R=console.groupEnd;var e={configurable:!0,enumerable:!0,value:P,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}T++}();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(d){t=d}Reflect.construct(e,[],i)}else{try{i.call()}catch(d){t=d}e.call(i.prototype)}}else{try{throw Error()}catch(d){t=d}e()}}catch(v){if(v&&t&&"string"==typeof v.stack){for(var s=v.stack.split("\n"),l=t.stack.split("\n"),c=s.length-1,u=l.length-1;c>=1&&u>=0&&s[c]!==l[u];)u--;for(;c>=1&&u>=0;c--,u--)if(s[c]!==l[u]){if(1!==c||1!==u)do{if(c--,--u<0||s[c]!==l[u]){var f="\n"+s[c].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),"function"==typeof e&&N.set(e,f),f}}while(c>=1&&u>=0);break}}}finally{D=!1,I.current=o,function(){if(0===--T){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},e,{value:_}),info:C({},e,{value:k}),warn:C({},e,{value:w}),error:C({},e,{value:O}),group:C({},e,{value:S}),groupCollapsed:C({},e,{value:E}),groupEnd:C({},e,{value:R})})}T<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var p=e?e.displayName||e.name:"",y=p?F(p):"";return"function"==typeof e&&N.set(e,y),y}function z(e,r,t){if(null==e)return"";if("function"==typeof e)return M(e,!(!(n=e.prototype)||!n.isReactComponent));var n;if("string"==typeof e)return F(e);switch(e){case u:return F("Suspense");case f:return F("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c:return M(e.render,!1);case p:return z(e.type,r,t);case d:var o=e,a=o._payload,i=o._init;try{return z(i(a),r,t)}catch(s){}}return""}N=new L;var U=Object.prototype.hasOwnProperty,A={},W=h.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=z(e.type,e._source,r?r.type:null);W.setExtraStackFrame(t)}else W.setExtraStackFrame(null)}var V=Array.isArray;function H(e){return V(e)}function Y(e){return""+e}function J(e){if(function(e){try{return Y(e),!1}catch(r){return!0}}(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),Y(e)}var K,X,q=h.ReactCurrentOwner,G={key:!0,ref:!0,__self:!0,__source:!0};function Q(e,r,n,o,a){var i,s={},l=null,c=null;for(i in void 0!==n&&(J(n),l=""+n),function(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return void 0!==e.key}(r)&&(J(r.key),l=""+r.key),function(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return void 0!==e.ref}(r)&&(c=r.ref,function(e){"string"==typeof e.ref&&q.current}(r)),r)U.call(r,i)&&!G.hasOwnProperty(i)&&(s[i]=r[i]);if(e&&e.defaultProps){var u=e.defaultProps;for(i in u)void 0===s[i]&&(s[i]=u[i])}if(l||c){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,r){var t=function(){K||(K=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(s,f),c&&function(e,r){var t=function(){X||(X=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}(s,f)}return function(e,r,n,o,a,i,s){var l={$$typeof:t,type:e,key:r,ref:n,props:s,_owner:i,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}(e,l,c,a,o,q.current,s)}var Z,ee=h.ReactCurrentOwner,re=h.ReactDebugCurrentFrame;function te(e){if(e){var r=e._owner,t=z(e.type,e._source,r?r.type:null);re.setExtraStackFrame(t)}else re.setExtraStackFrame(null)}function ne(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function oe(){if(ee.current){var e=x(ee.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}Z=!1;var ae={};function ie(e,r){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var t=function(e){var r=oe();if(!r){var t="string"==typeof e?e:e.displayName||e.name;t&&(r="\n\nCheck the top-level render call using <"+t+">.")}return r}(r);if(!ae[t]){ae[t]=!0;var n="";e&&e._owner&&e._owner!==ee.current&&(n=" It was passed a child from "+x(e._owner.type)+"."),te(e),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),te(null)}}}function se(e,r){if("object"==typeof e)if(H(e))for(var t=0;t<e.length;t++){var n=e[t];ne(n)&&ie(n,r)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var r=m&&e[m]||e["@@iterator"];return"function"==typeof r?r:null}(e);if("function"==typeof o&&o!==e.entries)for(var a,i=o.call(e);!(a=i.next()).done;)ne(a.value)&&ie(a.value,r)}}function le(e){var r,t=e.type;if(null!=t&&"string"!=typeof t){if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==c&&t.$$typeof!==p)return;r=t.propTypes}if(r){var n=x(t);!function(e,r,t,n,o){var a=Function.call.bind(U);for(var i in e)if(a(e,i)){var s=void 0;try{if("function"!=typeof e[i]){var l=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){s=c}!s||s instanceof Error||(B(o),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof s),B(null)),s instanceof Error&&!(s.message in A)&&(A[s.message]=!0,B(o),g("Failed %s type: %s",t,s.message),B(null))}}(r,e.props,"prop",n,e)}else if(void 0!==t.PropTypes&&!Z){Z=!0,g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",x(t)||"Unknown")}"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var ce={};function ue(e,r,n,y,m,h){var j=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===i||e===a||e===u||e===f||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===p||e.$$typeof===s||e.$$typeof===l||e.$$typeof===c||e.$$typeof===b||void 0!==e.getModuleId)}(e);if(!j){var _="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(_+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var k;_+=oe(),null===e?k="null":H(e)?k="array":void 0!==e&&e.$$typeof===t?(k="<"+(x(e.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):k=typeof e,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",k,_)}var w=Q(e,r,n,m,h);if(null==w)return w;if(j){var O=r.children;if(void 0!==O)if(y)if(H(O)){for(var S=0;S<O.length;S++)se(O[S],e);Object.freeze&&Object.freeze(O)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else se(O,e)}if(U.call(r,"key")){var E=x(e),R=Object.keys(r).filter(function(e){return"key"!==e}),C=R.length>0?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}";if(!ce[E+C])g('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',C,E,R.length>0?"{"+R.join(": ..., ")+": ...}":"{}",E),ce[E+C]=!0}return e===o?function(e){for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if("children"!==n&&"key"!==n){te(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),te(null);break}}null!==e.ref&&(te(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),te(null))}(w):le(w),w}var fe=function(e,r,t){return ue(e,r,t,!1)},pe=function(e,r,t){return ue(e,r,t,!0)};y.Fragment=o,y.jsx=fe,y.jsxs=pe}()),y}var v=(p||(p=1,"production"===process.env.NODE_ENV?c.exports=function(){if(l)return u;l=1;var r=e,t=/* @__PURE__ */Symbol.for("react.element"),n=/* @__PURE__ */Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(e,r,n){var s,l={},c=null,u=null;for(s in void 0!==n&&(c=""+n),void 0!==r.key&&(c=""+r.key),void 0!==r.ref&&(u=r.ref),r)o.call(r,s)&&!i.hasOwnProperty(s)&&(l[s]=r[s]);if(e&&e.defaultProps)for(s in r=e.defaultProps)void 0===l[s]&&(l[s]=r[s]);return{$$typeof:t,type:e,key:c,ref:u,props:l,_owner:a.current}}return u.Fragment=n,u.jsx=s,u.jsxs=s,u}():c.exports=d()),c.exports);function m({post:e,feed:t}){const[i,s]=r(!1);/* @__PURE__ */
2
+ return v.jsxs("a",{href:e.permalink,target:"_blank",rel:"noopener noreferrer",style:{...n.postLink,...i?n.postLinkHover:{}},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[
3
+ /* @__PURE__ */v.jsx("img",{src:o(e),alt:e.caption||"Instagram post",style:n.image,loading:"lazy"}),"VIDEO"===e.mediaType&&/* @__PURE__ */v.jsx("div",{style:n.mediaIcon,children:/* @__PURE__ */v.jsx("svg",{style:n.svgIcon,fill:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */v.jsx("path",{d:"M8 5v14l11-7z"})})}),"CAROUSEL_ALBUM"===e.mediaType&&/* @__PURE__ */v.jsx("div",{style:n.mediaIcon,children:/* @__PURE__ */v.jsx("svg",{style:n.svgIcon,fill:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */v.jsx("path",{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"})})}),(t.showLikes||t.showComments)&&/* @__PURE__ */v.jsxs("div",{style:{...n.hoverOverlay,...i?n.hoverOverlayVisible:{}},children:[t.showLikes&&/* @__PURE__ */v.jsxs("div",{style:n.statContainer,children:[
4
+ /* @__PURE__ */v.jsx("svg",{style:n.statIcon,fill:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */v.jsx("path",{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"})}),
5
+ /* @__PURE__ */v.jsx("span",{style:n.statText,children:a(e.likeCount||0)})]}),t.showComments&&/* @__PURE__ */v.jsxs("div",{style:n.statContainer,children:[
6
+ /* @__PURE__ */v.jsx("svg",{style:n.statIcon,fill:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */v.jsx("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"})}),
7
+ /* @__PURE__ */v.jsx("span",{style:n.statText,children:a(e.commentsCount||0)})]})]}),t.showCaptions&&e.caption&&/* @__PURE__ */v.jsx("div",{style:n.captionOverlay,children:/* @__PURE__ */v.jsx("p",{style:n.captionText,children:e.caption})})]})}function h(){/* @__PURE__ */
8
+ return v.jsx("div",{style:n.loadingContainer,children:/* @__PURE__ */v.jsxs("div",{style:n.loadingInner,children:[
9
+ /* @__PURE__ */v.jsx("div",{style:n.spinner}),
10
+ /* @__PURE__ */v.jsx("p",{style:n.loadingText,children:"Loading feed..."})]})})}function g({error:e}){/* @__PURE__ */
11
+ return v.jsxs("div",{style:n.errorContainer,children:[
12
+ /* @__PURE__ */v.jsx("p",{style:n.errorTitle,children:"Failed to load Instagram feed"}),
13
+ /* @__PURE__ */v.jsx("p",{style:n.errorMessage,children:e.message})]})}function b(){/* @__PURE__ */
14
+ return v.jsx("div",{style:n.emptyContainer,children:/* @__PURE__ */v.jsx("p",{children:"No posts available"})})}const j=({feedId:e,apiUrl:o,className:a="",onLoad:l,onError:c,loadingComponent:u,errorComponent:f})=>{const[p,y]=r(null),[d,j]=r(!0),[x,_]=r(null);return t(()=>{i();const r=new AbortController,t=new s(o);return async function(){try{const n=await t.fetchFeed(e,r.signal);y(n),l?.(n)}catch(n){if(n instanceof Error&&"AbortError"===n.name)return;const e=n instanceof Error?n:new Error("Unknown error");_(e),c?.(e)}finally{j(!1)}}(),()=>r.abort()},[e,o,l,c]),d?u?/* @__PURE__ */v.jsx(v.Fragment,{children:u}):/* @__PURE__ */v.jsx(h,{}):x?f?/* @__PURE__ */v.jsx(v.Fragment,{children:f(x)}):/* @__PURE__ */v.jsx(g,{error:x}):p?.posts?.length?/* @__PURE__ */v.jsx("div",{className:`socialfire-widget ${a}`,children:/* @__PURE__ */v.jsx("div",{style:n.grid(p.columns,p.gap),children:p.posts.map(e=>/* @__PURE__ */v.jsx(m,{post:e,feed:p},e.id))})}):/* @__PURE__ */v.jsx(b,{})};export{j as SocialfireWidget};
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../node_modules/react/cjs/react-jsx-runtime.development.js","../../node_modules/react/jsx-runtime.js","../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../src/react/components/PostItem.tsx","../src/react/components/LoadingState.tsx","../src/react/components/ErrorState.tsx","../src/react/components/EmptyState.tsx","../src/react/SocialfireWidget.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","import React, { useState } from 'react';\r\nimport { SocialfirePost, SocialfireFeed } from '../../core/types';\r\nimport { styles } from '../../core/styles';\r\nimport { formatNumber, getMediaUrl } from '../../core/utils';\r\n\r\ninterface PostItemProps {\r\n post: SocialfirePost;\r\n feed: SocialfireFeed;\r\n}\r\n\r\nexport default function PostItem({ post, feed }: PostItemProps) {\r\n const [isHovered, setIsHovered] = useState(false);\r\n\r\n return (\r\n <a\r\n href={post.permalink}\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n style={{\r\n ...styles.postLink,\r\n ...(isHovered ? styles.postLinkHover : {}),\r\n }}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n >\r\n {/* Post Image */}\r\n <img\r\n src={getMediaUrl(post)}\r\n alt={post.caption || 'Instagram post'}\r\n style={styles.image}\r\n loading=\"lazy\"\r\n />\r\n\r\n {/* Video Play Icon */}\r\n {post.mediaType === 'VIDEO' && (\r\n <div style={styles.mediaIcon}>\r\n <svg style={styles.svgIcon} fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M8 5v14l11-7z\" />\r\n </svg>\r\n </div>\r\n )}\r\n\r\n {/* Carousel Icon */}\r\n {post.mediaType === 'CAROUSEL_ALBUM' && (\r\n <div style={styles.mediaIcon}>\r\n <svg style={styles.svgIcon} fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z\" />\r\n </svg>\r\n </div>\r\n )}\r\n\r\n {/* Hover Overlay with Stats */}\r\n {(feed.showLikes || feed.showComments) && (\r\n <div\r\n style={{\r\n ...styles.hoverOverlay,\r\n ...(isHovered ? styles.hoverOverlayVisible : {}),\r\n }}\r\n >\r\n {feed.showLikes && (\r\n <div style={styles.statContainer}>\r\n <svg style={styles.statIcon} fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z\" />\r\n </svg>\r\n <span style={styles.statText}>{formatNumber(post.likeCount || 0)}</span>\r\n </div>\r\n )}\r\n {feed.showComments && (\r\n <div style={styles.statContainer}>\r\n <svg style={styles.statIcon} fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z\" />\r\n </svg>\r\n <span style={styles.statText}>{formatNumber(post.commentsCount || 0)}</span>\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n\r\n {/* Caption Overlay */}\r\n {feed.showCaptions && post.caption && (\r\n <div style={styles.captionOverlay}>\r\n <p style={styles.captionText}>{post.caption}</p>\r\n </div>\r\n )}\r\n </a>\r\n );\r\n}\r\n","import React from 'react';\r\nimport { styles } from '../../core/styles';\r\n\r\nexport default function LoadingState() {\r\n return (\r\n <div style={styles.loadingContainer}>\r\n <div style={styles.loadingInner}>\r\n <div style={styles.spinner}></div>\r\n <p style={styles.loadingText}>Loading feed...</p>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import React from 'react';\r\nimport { styles } from '../../core/styles';\r\n\r\nexport default function ErrorState({ error }: { error: Error }) {\r\n return (\r\n <div style={styles.errorContainer}>\r\n <p style={styles.errorTitle}>Failed to load Instagram feed</p>\r\n <p style={styles.errorMessage}>{error.message}</p>\r\n </div>\r\n );\r\n}\r\n","import React from 'react';\r\nimport { styles } from '../../core/styles';\r\n\r\nexport default function EmptyState() {\r\n return (\r\n <div style={styles.emptyContainer}>\r\n <p>No posts available</p>\r\n </div>\r\n );\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { SocialfireFeed } from '../core/types';\r\nimport { FeedFetcher } from '../core/fetcher';\r\nimport { styles, injectGlobalStyles } from '../core/styles';\r\nimport PostItem from './components/PostItem';\r\nimport LoadingState from './components/LoadingState';\r\nimport ErrorState from './components/ErrorState';\r\nimport EmptyState from './components/EmptyState';\r\n\r\nexport interface SocialfireWidgetProps {\r\n feedId: string;\r\n apiUrl?: string;\r\n className?: string;\r\n onLoad?: (feed: SocialfireFeed) => void;\r\n onError?: (error: Error) => void;\r\n loadingComponent?: React.ReactNode;\r\n errorComponent?: (error: Error) => React.ReactNode;\r\n}\r\n\r\nexport const SocialfireWidget: React.FC<SocialfireWidgetProps> = ({\r\n feedId,\r\n apiUrl,\r\n className = '',\r\n onLoad,\r\n onError,\r\n loadingComponent,\r\n errorComponent,\r\n}) => {\r\n const [feed, setFeed] = useState<SocialfireFeed | null>(null);\r\n const [loading, setLoading] = useState(true);\r\n const [error, setError] = useState<Error | null>(null);\r\n\r\n useEffect(() => {\r\n injectGlobalStyles();\r\n const abortController = new AbortController();\r\n const fetcher = new FeedFetcher(apiUrl);\r\n\r\n async function fetchFeed() {\r\n try {\r\n const data = await fetcher.fetchFeed(feedId, abortController.signal);\r\n setFeed(data);\r\n onLoad?.(data);\r\n } catch (err) {\r\n if (err instanceof Error && err.name === 'AbortError') return;\r\n const error = err instanceof Error ? err : new Error('Unknown error');\r\n setError(error);\r\n onError?.(error);\r\n } finally {\r\n setLoading(false);\r\n }\r\n }\r\n\r\n fetchFeed();\r\n return () => abortController.abort();\r\n }, [feedId, apiUrl, onLoad, onError]);\r\n\r\n if (loading) {\r\n return loadingComponent ? <>{loadingComponent}</> : <LoadingState />;\r\n }\r\n\r\n if (error) {\r\n return errorComponent ? <>{errorComponent(error)}</> : <ErrorState error={error} />;\r\n }\r\n\r\n if (!feed?.posts?.length) {\r\n return <EmptyState />;\r\n }\r\n\r\n return (\r\n <div className={`socialfire-widget ${className}`}>\r\n <div style={styles.grid(feed.columns, feed.gap)}>\r\n {feed.posts.map((post) => (\r\n <PostItem key={post.id} post={post} feed={feed} />\r\n ))}\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default SocialfireWidget;\r\n"],"names":["process","env","NODE_ENV","React","require$$0","REACT_ELEMENT_TYPE","Symbol","for","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","iterator","ReactSharedInternals","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","error","format","_len2","arguments","length","args","Array","_key2","level","stack","ReactDebugCurrentFrame","getStackAddendum","concat","argsWithFormat","map","item","String","unshift","Function","prototype","apply","call","console","printWarning","REACT_MODULE_REFERENCE","getContextName","type","displayName","getComponentNameFromType","tag","name","$$typeof","_context","outerType","innerType","wrapperName","functionName","getWrappedName","render","outerName","lazyComponent","payload","_payload","init","_init","x","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","assign","Object","disabledDepth","disabledLog","__reactDisabledLog","prefix","ReactCurrentDispatcher","describeBuiltInComponentFrame","source","ownerFn","Error","match","trim","componentFrameCache","reentry","PossiblyWeakMap","WeakMap","Map","describeNativeComponentFrame","fn","construct","control","frame","get","previousDispatcher","previousPrepareStackTrace","prepareStackTrace","current","log","info","warn","group","groupCollapsed","groupEnd","props","configurable","enumerable","value","writable","defineProperties","disableLogs","Fake","defineProperty","set","Reflect","sample","sampleLines","split","controlLines","s","c","_frame","replace","includes","reenableLogs","syntheticFrame","describeUnknownElementTypeFrameInDEV","isReactComponent","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","_owner","_source","setExtraStackFrame","isArrayImpl","isArray","a","testStringCoercion","checkKeyStringCoercion","e","willCoercionThrow","toStringTag","constructor","typeName","specialPropKeyWarningShown","specialPropRefWarningShown","ReactCurrentOwner","RESERVED_PROPS","key","ref","__self","__source","jsxDEV","config","maybeKey","self","propName","getter","getOwnPropertyDescriptor","isReactWarning","hasValidKey","hasValidRef","warnIfStringRefCannotBeAutoConverted","defaultProps","warnAboutAccessingKey","defineKeyPropWarningGetter","warnAboutAccessingRef","defineRefPropWarningGetter","_store","freeze","ReactElement","propTypesMisspellWarningShown","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","isValidElement","object","getDeclarationErrorAddendum","ownerHasKeyUseWarning","validateExplicitKey","parentType","validated","currentComponentErrorInfo","parentName","getCurrentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","maybeIterable","maybeIterator","getIteratorFn","entries","step","next","done","validatePropTypes","propTypes","typeSpecs","values","location","componentName","has","bind","typeSpecName","error$1","err","ex","message","checkPropTypes","PropTypes","getDefaultProps","isReactClassApproved","didWarnAboutKeySpread","jsxWithValidation","isStaticChildren","validType","getModuleId","isValidElementType","keys","typeString","children","filter","k","beforeExample","join","fragment","validateFragmentProps","jsx","jsxs","reactJsxRuntime_development","Fragment","jsxRuntimeModule","exports","f","l","m","n","p","q","g","b","d","h","reactJsxRuntime_production_min","require$$1","PostItem","post","feed","isHovered","setIsHovered","useState","href","permalink","target","rel","style","styles","postLink","postLinkHover","onMouseEnter","onMouseLeave","src","getMediaUrl","alt","caption","image","loading","mediaType","mediaIcon","svgIcon","fill","viewBox","showLikes","showComments","hoverOverlay","hoverOverlayVisible","statContainer","statIcon","statText","formatNumber","likeCount","commentsCount","showCaptions","captionOverlay","captionText","LoadingState","loadingContainer","loadingInner","spinner","loadingText","ErrorState","errorContainer","errorTitle","errorMessage","EmptyState","emptyContainer","SocialfireWidget","feedId","apiUrl","className","onLoad","onError","loadingComponent","errorComponent","setFeed","setLoading","setError","useEffect","injectGlobalStyles","abortController","AbortController","fetcher","FeedFetcher","async","data","fetchFeed","signal","abort","posts","grid","columns","gap","id"],"mappings":"qLAY6B,eAAzBA,QAAQC,IAAIC,UACd,WAGF,IAAIC,EAAQC,EAMRC,iBAAqBC,OAAOC,IAAI,iBAChCC,iBAAoBF,OAAOC,IAAI,gBAC/BE,iBAAsBH,OAAOC,IAAI,kBACjCG,iBAAyBJ,OAAOC,IAAI,qBACpCI,iBAAsBL,OAAOC,IAAI,kBACjCK,iBAAsBN,OAAOC,IAAI,kBACjCM,iBAAqBP,OAAOC,IAAI,iBAChCO,iBAAyBR,OAAOC,IAAI,qBACpCQ,iBAAsBT,OAAOC,IAAI,kBACjCS,iBAA2BV,OAAOC,IAAI,uBACtCU,iBAAkBX,OAAOC,IAAI,cAC7BW,iBAAkBZ,OAAOC,IAAI,cAC7BY,iBAAuBb,OAAOC,IAAI,mBAClCa,EAAwBd,OAAOe,SAgBnC,IAAIC,EAAuBnB,EAAMoB,mDAEjC,SAASC,EAAMC,GAGT,IAAA,IAASC,EAAQC,UAAUC,OAAQC,EAAO,IAAIC,MAAMJ,EAAQ,EAAIA,EAAQ,EAAI,GAAIK,EAAQ,EAAGA,EAAQL,EAAOK,IACxGF,EAAKE,EAAQ,GAAKJ,UAAUI,IAQpC,SAAsBC,EAAOP,EAAQI,GAIjC,IACII,EADyBX,EAAqBY,uBACfC,mBAErB,KAAVF,IACFR,GAAU,KACVI,EAAOA,EAAKO,OAAO,CAACH,KAItB,IAAII,EAAiBR,EAAKS,IAAI,SAAUC,GACtC,OAAOC,OAAOD,EACpB,GAEIF,EAAeI,QAAQ,YAAchB,GAIrCiB,SAASC,UAAUC,MAAMC,KAAKC,QAAQd,GAAQc,QAAST,EAE3D,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,EAAgBO,QAC7DZ,EAAQU,GACRd,IAASc,EACX,OAAS7G,GACP,GAAIA,aAAelI,OAAsB,eAAbkI,EAAInK,KAAuB,OACvD,MAAM9B,EAAQiM,aAAelI,MAAQkI,EAAM,IAAIlI,MAAM,iBACrDuO,EAAStS,GACTiS,IAAUjS,EACZ,CAAA,QACEqS,GAAW,EACb,CACF,CAEAU,GACO,IAAMN,EAAgBQ,SAC5B,CAACpB,EAAQC,EAAQE,EAAQC,IAExBnC,EACKoC,iBAAmB3E,MAAAG,EAAAA,SAAA,CAAGV,SAAAkF,yBAAwBjB,EAAA,IAGnDjR,EACKmS,mCAAoBnF,SAAAmF,EAAenS,oBAAauN,EAAAA,IAAC+D,GAAWtR,UAGhE2O,GAAMuE,OAAO9S,wBAKhBmN,IAAC,MAAA,CAAIwE,UAAW,qBAAqBA,IACnC/E,wBAAAO,EAAAA,IAAC,MAAA,CAAI4B,MAAOC,EAAO+D,KAAKxE,EAAKyE,QAASzE,EAAK0E,KACxCrG,SAAA2B,EAAKuE,MAAMpS,IAAK4N,kBACfnB,EAAAA,IAACkB,EAAA,CAAuBC,OAAYC,QAArBD,EAAK4E,8BAPlB5B,EAAA","x_google_ignoreList":[0,1,2]}
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { SocialfireFeed } from '../core/types';
3
+ export interface SocialfireWidgetProps {
4
+ feedId: string;
5
+ apiUrl?: string;
6
+ className?: string;
7
+ onLoad?: (feed: SocialfireFeed) => void;
8
+ onError?: (error: Error) => void;
9
+ loadingComponent?: React.ReactNode;
10
+ errorComponent?: (error: Error) => React.ReactNode;
11
+ }
12
+ export declare const SocialfireWidget: React.FC<SocialfireWidgetProps>;
13
+ export default SocialfireWidget;
14
+ //# sourceMappingURL=SocialfireWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SocialfireWidget.d.ts","sourceRoot":"","sources":["../../src/react/SocialfireWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQ/C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,CAAC,SAAS,CAAC;CACpD;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA0D5D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export default function EmptyState(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=EmptyState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/react/components/EmptyState.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,UAAU,4CAMjC"}
@@ -0,0 +1,4 @@
1
+ export default function ErrorState({ error }: {
2
+ error: Error;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=ErrorState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorState.d.ts","sourceRoot":"","sources":["../../../src/react/components/ErrorState.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,2CAO7D"}
@@ -0,0 +1,2 @@
1
+ export default function LoadingState(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=LoadingState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoadingState.d.ts","sourceRoot":"","sources":["../../../src/react/components/LoadingState.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,YAAY,4CASnC"}
@@ -0,0 +1,8 @@
1
+ import { SocialfirePost, SocialfireFeed } from '../../core/types';
2
+ interface PostItemProps {
3
+ post: SocialfirePost;
4
+ feed: SocialfireFeed;
5
+ }
6
+ export default function PostItem({ post, feed }: PostItemProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=PostItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PostItem.d.ts","sourceRoot":"","sources":["../../../src/react/components/PostItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlE,UAAU,aAAa;IACrB,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,aAAa,2CA4E7D"}
@@ -0,0 +1,4 @@
1
+ export { SocialfireWidget } from './SocialfireWidget';
2
+ export type { SocialfireWidgetProps } from './SocialfireWidget';
3
+ export type { SocialfirePost, SocialfireFeed } from '../core/types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ class n{constructor(n){this.baseUrl=n||this.getDefaultBaseUrl()}getDefaultBaseUrl(){return"undefined"!=typeof window?"undefined"!=typeof process&&process.env?.NEXT_PUBLIC_APP_URL?process.env.NEXT_PUBLIC_APP_URL:window.location.origin:""}async fetchFeed(n,e){const t=`${this.baseUrl}/api/feeds/${n}`,o=await fetch(t,{signal:e,headers:{"Content-Type":"application/json"}});if(!o.ok)throw new Error(`Failed to fetch feed: ${o.statusText}`);return await o.json()}}const e={grid:(n,e)=>({display:"grid",gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:`${e}px`}),postLink:{position:"relative",aspectRatio:"1 / 1",overflow:"hidden",borderRadius:"8px",backgroundColor:"#f3f4f6",display:"block",transition:"opacity 0.2s",textDecoration:"none"},postLinkHover:{opacity:.9},image:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"},mediaIcon:{position:"absolute",top:"8px",right:"8px",backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:"9999px",padding:"4px"},svgIcon:{width:"16px",height:"16px",color:"white"},hoverOverlay:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:"16px",color:"white"},hoverOverlayVisible:{opacity:1},statContainer:{display:"flex",alignItems:"center",gap:"6px"},statIcon:{width:"20px",height:"20px"},statText:{fontWeight:600},captionOverlay:{position:"absolute",bottom:0,left:0,right:0,background:"linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent)",padding:"12px"},captionText:{color:"white",fontSize:"12px",lineHeight:"16px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},loadingContainer:{display:"flex",alignItems:"center",justifyContent:"center",padding:"48px"},loadingInner:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},spinner:{width:"32px",height:"32px",border:"4px solid #2563eb",borderTopColor:"transparent",borderRadius:"9999px",animation:"spin 1s linear infinite"},loadingText:{fontSize:"14px",color:"#6b7280"},errorContainer:{padding:"24px",backgroundColor:"#fef2f2",border:"1px solid #fecaca",borderRadius:"8px"},errorTitle:{color:"#dc2626",fontWeight:500},errorMessage:{fontSize:"14px",color:"#ef4444",marginTop:"4px"},emptyContainer:{padding:"48px",textAlign:"center",color:"#6b7280"}},t=()=>{if("undefined"==typeof document)return;if(document.getElementById("socialfire-widget-global"))return;const n=document.createElement("style");n.id="socialfire-widget-global",n.textContent="\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n ",document.head.appendChild(n)},o="\n :host {\n display: block;\n }\n\n .socialfire-widget {\n width: 100%;\n }\n\n .socialfire-grid {\n display: grid;\n }\n\n .post-link {\n position: relative;\n aspect-ratio: 1 / 1;\n overflow: hidden;\n border-radius: 8px;\n background-color: #f3f4f6;\n display: block;\n transition: opacity 0.2s;\n text-decoration: none;\n }\n\n .post-link:hover {\n opacity: 0.9;\n }\n\n .post-image {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .media-icon {\n position: absolute;\n top: 8px;\n right: 8px;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 9999px;\n padding: 4px;\n }\n\n .media-icon svg {\n width: 16px;\n height: 16px;\n color: white;\n display: block;\n }\n\n .hover-overlay {\n position: absolute;\n inset: 0;\n background-color: rgba(0, 0, 0, 0.6);\n opacity: 0;\n transition: opacity 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n color: white;\n }\n\n .post-link:hover .hover-overlay {\n opacity: 1;\n }\n\n .stat-container {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .stat-container svg {\n width: 20px;\n height: 20px;\n }\n\n .stat-text {\n font-weight: 600;\n }\n\n .caption-overlay {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);\n padding: 12px;\n }\n\n .caption-text {\n color: white;\n font-size: 12px;\n line-height: 16px;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .loading-container {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 48px;\n }\n\n .loading-inner {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n }\n\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n .spinner {\n width: 32px;\n height: 32px;\n border: 4px solid #2563eb;\n border-top-color: transparent;\n border-radius: 9999px;\n animation: spin 1s linear infinite;\n }\n\n .loading-text {\n font-size: 14px;\n color: #6b7280;\n }\n\n .error-container {\n padding: 24px;\n background-color: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 8px;\n }\n\n .error-title {\n color: #dc2626;\n font-weight: 500;\n }\n\n .error-message {\n font-size: 14px;\n color: #ef4444;\n margin-top: 4px;\n }\n\n .empty-container {\n padding: 48px;\n text-align: center;\n color: #6b7280;\n }\n";function i(n){return n>=1e6?(n/1e6).toFixed(1).replace(/\.0$/,"")+"M":n>=1e3?(n/1e3).toFixed(1).replace(/\.0$/,"")+"K":n.toString()}function r(n){return"VIDEO"===n.mediaType&&n.thumbnailUrl?n.thumbnailUrl:n.mediaUrl}function a(n){const e=document.createElement("div");return e.textContent=n,e.innerHTML}export{n as F,o as a,a as e,i as f,r as g,t as i,e as s};
2
+ //# sourceMappingURL=utils-BNIlvbZe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-BNIlvbZe.js","sources":["../src/core/fetcher.ts","../src/core/styles.ts","../src/core/utils.ts"],"sourcesContent":["import { SocialfireFeed } from './types';\r\n\r\nexport class FeedFetcher {\r\n private baseUrl: string;\r\n\r\n constructor(baseUrl?: string) {\r\n this.baseUrl = baseUrl || this.getDefaultBaseUrl();\r\n }\r\n\r\n private getDefaultBaseUrl(): string {\r\n if (typeof window !== 'undefined') {\r\n // Check for Next.js env var\r\n if (typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_APP_URL) {\r\n return process.env.NEXT_PUBLIC_APP_URL;\r\n }\r\n // Use current origin\r\n return window.location.origin;\r\n }\r\n return '';\r\n }\r\n\r\n async fetchFeed(feedId: string, signal?: AbortSignal): Promise<SocialfireFeed> {\r\n const endpoint = `${this.baseUrl}/api/feeds/${feedId}`;\r\n\r\n const response = await fetch(endpoint, {\r\n signal,\r\n headers: { 'Content-Type': 'application/json' },\r\n });\r\n\r\n if (!response.ok) {\r\n throw new Error(`Failed to fetch feed: ${response.statusText}`);\r\n }\r\n\r\n return await response.json();\r\n }\r\n}\r\n","import type { CSSProperties } from 'react';\r\n\r\nexport const styles = {\r\n // Grid container\r\n grid: (columns: number, gap: number): CSSProperties => ({\r\n display: 'grid',\r\n gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,\r\n gap: `${gap}px`,\r\n }),\r\n\r\n // Post link wrapper\r\n postLink: {\r\n position: 'relative' as const,\r\n aspectRatio: '1 / 1',\r\n overflow: 'hidden',\r\n borderRadius: '8px',\r\n backgroundColor: '#f3f4f6',\r\n display: 'block',\r\n transition: 'opacity 0.2s',\r\n textDecoration: 'none',\r\n } as CSSProperties,\r\n\r\n postLinkHover: {\r\n opacity: 0.9,\r\n } as CSSProperties,\r\n\r\n // Image styles\r\n image: {\r\n position: 'absolute' as const,\r\n top: 0,\r\n left: 0,\r\n width: '100%',\r\n height: '100%',\r\n objectFit: 'cover' as const,\r\n } as CSSProperties,\r\n\r\n // Media type icons (video, carousel)\r\n mediaIcon: {\r\n position: 'absolute' as const,\r\n top: '8px',\r\n right: '8px',\r\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\r\n borderRadius: '9999px',\r\n padding: '4px',\r\n } as CSSProperties,\r\n\r\n svgIcon: {\r\n width: '16px',\r\n height: '16px',\r\n color: 'white',\r\n } as CSSProperties,\r\n\r\n // Hover overlay with stats\r\n hoverOverlay: {\r\n position: 'absolute' as const,\r\n inset: 0,\r\n backgroundColor: 'rgba(0, 0, 0, 0.6)',\r\n opacity: 0,\r\n transition: 'opacity 0.2s',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n gap: '16px',\r\n color: 'white',\r\n } as CSSProperties,\r\n\r\n hoverOverlayVisible: {\r\n opacity: 1,\r\n } as CSSProperties,\r\n\r\n statContainer: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '6px',\r\n } as CSSProperties,\r\n\r\n statIcon: {\r\n width: '20px',\r\n height: '20px',\r\n } as CSSProperties,\r\n\r\n statText: {\r\n fontWeight: 600,\r\n } as CSSProperties,\r\n\r\n // Caption overlay\r\n captionOverlay: {\r\n position: 'absolute' as const,\r\n bottom: 0,\r\n left: 0,\r\n right: 0,\r\n background: 'linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent)',\r\n padding: '12px',\r\n } as CSSProperties,\r\n\r\n captionText: {\r\n color: 'white',\r\n fontSize: '12px',\r\n lineHeight: '16px',\r\n display: '-webkit-box',\r\n WebkitLineClamp: 2,\r\n WebkitBoxOrient: 'vertical' as const,\r\n overflow: 'hidden',\r\n } as CSSProperties,\r\n\r\n // Loading state\r\n loadingContainer: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n padding: '48px',\r\n } as CSSProperties,\r\n\r\n loadingInner: {\r\n display: 'flex',\r\n flexDirection: 'column' as const,\r\n alignItems: 'center',\r\n gap: '12px',\r\n } as CSSProperties,\r\n\r\n spinner: {\r\n width: '32px',\r\n height: '32px',\r\n border: '4px solid #2563eb',\r\n borderTopColor: 'transparent',\r\n borderRadius: '9999px',\r\n animation: 'spin 1s linear infinite',\r\n } as CSSProperties,\r\n\r\n loadingText: {\r\n fontSize: '14px',\r\n color: '#6b7280',\r\n } as CSSProperties,\r\n\r\n // Error state\r\n errorContainer: {\r\n padding: '24px',\r\n backgroundColor: '#fef2f2',\r\n border: '1px solid #fecaca',\r\n borderRadius: '8px',\r\n } as CSSProperties,\r\n\r\n errorTitle: {\r\n color: '#dc2626',\r\n fontWeight: 500,\r\n } as CSSProperties,\r\n\r\n errorMessage: {\r\n fontSize: '14px',\r\n color: '#ef4444',\r\n marginTop: '4px',\r\n } as CSSProperties,\r\n\r\n // Empty state\r\n emptyContainer: {\r\n padding: '48px',\r\n textAlign: 'center' as const,\r\n color: '#6b7280',\r\n } as CSSProperties,\r\n};\r\n\r\n// Inject global styles for animations (used by both React and vanilla)\r\nexport const injectGlobalStyles = () => {\r\n if (typeof document === 'undefined') return;\r\n if (document.getElementById('socialfire-widget-global')) return;\r\n\r\n const style = document.createElement('style');\r\n style.id = 'socialfire-widget-global';\r\n style.textContent = `\r\n @keyframes spin {\r\n to { transform: rotate(360deg); }\r\n }\r\n `;\r\n document.head.appendChild(style);\r\n};\r\n\r\n// CSS string for Shadow DOM (vanilla component)\r\nexport const shadowStyles = `\r\n :host {\r\n display: block;\r\n }\r\n\r\n .socialfire-widget {\r\n width: 100%;\r\n }\r\n\r\n .socialfire-grid {\r\n display: grid;\r\n }\r\n\r\n .post-link {\r\n position: relative;\r\n aspect-ratio: 1 / 1;\r\n overflow: hidden;\r\n border-radius: 8px;\r\n background-color: #f3f4f6;\r\n display: block;\r\n transition: opacity 0.2s;\r\n text-decoration: none;\r\n }\r\n\r\n .post-link:hover {\r\n opacity: 0.9;\r\n }\r\n\r\n .post-image {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n object-fit: cover;\r\n }\r\n\r\n .media-icon {\r\n position: absolute;\r\n top: 8px;\r\n right: 8px;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n border-radius: 9999px;\r\n padding: 4px;\r\n }\r\n\r\n .media-icon svg {\r\n width: 16px;\r\n height: 16px;\r\n color: white;\r\n display: block;\r\n }\r\n\r\n .hover-overlay {\r\n position: absolute;\r\n inset: 0;\r\n background-color: rgba(0, 0, 0, 0.6);\r\n opacity: 0;\r\n transition: opacity 0.2s;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 16px;\r\n color: white;\r\n }\r\n\r\n .post-link:hover .hover-overlay {\r\n opacity: 1;\r\n }\r\n\r\n .stat-container {\r\n display: flex;\r\n align-items: center;\r\n gap: 6px;\r\n }\r\n\r\n .stat-container svg {\r\n width: 20px;\r\n height: 20px;\r\n }\r\n\r\n .stat-text {\r\n font-weight: 600;\r\n }\r\n\r\n .caption-overlay {\r\n position: absolute;\r\n bottom: 0;\r\n left: 0;\r\n right: 0;\r\n background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);\r\n padding: 12px;\r\n }\r\n\r\n .caption-text {\r\n color: white;\r\n font-size: 12px;\r\n line-height: 16px;\r\n display: -webkit-box;\r\n -webkit-line-clamp: 2;\r\n -webkit-box-orient: vertical;\r\n overflow: hidden;\r\n }\r\n\r\n .loading-container {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 48px;\r\n }\r\n\r\n .loading-inner {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n gap: 12px;\r\n }\r\n\r\n @keyframes spin {\r\n to { transform: rotate(360deg); }\r\n }\r\n\r\n .spinner {\r\n width: 32px;\r\n height: 32px;\r\n border: 4px solid #2563eb;\r\n border-top-color: transparent;\r\n border-radius: 9999px;\r\n animation: spin 1s linear infinite;\r\n }\r\n\r\n .loading-text {\r\n font-size: 14px;\r\n color: #6b7280;\r\n }\r\n\r\n .error-container {\r\n padding: 24px;\r\n background-color: #fef2f2;\r\n border: 1px solid #fecaca;\r\n border-radius: 8px;\r\n }\r\n\r\n .error-title {\r\n color: #dc2626;\r\n font-weight: 500;\r\n }\r\n\r\n .error-message {\r\n font-size: 14px;\r\n color: #ef4444;\r\n margin-top: 4px;\r\n }\r\n\r\n .empty-container {\r\n padding: 48px;\r\n text-align: center;\r\n color: #6b7280;\r\n }\r\n`;\r\n","export function formatNumber(num: number): string {\r\n if (num >= 1000000) {\r\n return (num / 1000000).toFixed(1).replace(/\\.0$/, '') + 'M';\r\n }\r\n if (num >= 1000) {\r\n return (num / 1000).toFixed(1).replace(/\\.0$/, '') + 'K';\r\n }\r\n return num.toString();\r\n}\r\n\r\nexport function getMediaUrl(post: {\r\n mediaType: string;\r\n thumbnailUrl: string | null;\r\n mediaUrl: string;\r\n}): string {\r\n return post.mediaType === 'VIDEO' && post.thumbnailUrl\r\n ? post.thumbnailUrl\r\n : post.mediaUrl;\r\n}\r\n\r\nexport function escapeHtml(text: string): string {\r\n const div = document.createElement('div');\r\n div.textContent = text;\r\n return div.innerHTML;\r\n}\r\n"],"names":["FeedFetcher","constructor","baseUrl","this","getDefaultBaseUrl","window","process","env","NEXT_PUBLIC_APP_URL","location","origin","fetchFeed","feedId","signal","endpoint","response","fetch","headers","ok","Error","statusText","json","styles","grid","columns","gap","display","gridTemplateColumns","postLink","position","aspectRatio","overflow","borderRadius","backgroundColor","transition","textDecoration","postLinkHover","opacity","image","top","left","width","height","objectFit","mediaIcon","right","padding","svgIcon","color","hoverOverlay","inset","alignItems","justifyContent","hoverOverlayVisible","statContainer","statIcon","statText","fontWeight","captionOverlay","bottom","background","captionText","fontSize","lineHeight","WebkitLineClamp","WebkitBoxOrient","loadingContainer","loadingInner","flexDirection","spinner","border","borderTopColor","animation","loadingText","errorContainer","errorTitle","errorMessage","marginTop","emptyContainer","textAlign","injectGlobalStyles","document","getElementById","style","createElement","id","textContent","head","appendChild","shadowStyles","formatNumber","num","toFixed","replace","toString","getMediaUrl","post","mediaType","thumbnailUrl","mediaUrl","escapeHtml","text","div","innerHTML"],"mappings":"AAEO,MAAMA,EAGX,WAAAC,CAAYC,GACVC,KAAKD,QAAUA,GAAWC,KAAKC,mBACjC,CAEQ,iBAAAA,GACN,MAAsB,oBAAXC,OAEc,oBAAZC,SAA2BA,QAAQC,KAAKC,oBAC1CF,QAAQC,IAAIC,oBAGdH,OAAOI,SAASC,OAElB,EACT,CAEA,eAAMC,CAAUC,EAAgBC,GAC9B,MAAMC,EAAW,GAAGX,KAAKD,qBAAqBU,IAExCG,QAAiBC,MAAMF,EAAU,CACrCD,SACAI,QAAS,CAAE,eAAgB,sBAG7B,IAAKF,EAASG,GACZ,MAAM,IAAIC,MAAM,yBAAyBJ,EAASK,cAGpD,aAAaL,EAASM,MACxB,EChCK,M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AAU,OACVd,MAAO,WAIT0B,eAAgB,CACd5B,QAAS,OACTb,gBAAiB,UACjBqC,OAAQ,oBACRtC,aAAc,OAGhB2C,WAAY,CACV3B,MAAO,UACPS,WAAY,KAGdmB,aAAc,CACZd,SAAU,OACVd,MAAO,UACP6B,UAAW,OAIbC,eAAgB,CACdhC,QAAS,OACTiC,UAAW,SACX/B,MAAO,YAKEgC,EAAqB,KAChC,GAAwB,oBAAbC,SAA0B,OACrC,GAAIA,SAASC,eAAe,4BAA6B,OAEzD,MAAMC,EAAQF,SAASG,cAAc,SACrCD,EAAME,GAAK,2BACXF,EAAMG,YAAc,8EAKpBL,SAASM,KAAKC,YAAYL,IAIfM,EAAe,irFCjLrB,SAASC,EAAaC,GAC3B,OAAIA,GAAO,KACDA,EAAM,KAASC,QAAQ,GAAGC,QAAQ,OAAQ,IAAM,IAEtDF,GAAO,KACDA,EAAM,KAAMC,QAAQ,GAAGC,QAAQ,OAAQ,IAAM,IAEhDF,EAAIG,UACb,CAEO,SAASC,EAAYC,GAK1B,MAA0B,UAAnBA,EAAKC,WAAyBD,EAAKE,aACtCF,EAAKE,aACLF,EAAKG,QACX,CAEO,SAASC,EAAWC,GACzB,MAAMC,EAAMrB,SAASG,cAAc,OAEnC,OADAkB,EAAIhB,YAAce,EACXC,EAAIC,SACb"}
@@ -0,0 +1,12 @@
1
+ export declare class SocialfireWidgetElement extends HTMLElement {
2
+ private shadow;
3
+ private fetcher;
4
+ private abortController;
5
+ constructor();
6
+ static get observedAttributes(): string[];
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ attributeChangedCallback(): void;
10
+ private render;
11
+ }
12
+ //# sourceMappingURL=SocialfireWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SocialfireWidget.d.ts","sourceRoot":"","sources":["../../src/vanilla/SocialfireWidget.ts"],"names":[],"mappings":"AAKA,qBAAa,uBAAwB,SAAQ,WAAW;IACtD,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,eAAe,CAAgC;;IAQvD,MAAM,KAAK,kBAAkB,aAE5B;IAED,iBAAiB;IAIjB,oBAAoB;IAIpB,wBAAwB;YAIV,MAAM;CAwDrB"}
@@ -0,0 +1,4 @@
1
+ import { SocialfireWidgetElement } from './SocialfireWidget';
2
+ export { SocialfireWidgetElement };
3
+ export * from '../core/types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vanilla/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAO7D,OAAO,EAAE,uBAAuB,EAAE,CAAC;AACnC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { SocialfireFeed } from '../core/types';
2
+ export declare function renderWidget(feed: SocialfireFeed): string;
3
+ export declare const renderLoading: () => string;
4
+ export declare const renderError: (error: Error) => string;
5
+ export declare const renderEmpty: () => string;
6
+ //# sourceMappingURL=renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/vanilla/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQ/C,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAazD;AAED,eAAO,MAAM,aAAa,cAAgC,CAAC;AAC3D,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,WAA+B,CAAC;AACxE,eAAO,MAAM,WAAW,cAA8B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { SocialfirePost, SocialfireFeed } from '../core/types';
2
+ export declare function createPostCard(post: SocialfirePost, feed: SocialfireFeed): string;
3
+ export declare function createLoadingTemplate(): string;
4
+ export declare function createErrorTemplate(error: Error): string;
5
+ export declare function createEmptyTemplate(): string;
6
+ export declare function injectShadowStyles(shadowRoot: ShadowRoot): void;
7
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/vanilla/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/D,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,CA8DjF;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAS9C;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAOxD;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAM5C;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAO/D"}
@@ -0,0 +1,2 @@
1
+ export * from './vanilla/index'
2
+ export {}
package/dist/widget.js ADDED
@@ -0,0 +1,2 @@
1
+ import{e as n,a as t,g as e,f as s,F as i}from"./utils-BNIlvbZe.js";function o(n){if(n.querySelector("style"))return;const e=document.createElement("style");e.textContent=t,n.appendChild(e)}function r(t){const i=t.posts.map(i=>function(t,i){const o=e(t),r=t.caption?n(t.caption):"";return`\n <a\n href="${t.permalink}"\n target="_blank"\n rel="noopener noreferrer"\n class="post-link"\n >\n <img\n src="${o}"\n alt="${r||"Instagram post"}"\n class="post-image"\n loading="lazy"\n />\n\n ${"VIDEO"===t.mediaType?'\n <div class="media-icon">\n <svg fill="currentColor" viewBox="0 0 24 24">\n <path d="M8 5v14l11-7z" />\n </svg>\n </div>\n ':""}\n\n ${"CAROUSEL_ALBUM"===t.mediaType?'\n <div class="media-icon">\n <svg fill="currentColor" viewBox="0 0 24 24">\n <path d="M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z" />\n </svg>\n </div>\n ':""}\n\n ${i.showLikes||i.showComments?`\n <div class="hover-overlay">\n ${i.showLikes?`\n <div class="stat-container">\n <svg fill="currentColor" viewBox="0 0 24 24">\n <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />\n </svg>\n <span class="stat-text">${s(t.likeCount||0)}</span>\n </div>\n `:""}\n ${i.showComments?`\n <div class="stat-container">\n <svg fill="currentColor" viewBox="0 0 24 24">\n <path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z" />\n </svg>\n <span class="stat-text">${s(t.commentsCount||0)}</span>\n </div>\n `:""}\n </div>\n `:""}\n\n ${i.showCaptions&&t.caption?`\n <div class="caption-overlay">\n <p class="caption-text">${r}</p>\n </div>\n `:""}\n </a>\n `}(i,t)).join("");return`\n <div class="socialfire-widget">\n <div\n class="socialfire-grid"\n style="grid-template-columns: repeat(${t.columns}, minmax(0, 1fr)); gap: ${t.gap}px;"\n >\n ${i}\n </div>\n </div>\n `}const a=t=>function(t){return`\n <div class="error-container">\n <p class="error-title">Failed to load Instagram feed</p>\n <p class="error-message">${n(t.message)}</p>\n </div>\n `}(t);class l extends HTMLElement{constructor(){super(),this.abortController=null,this.shadow=this.attachShadow({mode:"open"}),this.fetcher=new i}static get observedAttributes(){return["feed-id","api-url"]}connectedCallback(){this.render()}disconnectedCallback(){this.abortController?.abort()}attributeChangedCallback(){this.render()}async render(){const n=this.getAttribute("feed-id"),t=this.getAttribute("api-url")||void 0;if(!n)return this.shadow.innerHTML=a(new Error("feed-id attribute is required")),void o(this.shadow);this.shadow.innerHTML='\n <div class="loading-container">\n <div class="loading-inner">\n <div class="spinner"></div>\n <p class="loading-text">Loading feed...</p>\n </div>\n </div>\n ',o(this.shadow),this.abortController?.abort(),this.abortController=new AbortController,t&&(this.fetcher=new i(t));try{const t=await this.fetcher.fetchFeed(n,this.abortController.signal);this.shadow.innerHTML=t.posts?.length>0?r(t):'\n <div class="empty-container">\n <p>No posts available</p>\n </div>\n ',o(this.shadow),this.dispatchEvent(new CustomEvent("load",{detail:t,bubbles:!0,composed:!0}))}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;const n=e instanceof Error?e:new Error("Unknown error");this.shadow.innerHTML=a(n),o(this.shadow),this.dispatchEvent(new CustomEvent("error",{detail:n,bubbles:!0,composed:!0}))}}}"undefined"==typeof window||customElements.get("socialfire-widget")||customElements.define("socialfire-widget",l);export{l as SocialfireWidgetElement};
2
+ //# sourceMappingURL=widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget.js","sources":["../src/vanilla/templates.ts","../src/vanilla/renderer.ts","../src/vanilla/SocialfireWidget.ts","../src/vanilla/index.ts"],"sourcesContent":["import { SocialfirePost, SocialfireFeed } from '../core/types';\r\nimport { formatNumber, getMediaUrl, escapeHtml } from '../core/utils';\r\nimport { shadowStyles } from '../core/styles';\r\n\r\nexport function createPostCard(post: SocialfirePost, feed: SocialfireFeed): string {\r\n const mediaUrl = getMediaUrl(post);\r\n const caption = post.caption ? escapeHtml(post.caption) : '';\r\n\r\n return `\r\n <a\r\n href=\"${post.permalink}\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n class=\"post-link\"\r\n >\r\n <img\r\n src=\"${mediaUrl}\"\r\n alt=\"${caption || 'Instagram post'}\"\r\n class=\"post-image\"\r\n loading=\"lazy\"\r\n />\r\n\r\n ${post.mediaType === 'VIDEO' ? `\r\n <div class=\"media-icon\">\r\n <svg fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M8 5v14l11-7z\" />\r\n </svg>\r\n </div>\r\n ` : ''}\r\n\r\n ${post.mediaType === 'CAROUSEL_ALBUM' ? `\r\n <div class=\"media-icon\">\r\n <svg fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z\" />\r\n </svg>\r\n </div>\r\n ` : ''}\r\n\r\n ${(feed.showLikes || feed.showComments) ? `\r\n <div class=\"hover-overlay\">\r\n ${feed.showLikes ? `\r\n <div class=\"stat-container\">\r\n <svg fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z\" />\r\n </svg>\r\n <span class=\"stat-text\">${formatNumber(post.likeCount || 0)}</span>\r\n </div>\r\n ` : ''}\r\n ${feed.showComments ? `\r\n <div class=\"stat-container\">\r\n <svg fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z\" />\r\n </svg>\r\n <span class=\"stat-text\">${formatNumber(post.commentsCount || 0)}</span>\r\n </div>\r\n ` : ''}\r\n </div>\r\n ` : ''}\r\n\r\n ${feed.showCaptions && post.caption ? `\r\n <div class=\"caption-overlay\">\r\n <p class=\"caption-text\">${caption}</p>\r\n </div>\r\n ` : ''}\r\n </a>\r\n `;\r\n}\r\n\r\nexport function createLoadingTemplate(): string {\r\n return `\r\n <div class=\"loading-container\">\r\n <div class=\"loading-inner\">\r\n <div class=\"spinner\"></div>\r\n <p class=\"loading-text\">Loading feed...</p>\r\n </div>\r\n </div>\r\n `;\r\n}\r\n\r\nexport function createErrorTemplate(error: Error): string {\r\n return `\r\n <div class=\"error-container\">\r\n <p class=\"error-title\">Failed to load Instagram feed</p>\r\n <p class=\"error-message\">${escapeHtml(error.message)}</p>\r\n </div>\r\n `;\r\n}\r\n\r\nexport function createEmptyTemplate(): string {\r\n return `\r\n <div class=\"empty-container\">\r\n <p>No posts available</p>\r\n </div>\r\n `;\r\n}\r\n\r\nexport function injectShadowStyles(shadowRoot: ShadowRoot): void {\r\n const existingStyle = shadowRoot.querySelector('style');\r\n if (existingStyle) return;\r\n\r\n const style = document.createElement('style');\r\n style.textContent = shadowStyles;\r\n shadowRoot.appendChild(style);\r\n}\r\n","import { SocialfireFeed } from '../core/types';\r\nimport {\r\n createPostCard,\r\n createLoadingTemplate,\r\n createErrorTemplate,\r\n createEmptyTemplate,\r\n} from './templates';\r\n\r\nexport function renderWidget(feed: SocialfireFeed): string {\r\n const posts = feed.posts.map((post) => createPostCard(post, feed)).join('');\r\n\r\n return `\r\n <div class=\"socialfire-widget\">\r\n <div\r\n class=\"socialfire-grid\"\r\n style=\"grid-template-columns: repeat(${feed.columns}, minmax(0, 1fr)); gap: ${feed.gap}px;\"\r\n >\r\n ${posts}\r\n </div>\r\n </div>\r\n `;\r\n}\r\n\r\nexport const renderLoading = () => createLoadingTemplate();\r\nexport const renderError = (error: Error) => createErrorTemplate(error);\r\nexport const renderEmpty = () => createEmptyTemplate();\r\n","import { SocialfireFeed } from '../core/types';\r\nimport { FeedFetcher } from '../core/fetcher';\r\nimport { renderWidget, renderLoading, renderError, renderEmpty } from './renderer';\r\nimport { injectShadowStyles } from './templates';\r\n\r\nexport class SocialfireWidgetElement extends HTMLElement {\r\n private shadow: ShadowRoot;\r\n private fetcher: FeedFetcher;\r\n private abortController: AbortController | null = null;\r\n\r\n constructor() {\r\n super();\r\n this.shadow = this.attachShadow({ mode: 'open' });\r\n this.fetcher = new FeedFetcher();\r\n }\r\n\r\n static get observedAttributes() {\r\n return ['feed-id', 'api-url'];\r\n }\r\n\r\n connectedCallback() {\r\n this.render();\r\n }\r\n\r\n disconnectedCallback() {\r\n this.abortController?.abort();\r\n }\r\n\r\n attributeChangedCallback() {\r\n this.render();\r\n }\r\n\r\n private async render() {\r\n const feedId = this.getAttribute('feed-id');\r\n const apiUrl = this.getAttribute('api-url') || undefined;\r\n\r\n if (!feedId) {\r\n this.shadow.innerHTML = renderError(new Error('feed-id attribute is required'));\r\n injectShadowStyles(this.shadow);\r\n return;\r\n }\r\n\r\n this.shadow.innerHTML = renderLoading();\r\n injectShadowStyles(this.shadow);\r\n\r\n this.abortController?.abort();\r\n this.abortController = new AbortController();\r\n\r\n // Update fetcher if apiUrl changed\r\n if (apiUrl) {\r\n this.fetcher = new FeedFetcher(apiUrl);\r\n }\r\n\r\n try {\r\n const feed: SocialfireFeed = await this.fetcher.fetchFeed(\r\n feedId,\r\n this.abortController.signal\r\n );\r\n\r\n this.shadow.innerHTML =\r\n feed.posts?.length > 0 ? renderWidget(feed) : renderEmpty();\r\n injectShadowStyles(this.shadow);\r\n\r\n // Dispatch load event\r\n this.dispatchEvent(\r\n new CustomEvent('load', {\r\n detail: feed,\r\n bubbles: true,\r\n composed: true,\r\n })\r\n );\r\n } catch (error) {\r\n if (error instanceof Error && error.name === 'AbortError') return;\r\n\r\n const err = error instanceof Error ? error : new Error('Unknown error');\r\n this.shadow.innerHTML = renderError(err);\r\n injectShadowStyles(this.shadow);\r\n\r\n // Dispatch error event\r\n this.dispatchEvent(\r\n new CustomEvent('error', {\r\n detail: err,\r\n bubbles: true,\r\n composed: true,\r\n })\r\n );\r\n }\r\n }\r\n}\r\n","import { SocialfireWidgetElement } from './SocialfireWidget';\r\n\r\n// Auto-register the custom element if not already registered\r\nif (typeof window !== 'undefined' && !customElements.get('socialfire-widget')) {\r\n customElements.define('socialfire-widget', SocialfireWidgetElement);\r\n}\r\n\r\nexport { SocialfireWidgetElement };\r\nexport * from '../core/types';\r\n"],"names":["injectShadowStyles","shadowRoot","querySelector","style","document","createElement","textContent","shadowStyles","appendChild","renderWidget","feed","posts","map","post","mediaUrl","getMediaUrl","caption","escapeHtml","permalink","mediaType","showLikes","showComments","formatNumber","likeCount","commentsCount","showCaptions","createPostCard","join","columns","gap","renderError","error","message","createErrorTemplate","SocialfireWidgetElement","HTMLElement","constructor","super","this","abortController","shadow","attachShadow","mode","fetcher","FeedFetcher","observedAttributes","connectedCallback","render","disconnectedCallback","abort","attributeChangedCallback","feedId","getAttribute","apiUrl","innerHTML","Error","AbortController","fetchFeed","signal","length","dispatchEvent","CustomEvent","detail","bubbles","composed","name","err","window","customElements","get","define"],"mappings":"oEAgGO,SAASA,EAAmBC,GAEjC,GADsBA,EAAWC,cAAc,SAC5B,OAEnB,MAAMC,EAAQC,SAASC,cAAc,SACrCF,EAAMG,YAAcC,EACpBN,EAAWO,YAAYL,EACzB,CC/FO,SAASM,EAAaC,GAC3B,MAAMC,EAAQD,EAAKC,MAAMC,IAAKC,GDLzB,SAAwBA,EAAsBH,GACnD,MAAMI,EAAWC,EAAYF,GACvBG,EAAUH,EAAKG,QAAUC,EAAWJ,EAAKG,SAAW,GAE1D,MAAO,yBAEKH,EAAKK,gIAMJJ,oBACAE,GAAW,4FAKC,UAAnBH,EAAKM,UAAwB,gLAM3B,eAEiB,mBAAnBN,EAAKM,UAAiC,mTAMpC,eAEDT,EAAKU,WAAaV,EAAKW,aAAgB,oDAEpCX,EAAKU,UAAY,qXAKWE,EAAaT,EAAKU,WAAa,4CAEzD,iBACFb,EAAKW,aAAe,yQAKQC,EAAaT,EAAKW,eAAiB,4CAE7D,6BAEJ,eAEFd,EAAKe,cAAgBZ,EAAKG,QAAU,8EAERA,gCAE1B,kBAGV,CCzDyCU,CAAeb,EAAMH,IAAOiB,KAAK,IAExE,MAAO,oIAIsCjB,EAAKkB,kCAAkClB,EAAKmB,6BAEjFlB,iCAIV,CAEO,MACMmB,EAAeC,GDuDrB,SAA6BA,GAClC,MAAO,uIAGwBd,EAAWc,EAAMC,8BAGlD,CC9D6CC,CAAoBF,GCnB1D,MAAMG,UAAgCC,YAK3C,WA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ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@volchoklv/socialfire-widget",
3
+ "version": "1.0.0",
4
+ "description": "Embeddable Instagram feed widget - React & vanilla JS",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ },
13
+ "./widget": {
14
+ "import": "./dist/widget.js",
15
+ "types": "./dist/widget.d.ts"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "dev": "vite",
23
+ "build": "tsc && vite build",
24
+ "typecheck": "tsc --noEmit",
25
+ "prepublishOnly": "npm run build"
26
+ },
27
+ "peerDependencies": {
28
+ "react": "^18.0.0 || ^19.0.0",
29
+ "react-dom": "^18.0.0 || ^19.0.0"
30
+ },
31
+ "peerDependenciesMeta": {
32
+ "react": {
33
+ "optional": true
34
+ },
35
+ "react-dom": {
36
+ "optional": true
37
+ }
38
+ },
39
+ "keywords": [
40
+ "instagram",
41
+ "feed",
42
+ "widget",
43
+ "react",
44
+ "web-component",
45
+ "socialfire"
46
+ ],
47
+ "author": "Socialfire",
48
+ "license": "MIT",
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "https://github.com/socialfire/widget"
52
+ },
53
+ "devDependencies": {
54
+ "@types/react": "^19.2.8",
55
+ "@types/react-dom": "^19.2.3",
56
+ "@vitejs/plugin-react": "^5.1.2",
57
+ "eslint": "^9.39.2",
58
+ "terser": "^5.44.1",
59
+ "typescript": "^5.9.3",
60
+ "vite": "^7.3.1",
61
+ "vite-plugin-dts": "^4.5.4",
62
+ "vitest": "^4.0.17"
63
+ }
64
+ }