@census-ai/census-sdk 0.4.3 → 0.4.4
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.
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +17 -0
- package/dist/react/index.d.ts +17 -0
- package/dist/react/index.js +3 -3
- package/dist/react/index.js.map +1 -1
- package/package.json +5 -2
package/dist/index.d.cts
CHANGED
|
@@ -203,6 +203,21 @@ interface TrackEventOptions {
|
|
|
203
203
|
interface BatchEventsOptions {
|
|
204
204
|
events: TrackEventOptions[];
|
|
205
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Feature group tag on a request
|
|
208
|
+
*/
|
|
209
|
+
interface RequestFeatureGroup {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
color: string | null;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Feature tag on a request
|
|
216
|
+
*/
|
|
217
|
+
interface RequestFeature {
|
|
218
|
+
id: string;
|
|
219
|
+
name: string;
|
|
220
|
+
}
|
|
206
221
|
/**
|
|
207
222
|
* A user's submitted request (feedback, bug report, feature request)
|
|
208
223
|
*/
|
|
@@ -216,6 +231,8 @@ interface Request {
|
|
|
216
231
|
rating: number | null;
|
|
217
232
|
helpful: boolean | null;
|
|
218
233
|
metadata: Record<string, unknown>;
|
|
234
|
+
feature_group: RequestFeatureGroup | null;
|
|
235
|
+
feature: RequestFeature | null;
|
|
219
236
|
}
|
|
220
237
|
/**
|
|
221
238
|
* Options for fetching requests
|
package/dist/index.d.ts
CHANGED
|
@@ -203,6 +203,21 @@ interface TrackEventOptions {
|
|
|
203
203
|
interface BatchEventsOptions {
|
|
204
204
|
events: TrackEventOptions[];
|
|
205
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Feature group tag on a request
|
|
208
|
+
*/
|
|
209
|
+
interface RequestFeatureGroup {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
color: string | null;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Feature tag on a request
|
|
216
|
+
*/
|
|
217
|
+
interface RequestFeature {
|
|
218
|
+
id: string;
|
|
219
|
+
name: string;
|
|
220
|
+
}
|
|
206
221
|
/**
|
|
207
222
|
* A user's submitted request (feedback, bug report, feature request)
|
|
208
223
|
*/
|
|
@@ -216,6 +231,8 @@ interface Request {
|
|
|
216
231
|
rating: number | null;
|
|
217
232
|
helpful: boolean | null;
|
|
218
233
|
metadata: Record<string, unknown>;
|
|
234
|
+
feature_group: RequestFeatureGroup | null;
|
|
235
|
+
feature: RequestFeature | null;
|
|
219
236
|
}
|
|
220
237
|
/**
|
|
221
238
|
* Options for fetching requests
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var kt="https://api.census.ai",ze=class{constructor(e){this.currentUserId=null;if(!e.apiKey)throw new Error("Census: apiKey is required");["cs_live_","cs_test_","op_live_","op_test_"].some(r=>e.apiKey.startsWith(r))||console.warn('Census: API key should start with "cs_live_" or "cs_test_"'),this.apiKey=e.apiKey,this.baseUrl=e.baseUrl||kt,this.debug=e.debug||false,this.log("Initialized with base URL:",this.baseUrl);}async identify(e){if(!e.userId)throw new Error("Census: userId is required for identify()");this.currentUserId=e.userId,await this.request("/api/sdk/identify","POST",{userId:e.userId,email:e.email,name:e.name,avatarUrl:e.avatarUrl,metadata:e.metadata,organizationId:e.organizationId,organizationName:e.organizationName,organizationDomain:e.organizationDomain,organizationPlan:e.organizationPlan}),this.log("User identified:",e.userId);}reset(){this.currentUserId=null,this.log("User identity reset");}async submitFeedback(e){let t=["feedback","bug_report","feature_request","article_rating"];if(!e.type||!t.includes(e.type))throw new Error(`Census: type must be one of: ${t.join(", ")}`);if(e.type==="article_rating"){if(e.rating===void 0&&e.helpful===void 0)throw new Error("Census: article_rating requires rating or helpful field")}else if(!e.message)throw new Error("Census: message is required for this feedback type");let r=await this.request("/api/sdk/feedback","POST",{type:e.type,message:e.message,rating:e.rating,helpful:e.helpful,userId:this.currentUserId,articleId:e.articleId,pageUrl:typeof window<"u"?window.location.href:void 0,metadata:e.metadata});return this.log("Feedback submitted:",r.feedbackId),{feedbackId:r.feedbackId}}async getArticles(e){let t=new URLSearchParams;e?.category&&t.set("category",e.category),e?.search&&t.set("search",e.search),e?.limit&&t.set("limit",String(e.limit)),e?.offset&&t.set("offset",String(e.offset));let r=t.toString(),i=`/api/sdk/articles${r?`?${r}`:""}`,n=await this.request(i,"GET");return this.log("Fetched articles:",n.articles.length),n}async getArticle(e){try{let t=await this.request(`/api/sdk/articles/${encodeURIComponent(e)}`,"GET");return this.log("Fetched article:",e),t.article}catch(t){if(t.status===404)return null;throw t}}async getFeatureGroups(){let e=await this.request("/api/sdk/feature-groups","GET");return this.log("Fetched feature groups:",e.feature_groups.length),e}async getRequests(e){if(!this.currentUserId)throw new Error("Census: User must be identified before fetching requests. Call identify() first.");let t=new URLSearchParams;t.set("userId",this.currentUserId),e?.status&&t.set("status",e.status),e?.type&&t.set("type",e.type),e?.limit&&t.set("limit",String(e.limit)),e?.offset&&t.set("offset",String(e.offset));let r=await this.request(`/api/sdk/requests?${t.toString()}`,"GET");return this.log("Fetched requests:",r.requests.length),r}async track(e,t){if(!e)throw new Error("Census: eventType is required for track()");await this.request("/api/sdk/events","POST",{eventType:e,userId:this.currentUserId,properties:t}),this.log("Event tracked:",e);}async trackBatch(e){if(!e.events||e.events.length===0)throw new Error("Census: at least one event is required");if(e.events.length>100)throw new Error("Census: maximum 100 events per batch");let t=e.events.map(r=>({eventType:r.eventType,userId:this.currentUserId,articleId:r.articleId,featureId:r.featureId,properties:r.properties}));await this.request("/api/sdk/events","POST",{events:t}),this.log("Batch events tracked:",e.events.length);}async getGuides(e){let t=new URLSearchParams;e?.projectId&&t.set("project_id",e.projectId),e?.url&&t.set("url",e.url),e?.userId&&t.set("user_id",e.userId);let r=t.toString(),i=`/api/sdk/guides${r?`?${r}`:""}`,n=await this.request(i,"GET");return this.log("Fetched guides:",n.guides.length),n}async getGuide(e){try{let t=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}`,"GET");return this.log("Fetched guide:",e),t.guide}catch(t){if(t.status===404)return null;throw t}}async createGuide(e){if(!e.name||!e.slug)throw new Error("Census: name and slug are required for createGuide()");let t=await this.request("/api/sdk/guides","POST",{name:e.name,slug:e.slug,description:e.description,project_id:e.projectId,trigger_type:e.triggerType||"manual",trigger_config:e.triggerConfig||{},theme:e.theme||{},allow_skip:e.allowSkip??true,show_progress:e.showProgress??true});return this.log("Guide created:",t.guide.id),t.guide}async updateGuide(e,t){if(!e)throw new Error("Census: guideId is required for updateGuide()");let r={};t.name!==void 0&&(r.name=t.name),t.slug!==void 0&&(r.slug=t.slug),t.description!==void 0&&(r.description=t.description),t.triggerType!==void 0&&(r.trigger_type=t.triggerType),t.triggerConfig!==void 0&&(r.trigger_config=t.triggerConfig),t.theme!==void 0&&(r.theme=t.theme),t.allowSkip!==void 0&&(r.allow_skip=t.allowSkip),t.showProgress!==void 0&&(r.show_progress=t.showProgress),t.status!==void 0&&(r.status=t.status);let i=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}`,"PUT",r);return this.log("Guide updated:",e),i.guide}async deleteGuide(e){if(!e)throw new Error("Census: guideId is required for deleteGuide()");await this.request(`/api/sdk/guides/${encodeURIComponent(e)}`,"DELETE"),this.log("Guide deleted:",e);}async getGuideSteps(e){let t=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}/steps`,"GET");return this.log("Fetched steps for guide:",e),t.steps}async addGuideStep(e,t){if(!e)throw new Error("Census: guideId is required for addGuideStep()");let r=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}/steps`,"POST",{step_type:t.stepType||"tooltip",sort_order:t.sortOrder,selector_strategy:t.selectorStrategy||{},title:t.title,content:t.content,tooltip_position:t.tooltipPosition||"auto",rich_content:t.richContent||{},display_config:t.displayConfig||{},advance_config:t.advanceConfig||{trigger:"button"},style_config:t.styleConfig||{}});return this.log("Step added to guide:",e),r.step}async updateGuideStep(e,t,r){if(!e||!t)throw new Error("Census: guideId and stepId are required for updateGuideStep()");let i={};r.stepType!==void 0&&(i.step_type=r.stepType),r.sortOrder!==void 0&&(i.sort_order=r.sortOrder),r.selectorStrategy!==void 0&&(i.selector_strategy=r.selectorStrategy),r.title!==void 0&&(i.title=r.title),r.content!==void 0&&(i.content=r.content),r.tooltipPosition!==void 0&&(i.tooltip_position=r.tooltipPosition),r.richContent!==void 0&&(i.rich_content=r.richContent),r.displayConfig!==void 0&&(i.display_config=r.displayConfig),r.advanceConfig!==void 0&&(i.advance_config=r.advanceConfig),r.styleConfig!==void 0&&(i.style_config=r.styleConfig);let n=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}`,"PUT",i);return this.log("Step updated:",t),n.step}async deleteGuideStep(e,t){if(!e||!t)throw new Error("Census: guideId and stepId are required for deleteGuideStep()");await this.request(`/api/sdk/guides/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}`,"DELETE"),this.log("Step deleted:",t);}async reorderGuideSteps(e,t){if(!e)throw new Error("Census: guideId is required for reorderGuideSteps()");let r=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}/steps`,"PUT",{steps:t});return this.log("Steps reordered for guide:",e),r.steps}async trackGuideEvent(e){if(!e.guideId||!e.eventType||!e.sessionId)throw new Error("Census: guideId, eventType, and sessionId are required for trackGuideEvent()");await this.request("/api/sdk/guides/events","POST",{guideId:e.guideId,eventType:e.eventType,stepId:e.stepId,stepIndex:e.stepIndex,pageUrl:e.pageUrl||(typeof window<"u"?window.location.href:void 0),sessionId:e.sessionId,userId:e.userId||this.currentUserId,metadata:e.metadata}),this.log("Guide event tracked:",e.eventType,e.guideId);}async markGuideCompleted(e){if(!e)throw new Error("Census: guideId is required for markGuideCompleted()");if(!this.currentUserId)throw new Error("Census: User must be identified before marking guides complete. Call identify() first.");await this.request("/api/sdk/guides/complete","POST",{guideId:e,userId:this.currentUserId}),this.log("Guide marked completed:",e);}getCurrentUserId(){return this.currentUserId}isIdentified(){return this.currentUserId!==null}async request(e,t,r){let i=`${this.baseUrl}${e}`,n={"X-Census-Key":this.apiKey};r&&(n["Content-Type"]="application/json"),this.log(`${t} ${e}`,r);let p=await fetch(i,{method:t,headers:n,body:r?JSON.stringify(r):void 0});if(!p.ok){let d=`Request failed with status ${p.status}`;try{d=(await p.json()).error||d;}catch{}throw {error:d,status:p.status}}return p.json()}log(...e){this.debug&&console.log("[Census]",...e);}};function Ye(o){return new ze(o)}var Ae=react.createContext(null);function Pt({apiKey:o,baseUrl:e,debug:t,user:r,theme:i={},children:n}){let[p,d]=react.useState(false),[s,a]=react.useState(false),l=react.useMemo(()=>Ye({apiKey:o,baseUrl:e,debug:t}),[o,e,t]);react.useEffect(()=>{r?l.identify(r).then(()=>{a(true),d(true);}).catch(f=>{console.error("[Census] Failed to identify user:",f),d(true);}):d(true);},[l,r]);let c=react.useMemo(()=>({client:l,theme:i,isReady:p,isIdentified:s}),[l,i,p,s]);return jsxRuntime.jsx(Ae.Provider,{value:c,children:n})}function Et(){let o=react.useContext(Ae);if(!o)throw new Error("useCensus must be used within a CensusProvider");return o.client}function O(){let o=react.useContext(Ae);if(!o)throw new Error("useCensusContext must be used within a CensusProvider");return o}function Tt(){let{client:o}=O(),[e,t]=react.useState(false),[r,i]=react.useState(null);return {identify:async d=>{t(true),i(null);try{await o.identify(d);}catch(s){throw i(s instanceof Error?s:new Error("Failed to identify user")),s}finally{t(false);}},reset:()=>{o.reset();},isIdentifying:e,isIdentified:o.isIdentified(),error:r}}function Le(){let{client:o}=O(),[e,t]=react.useState(false),[r,i]=react.useState(false),[n,p]=react.useState(null),[d,s]=react.useState(null),a=react.useCallback(async c=>{t(true),i(false),p(null),s(null);try{let f=await o.submitFeedback(c);return s(f.feedbackId),i(!0),f}catch(f){let g=f instanceof Error?f:new Error("Failed to submit feedback");throw p(g),g}finally{t(false);}},[o]),l=react.useCallback(()=>{i(false),p(null),s(null);},[]);return {submitFeedback:a,reset:l,isSubmitting:e,isSuccess:r,error:n,feedbackId:d}}function ue(o){let{client:e,isReady:t}=O(),[r,i]=react.useState(null),[n,p]=react.useState(true),[d,s]=react.useState(null),a=react.useCallback(async()=>{p(true),s(null);try{let l=await e.getArticles(o);i(l);}catch(l){s(l instanceof Error?l:new Error("Failed to fetch articles"));}finally{p(false);}},[e,o?.category,o?.search,o?.limit,o?.offset]);return react.useEffect(()=>{t&&a();},[t,a]),{articles:r?.articles||[],pagination:r?.pagination,isLoading:n,error:d,refetch:a}}function fe(o){let{client:e,isReady:t}=O(),[r,i]=react.useState(null),[n,p]=react.useState(true),[d,s]=react.useState(null),a=react.useCallback(async()=>{if(!o){i(null),p(false);return}p(true),s(null);try{let l=await e.getArticle(o);i(l);}catch(l){s(l instanceof Error?l:new Error("Failed to fetch article"));}finally{p(false);}},[e,o]);return react.useEffect(()=>{t&&a();},[t,a]),{article:r,isLoading:n,error:d,refetch:a}}function qe(){let{client:o,isReady:e}=O(),[t,r]=react.useState([]),[i,n]=react.useState(true),[p,d]=react.useState(null),s=react.useCallback(async()=>{n(true),d(null);try{let a=await o.getFeatureGroups();r(a.feature_groups);}catch(a){d(a instanceof Error?a:new Error("Failed to fetch feature groups"));}finally{n(false);}},[o]);return react.useEffect(()=>{e&&s();},[e,s]),{featureGroups:t,isLoading:i,error:p,refetch:s}}function ne(o){let{client:e,isReady:t,isIdentified:r}=O(),[i,n]=react.useState(null),[p,d]=react.useState(true),[s,a]=react.useState(null),l=react.useCallback(async()=>{if(!r){n(null),d(false);return}d(true),a(null);try{let c=await e.getRequests(o);n(c);}catch(c){a(c instanceof Error?c:new Error("Failed to fetch requests"));}finally{d(false);}},[e,r,o?.status,o?.type,o?.limit,o?.offset]);return react.useEffect(()=>{t&&r&&l();},[t,r,l]),{requests:i?.requests||[],pagination:i?.pagination,isLoading:p,error:s,refetch:l}}function Bt(){let{client:o}=O(),e=react.useCallback(async(r,i)=>{await o.track(r,i);},[o]),t=react.useCallback(async r=>{await o.trackBatch({events:r});},[o]);return {track:e,trackBatch:t}}function Ft(o){let{client:e,isReady:t}=O(),[r,i]=react.useState(null),[n,p]=react.useState(true),[d,s]=react.useState(null),a=react.useCallback(async()=>{p(true),s(null);try{let l=await e.getGuides(o);i(l);}catch(l){s(l instanceof Error?l:new Error("Failed to fetch guides"));}finally{p(false);}},[e,o?.projectId,o?.url,o?.userId]);return react.useEffect(()=>{t&&a();},[t,a]),{guides:r?.guides||[],completedGuides:r?.completedGuides||[],isLoading:n,error:d,refetch:a}}function Oe(){let{client:o,isReady:e}=O(),[t,r]=react.useState(null),[i,n]=react.useState([]),[p,d]=react.useState(false),[s,a]=react.useState(false),[l,c]=react.useState(null),[f,g]=react.useState(null),u=react.useRef(false),R=react.useCallback(async G=>{d(true),c(null);try{let y=await o.getGuide(G);return y&&(r(y),n(y.guide_steps||[]),g(y.guide_steps?.[0]?.id||null)),y}catch(y){return c(y instanceof Error?y:new Error("Failed to load guide")),null}finally{d(false);}},[o]),S=react.useCallback(async G=>{a(true),c(null);try{let y=await o.createGuide(G);return r(y),n([]),g(null),y}catch(y){throw c(y instanceof Error?y:new Error("Failed to create guide")),y}finally{a(false);}},[o]),x=react.useCallback(async G=>{if(!t)throw new Error("No guide loaded");a(true),c(null);try{let y=await o.updateGuide(t.id,G);return r(y),u.current=!1,y}catch(y){throw c(y instanceof Error?y:new Error("Failed to update guide")),y}finally{a(false);}},[o,t]),w=react.useCallback(async()=>x({status:"published"}),[x]),b=react.useCallback(async()=>x({status:"draft"}),[x]),v=react.useCallback(async()=>{if(!t)throw new Error("No guide loaded");a(true),c(null);try{await o.deleteGuide(t.id),r(null),n([]),g(null);}catch(G){throw c(G instanceof Error?G:new Error("Failed to delete guide")),G}finally{a(false);}},[o,t]),E=react.useCallback(async G=>{if(!t)throw new Error("No guide loaded");a(true),c(null);try{let y=await o.addGuideStep(t.id,G);return n(N=>[...N,y]),g(y.id),u.current=!0,y}catch(y){throw c(y instanceof Error?y:new Error("Failed to add step")),y}finally{a(false);}},[o,t]),k=react.useCallback(async(G,y)=>{if(!t)throw new Error("No guide loaded");a(true),c(null);try{let N=await o.updateGuideStep(t.id,G,y);return n(P=>P.map(D=>D.id===G?N:D)),u.current=!0,N}catch(N){throw c(N instanceof Error?N:new Error("Failed to update step")),N}finally{a(false);}},[o,t]),T=react.useCallback(async G=>{if(!t)throw new Error("No guide loaded");a(true),c(null);try{await o.deleteGuideStep(t.id,G),n(y=>y.filter(N=>N.id!==G)),f===G&&g(i[0]?.id||null),u.current=!0;}catch(y){throw c(y instanceof Error?y:new Error("Failed to delete step")),y}finally{a(false);}},[o,t,f,i]),m=react.useCallback(async G=>{if(!t)throw new Error("No guide loaded");a(true),c(null);try{let y=await o.reorderGuideSteps(t.id,G);return n(y),u.current=!0,y}catch(y){throw c(y instanceof Error?y:new Error("Failed to reorder steps")),y}finally{a(false);}},[o,t]),L=react.useCallback(async G=>{let y=i.findIndex(P=>P.id===G);if(y<=0)return;let N=i.map((P,D)=>D===y?{id:P.id,sort_order:y-1}:D===y-1?{id:P.id,sort_order:y}:{id:P.id,sort_order:D});return m(N)},[i,m]),U=react.useCallback(async G=>{let y=i.findIndex(P=>P.id===G);if(y<0||y>=i.length-1)return;let N=i.map((P,D)=>D===y?{id:P.id,sort_order:y+1}:D===y+1?{id:P.id,sort_order:y}:{id:P.id,sort_order:D});return m(N)},[i,m]),j=f&&i.find(G=>G.id===f)||null,_=react.useCallback(()=>{r(null),n([]),g(null),c(null),u.current=false;},[]);return {guide:t,steps:i,selectedStep:j,selectedStepId:f,isLoading:p,isSaving:s,error:l,isReady:e,hasUnsavedChanges:u.current,loadGuide:R,createGuide:S,updateGuide:x,publishGuide:w,unpublishGuide:b,deleteGuide:v,addStep:E,updateStep:k,deleteStep:T,reorderSteps:m,moveStepUp:L,moveStepDown:U,setSelectedStepId:g,reset:_}}function zt(){let{client:o,isReady:e}=O(),[t,r]=react.useState(null),[i,n]=react.useState(0),[p,d]=react.useState(false),[s,a]=react.useState([]),[l,c]=react.useState([]),f=react.useCallback((_,G=0)=>{r(_),n(G),d(true);},[]),g=react.useCallback(()=>{if(!t)return;let _=t.guide_steps||[];i<_.length-1?n(G=>G+1):(a(G=>[...G,t.id]),d(false),r(null));},[t,i]),u=react.useCallback(()=>{i>0&&n(_=>_-1);},[i]),R=react.useCallback(_=>{if(!t)return;let G=t.guide_steps||[];_>=0&&_<G.length&&n(_);},[t]),S=react.useCallback(()=>{t&&c(_=>[..._,t.id]),d(false),r(null),n(0);},[t]),x=react.useCallback(()=>{d(false);},[]),w=react.useCallback(()=>{t&&d(true);},[t]),b=react.useCallback(async(_,G)=>{let y=_.guide_steps?.[G];if(y)try{await o.track("guide_step_viewed",{guide_id:_.id,guide_name:_.name,step_id:y.id,step_index:G,step_type:y.step_type});}catch{}},[o]),v=react.useCallback(async _=>{try{await o.track("guide_completed",{guide_id:_.id,guide_name:_.name,total_steps:_.guide_steps?.length||0});}catch{}},[o]),E=react.useCallback(async(_,G)=>{try{await o.track("guide_dismissed",{guide_id:_.id,guide_name:_.name,dismissed_at_step:G,total_steps:_.guide_steps?.length||0});}catch{}},[o]),k=t?.guide_steps?.[i]||null,T=t?.guide_steps?.length||0,m=i===T-1,L=i===0,U=react.useCallback(_=>s.includes(_),[s]),j=react.useCallback(_=>l.includes(_),[l]);return {activeGuide:t,currentStep:k,currentStepIndex:i,totalSteps:T,isPlaying:p,isFirstStep:L,isLastStep:m,isReady:e,startGuide:f,nextStep:g,prevStep:u,goToStep:R,dismiss:S,pause:x,resume:w,trackStepView:b,trackGuideComplete:v,trackGuideDismiss:E,completedGuideIds:s,dismissedGuideIds:l,isGuideCompleted:U,isGuideDismissed:j}}var oe={button:{position:"fixed",padding:"12px 20px",border:"none",borderRadius:"8px",cursor:"pointer",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px",fontWeight:"500",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",transition:"transform 0.2s, box-shadow 0.2s",zIndex:9999},modal:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:1e4},modalContent:{backgroundColor:"white",borderRadius:"12px",padding:"24px",width:"100%",maxWidth:"400px",margin:"16px",boxShadow:"0 20px 50px rgba(0, 0, 0, 0.2)",fontFamily:"system-ui, -apple-system, sans-serif"},textarea:{width:"100%",padding:"10px 12px",border:"1px solid #e0e0e0",borderRadius:"6px",fontSize:"14px",marginBottom:"16px",minHeight:"100px",resize:"vertical",boxSizing:"border-box",fontFamily:"inherit"},submitButton:{width:"100%",padding:"12px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"14px",fontWeight:"500",transition:"opacity 0.2s"},typeButton:{padding:"8px 16px",border:"1px solid #e0e0e0",borderRadius:"6px",cursor:"pointer",fontSize:"13px",backgroundColor:"white",transition:"all 0.2s",marginRight:"8px",marginBottom:"8px"}},At={"bottom-right":{bottom:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"top-left":{top:"20px",left:"20px"}},Lt={feedback:"General Feedback",bug_report:"Bug Report",feature_request:"Feature Request",article_rating:"Article Rating"},qt={feedback:"\u{1F4AC}",bug_report:"\u{1F41B}",feature_request:"\u{1F4A1}",article_rating:"\u2B50"};function Ot(o){return {primaryColor:o.primaryColor||"#000000",textColor:o.textColor||"#333333",backgroundColor:o.backgroundColor||"#ffffff",borderRadius:o.borderRadius||"8px",fontFamily:o.fontFamily||"system-ui, -apple-system, sans-serif"}}function Dt({position:o="bottom-right",text:e="Feedback",allowedTypes:t=["feedback","bug_report","feature_request"],theme:r,onSubmit:i,onError:n,children:p}){let{theme:d}=O(),{submitFeedback:s,isSubmitting:a,isSuccess:l,reset:c}=Le(),[f,g]=react.useState(false),[u,R]=react.useState(t[0]),[S,x]=react.useState(""),w={...d,...r},b=Ot(w),v=react.useCallback(()=>{g(true),c();},[c]),E=react.useCallback(()=>{g(false),x(""),R(t[0]);},[t]),k=react.useCallback(async T=>{T.preventDefault();let m={type:u,message:S};try{await s(m),i?.(m),setTimeout(E,1500);}catch(L){n?.(L instanceof Error?L:new Error("Failed to submit feedback"));}},[u,S,s,i,n,E]);return p?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{onClick:v,style:{cursor:"pointer"},children:p}),f&&jsxRuntime.jsx(Ze,{isOpen:f,onClose:E,selectedType:u,onTypeChange:R,allowedTypes:t,message:S,onMessageChange:x,onSubmit:k,isSubmitting:a,isSuccess:l,themeStyles:b})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:v,style:{...oe.button,...At[o],backgroundColor:b.primaryColor,color:"white",borderRadius:b.borderRadius,fontFamily:b.fontFamily},"aria-label":"Open feedback form",children:e}),f&&jsxRuntime.jsx(Ze,{isOpen:f,onClose:E,selectedType:u,onTypeChange:R,allowedTypes:t,message:S,onMessageChange:x,onSubmit:k,isSubmitting:a,isSuccess:l,themeStyles:b})]})}function Ze({isOpen:o,onClose:e,selectedType:t,onTypeChange:r,allowedTypes:i,message:n,onMessageChange:p,onSubmit:d,isSubmitting:s,isSuccess:a,themeStyles:l}){return o?a?jsxRuntime.jsx("div",{style:oe.modal,onClick:e,children:jsxRuntime.jsxs("div",{style:{...oe.modalContent,textAlign:"center",fontFamily:l.fontFamily},onClick:c=>c.stopPropagation(),children:[jsxRuntime.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"\u{1F389}"}),jsxRuntime.jsx("h3",{style:{margin:"0 0 8px 0",color:l.textColor},children:"Thanks for your feedback!"}),jsxRuntime.jsx("p",{style:{margin:0,color:"#666"},children:"We appreciate you taking the time to share."})]})}):jsxRuntime.jsx("div",{style:oe.modal,onClick:e,children:jsxRuntime.jsxs("div",{style:{...oe.modalContent,fontFamily:l.fontFamily},onClick:c=>c.stopPropagation(),children:[jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[jsxRuntime.jsx("h3",{style:{margin:0,color:l.textColor},children:"Send Feedback"}),jsxRuntime.jsx("button",{onClick:e,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#999",padding:"0",lineHeight:"1"},"aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("form",{onSubmit:d,children:[jsxRuntime.jsxs("div",{style:{marginBottom:"16px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"13px",color:"#666",fontWeight:"500"},children:"What kind of feedback?"}),jsxRuntime.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:i.map(c=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>r(c),style:{...oe.typeButton,backgroundColor:t===c?l.primaryColor:"white",color:t===c?"white":l.textColor,borderColor:t===c?l.primaryColor:"#e0e0e0"},children:[qt[c]," ",Lt[c]]},c))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"13px",color:"#666",fontWeight:"500"},children:"Your message"}),jsxRuntime.jsx("textarea",{value:n,onChange:c=>p(c.target.value),placeholder:t==="bug_report"?"Describe the bug and steps to reproduce...":t==="feature_request"?"Describe the feature you would like...":"Share your thoughts...",style:oe.textarea,required:true})]}),jsxRuntime.jsx("button",{type:"submit",disabled:s||!n.trim(),style:{...oe.submitButton,backgroundColor:l.primaryColor,color:"white",opacity:s||!n.trim()?.6:1,cursor:s||!n.trim()?"not-allowed":"pointer"},children:s?"Sending...":"Send Feedback"})]})]})}):null}var q={container:{fontFamily:"system-ui, -apple-system, sans-serif",maxWidth:"800px"},searchInput:{width:"100%",padding:"12px 16px",border:"1px solid #e0e0e0",borderRadius:"8px",fontSize:"15px",marginBottom:"24px",boxSizing:"border-box"},categoryButton:{padding:"8px 16px",border:"1px solid #e0e0e0",borderRadius:"20px",cursor:"pointer",fontSize:"13px",backgroundColor:"white",transition:"all 0.2s",marginRight:"8px",marginBottom:"8px"},articleCard:{padding:"20px",border:"1px solid #e0e0e0",borderRadius:"8px",marginBottom:"12px",cursor:"pointer",transition:"box-shadow 0.2s, border-color 0.2s",backgroundColor:"white"},articleTitle:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"600"},articleDescription:{margin:0,fontSize:"14px",color:"#666",lineHeight:1.5},articleMeta:{display:"flex",gap:"16px",marginTop:"12px",fontSize:"12px",color:"#999"},backButton:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 0",border:"none",background:"none",cursor:"pointer",fontSize:"14px",color:"#666",marginBottom:"16px"},articleContent:{lineHeight:1.7,fontSize:"15px"},loading:{textAlign:"center",padding:"40px",color:"#666"},error:{padding:"20px",backgroundColor:"#fef2f2",borderRadius:"8px",color:"#b91c1c",textAlign:"center"},empty:{textAlign:"center",padding:"40px",color:"#666"}};function Ut(o){return {primaryColor:o.primaryColor||"#000000",textColor:o.textColor||"#333333",backgroundColor:o.backgroundColor||"#ffffff",borderRadius:o.borderRadius||"8px",fontFamily:o.fontFamily||"system-ui, -apple-system, sans-serif"}}function Nt({showSearch:o=true,showCategories:e=true,defaultCategory:t,theme:r,className:i,onArticleView:n}){let{theme:p}=O(),[d,s]=react.useState(""),[a,l]=react.useState(t),[c,f]=react.useState(null),g={...p,...r},u=Ut(g),{articles:R,isLoading:S,error:x}=ue({category:a,search:d||void 0}),{article:w,isLoading:b,error:v}=fe(c||""),E=react.useMemo(()=>{let m=new Set;return R.forEach(L=>{L.category&&m.add(L.category);}),Array.from(m).sort()},[R]),k=m=>{f(m.slug),n?.(m);},T=()=>{f(null);};return c?b?jsxRuntime.jsx("div",{style:{...q.container,fontFamily:u.fontFamily},className:i,children:jsxRuntime.jsx("div",{style:q.loading,children:"Loading article..."})}):v?jsxRuntime.jsxs("div",{style:{...q.container,fontFamily:u.fontFamily},className:i,children:[jsxRuntime.jsx("button",{onClick:T,style:q.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsx("div",{style:q.error,children:"Failed to load article. Please try again."})]}):w?jsxRuntime.jsxs("div",{style:{...q.container,fontFamily:u.fontFamily},className:i,children:[jsxRuntime.jsx("button",{onClick:T,style:q.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsxs("article",{children:[jsxRuntime.jsx("h1",{style:{margin:"0 0 16px 0",color:u.textColor},children:w.title}),w.read_time_minutes&&jsxRuntime.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"24px"},children:[w.read_time_minutes," min read"]}),w.content_html?jsxRuntime.jsx("div",{style:{...q.articleContent,color:u.textColor},dangerouslySetInnerHTML:{__html:w.content_html}}):jsxRuntime.jsx("div",{style:{...q.articleContent,color:u.textColor},children:typeof w.content=="string"?w.content:"No content available."})]})]}):jsxRuntime.jsxs("div",{style:{...q.container,fontFamily:u.fontFamily},className:i,children:[jsxRuntime.jsx("button",{onClick:T,style:q.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsx("div",{style:q.empty,children:"Article not found."})]}):jsxRuntime.jsxs("div",{style:{...q.container,fontFamily:u.fontFamily},className:i,children:[o&&jsxRuntime.jsx("input",{type:"text",placeholder:"Search articles...",value:d,onChange:m=>s(m.target.value),style:q.searchInput}),e&&E.length>0&&jsxRuntime.jsxs("div",{style:{marginBottom:"24px"},children:[jsxRuntime.jsx("button",{onClick:()=>l(void 0),style:{...q.categoryButton,backgroundColor:a?"white":u.primaryColor,color:a?u.textColor:"white",borderColor:a?"#e0e0e0":u.primaryColor},children:"All"}),E.map(m=>jsxRuntime.jsx("button",{onClick:()=>l(m),style:{...q.categoryButton,backgroundColor:a===m?u.primaryColor:"white",color:a===m?"white":u.textColor,borderColor:a===m?u.primaryColor:"#e0e0e0"},children:m},m))]}),S&&jsxRuntime.jsx("div",{style:q.loading,children:"Loading articles..."}),x&&jsxRuntime.jsx("div",{style:q.error,children:"Failed to load articles. Please try again."}),!S&&!x&&R.length===0&&jsxRuntime.jsx("div",{style:q.empty,children:d?`No articles found for "${d}"`:"No articles available yet."}),!S&&!x&&R.length>0&&jsxRuntime.jsx("div",{children:R.map(m=>jsxRuntime.jsxs("div",{onClick:()=>k(m),style:q.articleCard,role:"button",tabIndex:0,onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&k(m);},children:[jsxRuntime.jsx("h3",{style:{...q.articleTitle,color:u.textColor},children:m.title}),m.seo_description&&jsxRuntime.jsx("p",{style:q.articleDescription,children:m.seo_description}),jsxRuntime.jsxs("div",{style:q.articleMeta,children:[m.category&&jsxRuntime.jsx("span",{children:m.category}),m.read_time_minutes&&jsxRuntime.jsxs("span",{children:[m.read_time_minutes," min read"]})]})]},m.id))})]})}var K={container:{fontFamily:"system-ui, -apple-system, sans-serif"},list:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"12px"},card:{border:"1px solid #e5e7eb",borderRadius:"8px",padding:"16px",backgroundColor:"#ffffff",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s"},cardHover:{borderColor:"#d1d5db",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"8px"},badges:{display:"flex",alignItems:"center",gap:"6px"},badge:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"9999px",fontSize:"12px",fontWeight:500},message:{fontSize:"14px",color:"#111827",margin:0,lineHeight:1.5},meta:{display:"flex",gap:"12px",marginTop:"8px",fontSize:"12px",color:"#6b7280"},empty:{textAlign:"center",padding:"32px 16px",color:"#6b7280"},emptyIcon:{width:"48px",height:"48px",margin:"0 auto 12px",color:"#d1d5db"},loading:{textAlign:"center",padding:"24px",color:"#6b7280"},error:{textAlign:"center",padding:"24px",color:"#dc2626"}},tt={feedback:{label:"Feedback",color:"#2563eb",bg:"#dbeafe"},bug_report:{label:"Bug Report",color:"#dc2626",bg:"#fee2e2"},feature_request:{label:"Feature Request",color:"#d97706",bg:"#fef3c7"},article_rating:{label:"Article Rating",color:"#7c3aed",bg:"#ede9fe"}},ot={new:{label:"New",color:"#6b7280",bg:"#f3f4f6"},reviewed:{label:"Reviewed",color:"#2563eb",bg:"#dbeafe"},in_progress:{label:"In Progress",color:"#d97706",bg:"#fef3c7"},resolved:{label:"Resolved",color:"#059669",bg:"#d1fae5"},closed:{label:"Closed",color:"#6b7280",bg:"#f3f4f6"}};function $t(o){return new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function Vt({status:o,type:e,limit:t=50,className:r,showEmptyState:i=true,onRequestClick:n}){let{isIdentified:p}=O(),[d,s]=react.useState(null),{requests:a,isLoading:l,error:c,refetch:f}=ne({status:o,type:e,limit:t}),g=react.useCallback(u=>{n?.(u);},[n]);return p?l?jsxRuntime.jsx("div",{style:K.loading,children:jsxRuntime.jsx("p",{children:"Loading requests..."})}):c?jsxRuntime.jsx("div",{style:K.error,children:jsxRuntime.jsxs("p",{children:["Failed to load requests. ",jsxRuntime.jsx("button",{onClick:f,style:{color:"inherit",textDecoration:"underline",background:"none",border:"none",cursor:"pointer"},children:"Try again"})]})}):a.length===0&&i?jsxRuntime.jsxs("div",{style:K.empty,children:[jsxRuntime.jsx("svg",{style:K.emptyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})}),jsxRuntime.jsx("p",{style:{margin:0,fontWeight:500,color:"#111827"},children:"No requests yet"}),jsxRuntime.jsx("p",{style:{margin:"8px 0 0",fontSize:"14px"},children:"When you submit feedback, bug reports, or feature requests, they'll appear here."})]}):jsxRuntime.jsx("div",{style:K.container,className:r,children:jsxRuntime.jsx("ul",{style:K.list,children:a.map(u=>{let R=tt[u.feedback_type]||tt.feedback,S=ot[u.status]||ot.new,x=d===u.id;return jsxRuntime.jsxs("li",{style:{...K.card,...x?K.cardHover:{}},onMouseEnter:()=>s(u.id),onMouseLeave:()=>s(null),onClick:()=>g(u),role:"button",tabIndex:0,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&g(u);},children:[jsxRuntime.jsx("div",{style:K.header,children:jsxRuntime.jsxs("div",{style:K.badges,children:[jsxRuntime.jsx("span",{style:{...K.badge,color:R.color,backgroundColor:R.bg},children:R.label}),jsxRuntime.jsx("span",{style:{...K.badge,color:S.color,backgroundColor:S.bg},children:S.label})]})}),jsxRuntime.jsx("p",{style:K.message,children:u.message||"No message provided"}),jsxRuntime.jsxs("div",{style:K.meta,children:[jsxRuntime.jsx("span",{children:$t(u.created_at)}),u.page_url&&jsxRuntime.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"},children:["From: ",u.page_url]})]})]},u.id)})})}):i?jsxRuntime.jsx("div",{style:K.empty,children:jsxRuntime.jsx("p",{children:"Please sign in to view your requests."})}):null}var h={container:{fontFamily:"system-ui, -apple-system, sans-serif",display:"flex",minHeight:"400px"},sidebar:{width:"240px",flexShrink:0,borderRight:"1px solid #e5e7eb",paddingRight:"16px",marginRight:"24px"},sidebarSection:{marginBottom:"24px"},sidebarLabel:{fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"#6b7280",marginBottom:"8px",paddingLeft:"8px"},sidebarItem:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",borderRadius:"6px",cursor:"pointer",fontSize:"14px",color:"#374151",transition:"background-color 0.15s, color 0.15s",border:"none",background:"none",width:"100%",textAlign:"left"},sidebarItemActive:{backgroundColor:"#f3f4f6",color:"#111827",fontWeight:500},sidebarFeature:{padding:"6px 12px 6px 32px",fontSize:"13px"},sidebarBadge:{marginLeft:"auto",padding:"2px 6px",borderRadius:"9999px",fontSize:"11px",fontWeight:500,backgroundColor:"#e5e7eb",color:"#374151"},main:{flex:1,minWidth:0},tabs:{display:"flex",gap:"4px",marginBottom:"24px",borderBottom:"1px solid #e5e7eb"},tab:{padding:"12px 20px",border:"none",background:"none",cursor:"pointer",fontSize:"14px",fontWeight:500,color:"#6b7280",borderBottom:"2px solid transparent",marginBottom:"-1px",transition:"color 0.15s, border-color 0.15s"},tabActive:{color:"#111827",borderBottomColor:"#111827"},tabBadge:{marginLeft:"6px",padding:"2px 6px",borderRadius:"9999px",fontSize:"11px",fontWeight:600,backgroundColor:"#e5e7eb",color:"#374151"},groupCardsGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"16px",marginBottom:"24px"},groupCard:{padding:"20px",border:"1px solid #e5e7eb",borderRadius:"12px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s",backgroundColor:"white"},groupCardName:{fontSize:"16px",fontWeight:600,color:"#111827",margin:0},groupCardMeta:{fontSize:"13px",color:"#6b7280",marginTop:"4px"},searchInput:{width:"100%",padding:"10px 14px",border:"1px solid #e5e7eb",borderRadius:"8px",fontSize:"14px",marginBottom:"20px",boxSizing:"border-box"},articleCard:{padding:"16px",border:"1px solid #e5e7eb",borderRadius:"10px",marginBottom:"12px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s",backgroundColor:"white"},articleTitle:{margin:"0 0 6px 0",fontSize:"15px",fontWeight:600},articleDescription:{margin:0,fontSize:"14px",color:"#6b7280",lineHeight:1.5},articleMeta:{display:"flex",gap:"12px",marginTop:"10px",fontSize:"12px",color:"#9ca3af"},backButton:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 0",border:"none",background:"none",cursor:"pointer",fontSize:"14px",color:"#6b7280",marginBottom:"16px"},articleContent:{lineHeight:1.7,fontSize:"15px"},requestCard:{border:"1px solid #e5e7eb",borderRadius:"10px",padding:"16px",backgroundColor:"#ffffff",marginBottom:"12px",transition:"border-color 0.15s"},requestHeader:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},badge:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:"9999px",fontSize:"12px",fontWeight:500},requestMessage:{fontSize:"14px",color:"#111827",margin:0,lineHeight:1.5},requestMeta:{display:"flex",gap:"12px",marginTop:"10px",fontSize:"12px",color:"#9ca3af"},sectionHeader:{marginBottom:"16px"},sectionTitle:{fontSize:"18px",fontWeight:600,color:"#111827",margin:"0 0 4px 0"},sectionDescription:{fontSize:"14px",color:"#6b7280",margin:0},loading:{textAlign:"center",padding:"40px",color:"#6b7280"},error:{padding:"20px",backgroundColor:"#fef2f2",borderRadius:"10px",color:"#b91c1c",textAlign:"center"},empty:{textAlign:"center",padding:"48px 24px",color:"#6b7280"},emptyIcon:{width:"48px",height:"48px",margin:"0 auto 16px",color:"#d1d5db"}},rt={feedback:{label:"Feedback",color:"#2563eb",bg:"#dbeafe"},bug_report:{label:"Bug",color:"#dc2626",bg:"#fee2e2"},feature_request:{label:"Feature",color:"#d97706",bg:"#fef3c7"},article_rating:{label:"Rating",color:"#7c3aed",bg:"#ede9fe"}},nt={new:{label:"New",color:"#6b7280",bg:"#f3f4f6"},planned:{label:"Planned",color:"#2563eb",bg:"#dbeafe"},in_progress:{label:"In Progress",color:"#d97706",bg:"#fef3c7"},resolved:{label:"Resolved",color:"#059669",bg:"#d1fae5"},closed:{label:"Closed",color:"#6b7280",bg:"#f3f4f6"}};function Kt(o){return new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function jt(o){return {primaryColor:o.primaryColor||"#111827",textColor:o.textColor||"#111827",backgroundColor:o.backgroundColor||"#ffffff",borderRadius:o.borderRadius||"10px",fontFamily:o.fontFamily||"system-ui, -apple-system, sans-serif"}}var Xt={articles:"Articles",requests:"My Requests"};function Yt({group:o,onClick:e}){return jsxRuntime.jsxs("div",{style:h.groupCard,onClick:e,role:"button",tabIndex:0,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&e();},children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{style:h.groupCardName,children:o.name}),jsxRuntime.jsxs("p",{style:h.groupCardMeta,children:[o.feature_count," feature",o.feature_count!==1?"s":""," \xB7 ",o.article_count," article",o.article_count!==1?"s":""]})]}),o.description&&jsxRuntime.jsx("p",{style:{...h.articleDescription,marginTop:"8px"},children:o.description})]})}function it({featureId:o,featureName:e,showSearch:t,themeStyles:r,onArticleView:i,onBack:n}){let[p,d]=react.useState(""),[s,a]=react.useState(null),{articles:l,isLoading:c,error:f}=ue({search:p||void 0}),{article:g,isLoading:u,error:R}=fe(s||""),S=react.useMemo(()=>o?l.filter(b=>b.features?.id===o):l,[l,o]),x=b=>{a(b.slug),i?.(b);},w=()=>{a(null);};return s?u?jsxRuntime.jsx("div",{style:h.loading,children:"Loading article..."}):R?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:w,style:h.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsx("div",{style:h.error,children:"Failed to load article."})]}):g?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:w,style:h.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsxs("article",{children:[jsxRuntime.jsx("h1",{style:{margin:"0 0 12px 0",fontSize:"24px",color:r.textColor},children:g.title}),g.read_time_minutes&&jsxRuntime.jsxs("div",{style:{fontSize:"14px",color:"#6b7280",marginBottom:"24px"},children:[g.read_time_minutes," min read"]}),g.content_html?jsxRuntime.jsx("div",{style:{...h.articleContent,color:r.textColor},dangerouslySetInnerHTML:{__html:g.content_html}}):jsxRuntime.jsx("div",{style:{...h.articleContent,color:r.textColor},children:typeof g.content=="string"?g.content:"No content available."})]})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:w,style:h.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsx("div",{style:h.empty,children:"Article not found."})]}):jsxRuntime.jsxs("div",{children:[e&&n&&jsxRuntime.jsxs("div",{style:h.sectionHeader,children:[jsxRuntime.jsx("button",{onClick:n,style:h.backButton,children:"\u2190 Back to features"}),jsxRuntime.jsx("h2",{style:h.sectionTitle,children:e}),jsxRuntime.jsx("p",{style:h.sectionDescription,children:"Documentation and guides for this feature"})]}),t&&jsxRuntime.jsx("input",{type:"text",placeholder:"Search articles...",value:p,onChange:b=>d(b.target.value),style:h.searchInput}),c&&jsxRuntime.jsx("div",{style:h.loading,children:"Loading articles..."}),f&&jsxRuntime.jsx("div",{style:h.error,children:"Failed to load articles. Please try again."}),!c&&!f&&S.length===0&&jsxRuntime.jsxs("div",{style:h.empty,children:[jsxRuntime.jsx("svg",{style:h.emptyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),jsxRuntime.jsx("p",{style:{margin:0,fontWeight:500,color:"#111827"},children:p?`No articles found for "${p}"`:"No articles yet"}),jsxRuntime.jsx("p",{style:{margin:"8px 0 0",fontSize:"14px"},children:"Check back soon for helpful content."})]}),!c&&!f&&S.length>0&&jsxRuntime.jsx("div",{children:S.map(b=>jsxRuntime.jsxs("div",{onClick:()=>x(b),style:h.articleCard,role:"button",tabIndex:0,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&x(b);},children:[jsxRuntime.jsx("h3",{style:{...h.articleTitle,color:r.textColor},children:b.title}),b.seo_description&&jsxRuntime.jsx("p",{style:h.articleDescription,children:b.seo_description}),jsxRuntime.jsxs("div",{style:h.articleMeta,children:[b.category&&jsxRuntime.jsx("span",{children:b.category}),b.read_time_minutes&&jsxRuntime.jsxs("span",{children:[b.read_time_minutes," min read"]})]})]},b.id))})]})}function Qt({onRequestClick:o}){let{isIdentified:e}=O(),{requests:t,isLoading:r,error:i,refetch:n}=ne({limit:50});return e?r?jsxRuntime.jsx("div",{style:h.loading,children:"Loading requests..."}):i?jsxRuntime.jsx("div",{style:h.error,children:jsxRuntime.jsxs("p",{children:["Failed to load requests."," ",jsxRuntime.jsx("button",{onClick:n,style:{color:"inherit",textDecoration:"underline",background:"none",border:"none",cursor:"pointer"},children:"Try again"})]})}):t.length===0?jsxRuntime.jsxs("div",{style:h.empty,children:[jsxRuntime.jsx("svg",{style:h.emptyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})}),jsxRuntime.jsx("p",{style:{margin:0,fontWeight:500,color:"#111827"},children:"No requests yet"}),jsxRuntime.jsx("p",{style:{margin:"8px 0 0",fontSize:"14px"},children:"When you submit feedback, bug reports, or feature requests, they'll appear here."})]}):jsxRuntime.jsx("div",{children:t.map(p=>{let d=rt[p.feedback_type]||rt.feedback,s=nt[p.status]||nt.new;return jsxRuntime.jsxs("div",{style:h.requestCard,onClick:()=>o?.(p),role:o?"button":void 0,tabIndex:o?0:void 0,onKeyDown:o?a=>{(a.key==="Enter"||a.key===" ")&&o(p);}:void 0,children:[jsxRuntime.jsxs("div",{style:h.requestHeader,children:[jsxRuntime.jsx("span",{style:{...h.badge,color:d.color,backgroundColor:d.bg},children:d.label}),jsxRuntime.jsx("span",{style:{...h.badge,color:s.color,backgroundColor:s.bg},children:s.label})]}),jsxRuntime.jsx("p",{style:h.requestMessage,children:p.message||"No message provided"}),jsxRuntime.jsxs("div",{style:h.requestMeta,children:[jsxRuntime.jsx("span",{children:Kt(p.created_at)}),p.page_url&&jsxRuntime.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"},children:["From: ",p.page_url]})]})]},p.id)})}):jsxRuntime.jsxs("div",{style:h.empty,children:[jsxRuntime.jsx("p",{style:{margin:0,fontWeight:500,color:"#111827"},children:"Sign in required"}),jsxRuntime.jsx("p",{style:{margin:"8px 0 0",fontSize:"14px"},children:"Please sign in to view your requests."})]})}function Jt({tabs:o=["articles","requests"],defaultTab:e,tabLabels:t,showSearch:r=true,showCategories:i=true,theme:n,className:p,onArticleView:d,onRequestClick:s,onTabChange:a}){let{theme:l}=O(),c={...l,...n},f=jt(c),g=e&&o.includes(e)?e:o[0],[u,R]=react.useState(g),[S,x]=react.useState(null),[w,b]=react.useState(null),{featureGroups:v,isLoading:E}=qe(),{requests:k}=ne({limit:100}),T=k.filter(P=>["new","planned","in_progress"].includes(P.status)).length,m={...Xt,...t},L=react.useMemo(()=>v.find(P=>P.id===S)||null,[v,S]),U=P=>{R(P),x(null),b(null),a?.(P);},j=P=>{x(P.id),b(null);},_=P=>{b(P);},G=()=>{x(null),b(null);},y=()=>{b(null);},N=o.length>1;return jsxRuntime.jsxs("div",{style:{...h.container,fontFamily:f.fontFamily},className:p,children:[u==="articles"&&v.length>0&&jsxRuntime.jsxs("div",{style:h.sidebar,children:[jsxRuntime.jsxs("div",{style:h.sidebarSection,children:[jsxRuntime.jsx("div",{style:h.sidebarLabel,children:"Resources"}),jsxRuntime.jsxs("button",{style:{...h.sidebarItem,...S?{}:h.sidebarItemActive},onClick:G,children:[jsxRuntime.jsx("span",{children:"\u{1F3E0}"}),jsxRuntime.jsx("span",{children:"All Features"})]})]}),jsxRuntime.jsxs("div",{style:h.sidebarSection,children:[jsxRuntime.jsx("div",{style:h.sidebarLabel,children:"Features"}),E?jsxRuntime.jsx("div",{style:{padding:"8px 12px",fontSize:"13px",color:"#6b7280"},children:"Loading..."}):v.map(P=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{style:{...h.sidebarItem,...S===P.id?h.sidebarItemActive:{}},onClick:()=>j(P),children:[jsxRuntime.jsx("span",{style:{flex:1},children:P.name}),jsxRuntime.jsx("span",{style:h.sidebarBadge,children:P.feature_count})]}),S===P.id&&jsxRuntime.jsx("div",{children:P.features.map(D=>jsxRuntime.jsxs("button",{style:{...h.sidebarItem,...h.sidebarFeature,...w?.id===D.id?h.sidebarItemActive:{}},onClick:()=>_(D),children:[D.name,D.article_count>0&&jsxRuntime.jsx("span",{style:h.sidebarBadge,children:D.article_count})]},D.id))})]},P.id))]})]}),jsxRuntime.jsxs("div",{style:h.main,children:[N&&jsxRuntime.jsx("div",{style:h.tabs,children:o.map(P=>jsxRuntime.jsxs("button",{onClick:()=>U(P),style:{...h.tab,...u===P?h.tabActive:{},...u===P?{borderBottomColor:f.primaryColor,color:f.primaryColor}:{}},children:[m[P],P==="requests"&&T>0&&jsxRuntime.jsx("span",{style:h.tabBadge,children:T})]},P))}),u==="articles"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!S&&!w&&v.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{style:h.sectionHeader,children:[jsxRuntime.jsx("h2",{style:h.sectionTitle,children:"Browse by Feature"}),jsxRuntime.jsx("p",{style:h.sectionDescription,children:"Select a feature group to find relevant documentation"})]}),jsxRuntime.jsx("div",{style:h.groupCardsGrid,children:v.map(P=>jsxRuntime.jsx(Yt,{group:P,onClick:()=>j(P)},P.id))})]}),L&&!w&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{style:h.sectionHeader,children:[jsxRuntime.jsx("button",{onClick:G,style:h.backButton,children:"\u2190 Back to all features"}),jsxRuntime.jsx("h2",{style:h.sectionTitle,children:L.name}),L.description&&jsxRuntime.jsx("p",{style:h.sectionDescription,children:L.description})]}),jsxRuntime.jsx("div",{style:h.groupCardsGrid,children:L.features.map(P=>jsxRuntime.jsxs("div",{style:h.groupCard,onClick:()=>_(P),role:"button",tabIndex:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&_(P);},children:[jsxRuntime.jsx("h3",{style:h.groupCardName,children:P.name}),jsxRuntime.jsxs("p",{style:h.groupCardMeta,children:[P.article_count," article",P.article_count!==1?"s":""]}),P.description&&jsxRuntime.jsx("p",{style:{...h.articleDescription,marginTop:"8px"},children:P.description})]},P.id))})]}),w&&jsxRuntime.jsx(it,{featureId:w.id,featureName:w.name,showSearch:r,themeStyles:f,onArticleView:d,onBack:y}),v.length===0&&jsxRuntime.jsx(it,{showSearch:r,themeStyles:f,onArticleView:d})]}),u==="requests"&&jsxRuntime.jsx(Qt,{onRequestClick:s})]})]})}var at={tooltip:"Tooltip",modal:"Modal",slideout:"Slideout",hotspot:"Hotspot",banner:"Banner"},to={tooltip:"Points to a specific element with an arrow",modal:"Centered overlay that grabs attention",slideout:"Slides in from the side of the screen",hotspot:"Pulsing beacon that expands on click",banner:"Top or bottom bar announcement"},oo=[{value:"auto",label:"Auto"},{value:"top",label:"Top"},{value:"bottom",label:"Bottom"},{value:"left",label:"Left"},{value:"right",label:"Right"}],ro=[{value:"button",label:"Button click"},{value:"click",label:"Click anywhere"},{value:"delay",label:"After delay"},{value:"form-submit",label:"Form submit"}];function lt({step:o,onUpdate:e,onSelectElement:t,isSelectingElement:r}){let[i,n]=react.useState(false),[p,d]=react.useState(o.step_type),[s,a]=react.useState(o.rich_content?.title||o.title||""),[l,c]=react.useState(o.rich_content?.body||o.content||""),[f,g]=react.useState(o.tooltip_position||o.display_config?.position||"auto"),[u,R]=react.useState(o.selector_strategy?.css||""),[S,x]=react.useState(o.display_config?.backdrop!==false),[w,b]=react.useState(o.advance_config?.trigger||"button"),[v,E]=react.useState(o.advance_config?.delay||3e3),k=react.useCallback(async()=>{n(true);try{let m=u?{css:u}:void 0,L={title:s||void 0,body:l||void 0},U={position:f!=="auto"?f:void 0,backdrop:S},j={trigger:w,delay:w==="delay"?v:void 0};await e(o.id,{stepType:p,selectorStrategy:m,richContent:L,displayConfig:U,advanceConfig:j,tooltipPosition:f});}finally{n(false);}},[o.id,p,s,l,f,u,S,w,v,e]),T=p==="tooltip"||p==="hotspot";return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[jsxRuntime.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid #e5e7eb",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx("span",{style:{fontWeight:500},children:"Edit Step"}),jsxRuntime.jsx("button",{onClick:k,disabled:i,style:{padding:"6px 12px",fontSize:"13px",border:"none",borderRadius:"4px",backgroundColor:"#2563eb",color:"white",cursor:i?"wait":"pointer",opacity:i?.7:1},children:i?"Saving...":"Save Changes"})]}),jsxRuntime.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:[jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Step Type"}),jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"8px"},children:Object.keys(at).map(m=>jsxRuntime.jsxs("button",{onClick:()=>d(m),style:{padding:"10px",border:`2px solid ${p===m?"#2563eb":"#e5e7eb"}`,borderRadius:"6px",backgroundColor:p===m?"#eff6ff":"white",cursor:"pointer",textAlign:"left"},children:[jsxRuntime.jsx("div",{style:{fontWeight:500,fontSize:"13px"},children:at[m]}),jsxRuntime.jsx("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:to[m]})]},m))})]}),T&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Target Element"}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"8px"},children:[jsxRuntime.jsx("input",{type:"text",value:u,onChange:m=>R(m.target.value),placeholder:"CSS selector (e.g., #my-button)",style:{flex:1,padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",fontFamily:"monospace"}}),jsxRuntime.jsx("button",{onClick:t,disabled:r,style:{padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:r?"#f3f4f6":"white",cursor:r?"wait":"pointer"},children:r?"Selecting...":"Select"})]}),jsxRuntime.jsx("p",{style:{fontSize:"11px",color:"#6b7280",marginTop:"4px"},children:'Click "Select" to pick an element on the page, or enter a CSS selector manually'})]}),jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Title"}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:m=>a(m.target.value),placeholder:"Enter step title",style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px"}})]}),jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Content"}),jsxRuntime.jsx("textarea",{value:l,onChange:m=>c(m.target.value),placeholder:"Enter step content (HTML supported)",rows:4,style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",resize:"vertical",fontFamily:"inherit"}})]}),(p==="tooltip"||p==="hotspot")&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Position"}),jsxRuntime.jsx("select",{value:f,onChange:m=>g(m.target.value),style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white"},children:oo.map(m=>jsxRuntime.jsx("option",{value:m.value,children:m.label},m.value))})]}),p==="banner"&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Banner Position"}),jsxRuntime.jsxs("select",{value:f==="bottom"?"bottom":"top",onChange:m=>g(m.target.value),style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white"},children:[jsxRuntime.jsx("option",{value:"top",children:"Top"}),jsxRuntime.jsx("option",{value:"bottom",children:"Bottom"})]})]}),p==="slideout"&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Slideout Side"}),jsxRuntime.jsxs("select",{value:f==="left"?"left":"right",onChange:m=>g(m.target.value),style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white"},children:[jsxRuntime.jsx("option",{value:"right",children:"Right"}),jsxRuntime.jsx("option",{value:"left",children:"Left"})]})]}),(p==="tooltip"||p==="modal")&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[jsxRuntime.jsx("input",{type:"checkbox",checked:S,onChange:m=>x(m.target.checked),style:{width:"16px",height:"16px"}}),jsxRuntime.jsx("span",{style:{fontSize:"13px",fontWeight:500},children:"Show backdrop overlay"})]}),jsxRuntime.jsx("p",{style:{fontSize:"11px",color:"#6b7280",marginTop:"4px",marginLeft:"24px"},children:"Dims the background to focus attention on the step"})]}),jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Advance When"}),jsxRuntime.jsx("select",{value:w,onChange:m=>b(m.target.value),style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white"},children:ro.map(m=>jsxRuntime.jsx("option",{value:m.value,children:m.label},m.value))})]}),w==="delay"&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Delay (seconds)"}),jsxRuntime.jsx("input",{type:"number",value:v/1e3,onChange:m=>E(Number(m.target.value)*1e3),min:1,max:60,style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px"}})]})]})]})}function io(o){let e={},t=o.getAttribute("data-testid");if(t)return e.testId=t,e.css=`[data-testid="${t}"]`,e;if(o.id)return e.css=`#${CSS.escape(o.id)}`,e;let r=[],i=o,n=0,p=5;for(;i&&i!==document.body&&n<p;){let s=i.tagName.toLowerCase(),a=Array.from(i.classList).filter(f=>!f.startsWith("hover")&&!f.startsWith("focus")&&!f.startsWith("active")).slice(0,2);a.length>0&&(s+="."+a.map(f=>CSS.escape(f)).join("."));let l=i.parentElement;if(l){let f=Array.from(l.children).filter(g=>g.tagName===i.tagName);if(f.length>1){let g=f.indexOf(i)+1;s+=`:nth-of-type(${g})`;}}r.unshift(s);let c=r.join(" > ");try{if(document.querySelectorAll(c).length===1){e.css=c;break}}catch{}i=i.parentElement,n++;}!e.css&&r.length>0&&(e.css=r.join(" > "));let d=o.textContent?.trim();return d&&d.length<100&&d.length>2&&(e.text=d.slice(0,50)),e}function so(o){let e=0;if(o.css)try{e=document.querySelectorAll(o.css).length;}catch{}return o.testId&&(e=document.querySelectorAll(`[data-testid="${o.testId}"]`).length),{isUnique:e===1,count:e}}function pt({isActive:o,onSelect:e,onCancel:t,ignoreSelector:r="[data-census-builder]",zIndex:i=99999}){let[n,p]=react.useState(null),[d,s]=react.useState(null),[a,l]=react.useState(null),c=react.useRef(null),f=react.useCallback(()=>{if(!n){s(null);return}s(n.getBoundingClientRect());},[n]);react.useEffect(()=>{if(!o)return;let R=x=>{let b=document.elementsFromPoint(x.clientX,x.clientY).find(v=>!(c.current?.contains(v)||r&&v.closest(r)||v===document.body||v===document.documentElement));b!==n&&(p(b||null),l(b?io(b):null));},S=()=>{f();};return document.addEventListener("mousemove",R,true),window.addEventListener("scroll",S,true),window.addEventListener("resize",S),()=>{document.removeEventListener("mousemove",R,true),window.removeEventListener("scroll",S,true),window.removeEventListener("resize",S);}},[o,n,r,f]),react.useEffect(()=>{f();},[n,f]);let g=react.useCallback(R=>{R.preventDefault(),R.stopPropagation(),n&&a&&e(a,n);},[n,a,e]);if(react.useEffect(()=>{if(!o)return;let R=S=>{S.key==="Escape"&&t();};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[o,t]),!o)return null;let u=a?so(a):null;return jsxRuntime.jsxs("div",{ref:c,"data-census-builder":true,style:{position:"fixed",inset:0,zIndex:i,cursor:"crosshair"},onClick:g,children:[d&&jsxRuntime.jsx("div",{style:{position:"fixed",top:d.top,left:d.left,width:d.width,height:d.height,border:"2px solid #2563eb",borderRadius:"4px",backgroundColor:"rgba(37, 99, 235, 0.1)",pointerEvents:"none",transition:"all 0.1s ease-out"}}),d&&a&&jsxRuntime.jsxs("div",{style:{position:"fixed",top:Math.max(8,d.top-40),left:d.left,padding:"6px 10px",backgroundColor:"#1f2937",color:"white",fontSize:"12px",fontFamily:"monospace",borderRadius:"4px",maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},children:[jsxRuntime.jsx("span",{style:{color:"#9ca3af"},children:a.testId?"data-testid: ":""}),a.testId||a.css,u&&jsxRuntime.jsxs("span",{style:{marginLeft:"8px",color:u.isUnique?"#4ade80":"#fbbf24"},children:["(",u.count," match",u.count!==1?"es":"",")"]})]}),jsxRuntime.jsxs("div",{style:{position:"fixed",bottom:0,left:0,right:0,padding:"12px 20px",backgroundColor:"#1f2937",color:"white",display:"flex",alignItems:"center",justifyContent:"space-between",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px"},children:[jsxRuntime.jsxs("span",{children:["Click on any element to select it, or press ",jsxRuntime.jsx("kbd",{style:{padding:"2px 6px",backgroundColor:"#374151",borderRadius:"4px",marginLeft:"4px",marginRight:"4px"},children:"Esc"})," to cancel"]}),jsxRuntime.jsx("button",{onClick:R=>{R.stopPropagation(),t();},style:{padding:"6px 12px",border:"1px solid #4b5563",borderRadius:"4px",backgroundColor:"transparent",color:"white",cursor:"pointer"},children:"Cancel"})]})]})}function ao({isOpen:o,onClose:e,guideId:t,onSave:r,onPublish:i,trigger:n,className:p}){let[d,s]=react.useState(false),a=o??d,{guide:l,steps:c,selectedStep:f,selectedStepId:g,isLoading:u,isSaving:R,error:S,loadGuide:x,updateGuide:w,publishGuide:b,addStep:v,updateStep:E,deleteStep:k,moveStepUp:T,moveStepDown:m,setSelectedStepId:L,reset:U}=Oe(),j=react.useCallback(async()=>{s(true),t&&await x(t);},[t,x]),_=react.useCallback(()=>{s(false),U(),e?.();},[U,e]),G=react.useCallback(async()=>{if(l)try{await w({}),r?.(l);}catch{}},[l,w,r]),y=react.useCallback(async()=>{if(l)try{let P=await b();i?.(P);}catch{}},[l,b,i]),N=react.useCallback(async(P="tooltip")=>{try{await v({stepType:P,richContent:{title:"New Step",body:"Click to edit..."}});}catch{}},[v]);return n&&o===void 0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{onClick:j,children:n}),a&&jsxRuntime.jsx(ct,{guide:l,steps:c,selectedStep:f,selectedStepId:g,isLoading:u,isSaving:R,error:S,onClose:_,onSave:G,onPublish:y,onAddStep:N,onSelectStep:L,onUpdateStep:E,onDeleteStep:k,onMoveStepUp:T,onMoveStepDown:m,className:p})]}):a?jsxRuntime.jsx(ct,{guide:l,steps:c,selectedStep:f,selectedStepId:g,isLoading:u,isSaving:R,error:S,onClose:_,onSave:G,onPublish:y,onAddStep:N,onSelectStep:L,onUpdateStep:E,onDeleteStep:k,onMoveStepUp:T,onMoveStepDown:m,className:p}):null}function ct({guide:o,steps:e,selectedStep:t,selectedStepId:r,isLoading:i,isSaving:n,error:p,onClose:d,onSave:s,onPublish:a,onAddStep:l,onSelectStep:c,onUpdateStep:f,onDeleteStep:g,onMoveStepUp:u,onMoveStepDown:R,className:S}){let[x,w]=react.useState(false),b={tooltip:"Tooltip",modal:"Modal",slideout:"Slideout",hotspot:"Hotspot",banner:"Banner"},v=react.useCallback((E,k)=>{t&&f(t.id,{selectorStrategy:E}),w(false);},[t,f]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(pt,{isActive:x,onSelect:v,onCancel:()=>w(false),ignoreSelector:"[data-census-builder]"}),jsxRuntime.jsxs("div",{className:S,"data-census-builder":true,style:{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",backgroundColor:"#f8f9fa",fontFamily:"system-ui, -apple-system, sans-serif"},children:[jsxRuntime.jsxs("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 20px",backgroundColor:"white",borderBottom:"1px solid #e5e7eb"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[jsxRuntime.jsx("button",{onClick:d,style:{padding:"8px 12px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white",cursor:"pointer"},children:"Close"}),jsxRuntime.jsx("h1",{style:{margin:0,fontSize:"18px",fontWeight:600},children:o?o.name:"Guide Builder"}),o?.status&&jsxRuntime.jsx("span",{style:{padding:"2px 8px",fontSize:"12px",borderRadius:"4px",backgroundColor:o.status==="published"?"#dcfce7":"#fef3c7",color:o.status==="published"?"#166534":"#92400e"},children:o.status})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"8px"},children:[p&&jsxRuntime.jsx("span",{style:{color:"#dc2626",fontSize:"14px"},children:p.message}),jsxRuntime.jsx("button",{onClick:s,disabled:n||!o,style:{padding:"8px 16px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white",cursor:n?"wait":"pointer",opacity:n?.5:1},children:n?"Saving...":"Save"}),jsxRuntime.jsx("button",{onClick:a,disabled:n||!o||o.status==="published",style:{padding:"8px 16px",border:"none",borderRadius:"6px",backgroundColor:"#2563eb",color:"white",cursor:n?"wait":"pointer",opacity:n||o?.status==="published"?.5:1},children:"Publish"})]})]}),jsxRuntime.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[jsxRuntime.jsxs("aside",{style:{width:"280px",backgroundColor:"white",borderRight:"1px solid #e5e7eb",display:"flex",flexDirection:"column"},children:[jsxRuntime.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid #e5e7eb",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsxs("span",{style:{fontWeight:500},children:["Steps (",e.length,")"]}),jsxRuntime.jsx("button",{onClick:()=>l("tooltip"),disabled:!o,style:{padding:"6px 12px",fontSize:"13px",border:"none",borderRadius:"4px",backgroundColor:"#2563eb",color:"white",cursor:o?"pointer":"not-allowed",opacity:o?1:.5},children:"+ Add Step"})]}),jsxRuntime.jsx("div",{style:{flex:1,overflow:"auto",padding:"8px"},children:i?jsxRuntime.jsx("div",{style:{padding:"20px",textAlign:"center",color:"#6b7280"},children:"Loading..."}):e.length===0?jsxRuntime.jsx("div",{style:{padding:"20px",textAlign:"center",color:"#6b7280"},children:'No steps yet. Click "Add Step" to get started.'}):e.map((E,k)=>jsxRuntime.jsxs("div",{onClick:()=>c(E.id),style:{padding:"12px",marginBottom:"4px",borderRadius:"6px",backgroundColor:r===E.id?"#eff6ff":"white",border:`1px solid ${r===E.id?"#3b82f6":"#e5e7eb"}`,cursor:"pointer"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsxs("span",{style:{fontWeight:500,fontSize:"14px"},children:[k+1,". ",b[E.step_type]]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"4px"},children:[jsxRuntime.jsx("button",{onClick:T=>{T.stopPropagation(),u(E.id);},disabled:k===0,style:{padding:"2px 6px",fontSize:"12px",border:"1px solid #d1d5db",borderRadius:"3px",backgroundColor:"white",cursor:k===0?"not-allowed":"pointer",opacity:k===0?.3:1},children:"Up"}),jsxRuntime.jsx("button",{onClick:T=>{T.stopPropagation(),R(E.id);},disabled:k===e.length-1,style:{padding:"2px 6px",fontSize:"12px",border:"1px solid #d1d5db",borderRadius:"3px",backgroundColor:"white",cursor:k===e.length-1?"not-allowed":"pointer",opacity:k===e.length-1?.3:1},children:"Down"}),jsxRuntime.jsx("button",{onClick:T=>{T.stopPropagation(),confirm("Delete this step?")&&g(E.id);},style:{padding:"2px 6px",fontSize:"12px",border:"1px solid #fecaca",borderRadius:"3px",backgroundColor:"#fef2f2",color:"#dc2626",cursor:"pointer"},children:"Delete"})]})]}),jsxRuntime.jsx("p",{style:{margin:"4px 0 0",fontSize:"13px",color:"#6b7280"},children:E.rich_content?.title||E.title||"Untitled"})]},E.id))})]}),jsxRuntime.jsxs("main",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"#f3f4f6"},children:[jsxRuntime.jsx("div",{style:{padding:"16px",borderBottom:"1px solid #e5e7eb",backgroundColor:"white"},children:jsxRuntime.jsx("span",{style:{fontWeight:500},children:"Preview"})}),jsxRuntime.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"#6b7280"},children:t?jsxRuntime.jsxs("div",{style:{padding:"24px",backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)",maxWidth:"400px",width:"100%"},children:[jsxRuntime.jsx("div",{style:{marginBottom:"12px"},children:jsxRuntime.jsx("span",{style:{padding:"4px 8px",fontSize:"11px",fontWeight:500,borderRadius:"4px",backgroundColor:"#f3f4f6",color:"#6b7280",textTransform:"uppercase"},children:b[t.step_type]})}),jsxRuntime.jsx("h3",{style:{margin:"0 0 8px",fontSize:"16px"},children:t.rich_content?.title||t.title||"Step Preview"}),jsxRuntime.jsx("p",{style:{margin:0,color:"#4b5563"},children:t.rich_content?.body||t.content||"No content"}),t.rich_content?.media&&jsxRuntime.jsx("div",{style:{marginTop:"12px"},children:t.rich_content.media.type==="image"&&jsxRuntime.jsx("img",{src:t.rich_content.media.url,alt:t.rich_content.media.alt||"",style:{maxWidth:"100%",borderRadius:"4px"}})}),t.rich_content?.buttons&&t.rich_content.buttons.length>0&&jsxRuntime.jsx("div",{style:{marginTop:"16px",display:"flex",gap:"8px"},children:t.rich_content.buttons.map((E,k)=>jsxRuntime.jsx("span",{style:{padding:"6px 12px",fontSize:"13px",borderRadius:"4px",backgroundColor:E.style==="primary"?"#2563eb":"#f3f4f6",color:E.style==="primary"?"white":"#374151"},children:E.label},k))}),t.selector_strategy?.css&&jsxRuntime.jsxs("div",{style:{marginTop:"16px",padding:"8px",backgroundColor:"#f9fafb",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace",color:"#6b7280"},children:["Target: ",t.selector_strategy.css]})]}):jsxRuntime.jsx("p",{children:"Select a step to preview"})})]}),jsxRuntime.jsx("aside",{style:{width:"360px",backgroundColor:"white",borderLeft:"1px solid #e5e7eb",display:"flex",flexDirection:"column",overflow:"hidden"},children:t?jsxRuntime.jsx(lt,{step:t,onUpdate:f,onSelectElement:()=>w(true),isSelectingElement:x}):jsxRuntime.jsx("div",{style:{padding:"16px"},children:jsxRuntime.jsx("p",{style:{color:"#6b7280"},children:"Select a step to edit its settings"})})})]})]})]})}function $e(o){let e=o.getBoundingClientRect();return {top:e.top+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX,bottom:e.bottom+window.scrollY,width:e.width,height:e.height}}function Ve(){return {width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY}}function He(o,e,t,r,i){let n=Ve(),{scrollX:p,scrollY:d,width:s,height:a}=n;switch(r){case "top":return o.top-d-t-i>0&&o.left-p+o.width/2-e/2>0&&o.left-p+o.width/2+e/2<s;case "bottom":return o.bottom-d+t+i<a&&o.left-p+o.width/2-e/2>0&&o.left-p+o.width/2+e/2<s;case "left":return o.left-p-e-i>0&&o.top-d+o.height/2-t/2>0&&o.top-d+o.height/2+t/2<a;case "right":return o.right-p+e+i<s&&o.top-d+o.height/2-t/2>0&&o.top-d+o.height/2+t/2<a;default:return true}}function lo(o,e,t,r){let i=["bottom","top","right","left"];for(let n of i)if(He(o,e,t,n,r))return n;return "bottom"}function we(o,e,t,r){let{preferredPosition:i,offset:n={x:0,y:0},containerPadding:p=10,arrowSize:d=8}=r,s=$e(o),a=Ve(),l=i;if(i==="auto")l=lo(s,e,t,p);else if(!He(s,e,t,i,p)){let k={top:"bottom",bottom:"top",left:"right",right:"left"}[i];k&&He(s,e,t,k,p)&&(l=k);}let c=0,f=0,g={},u=d+4;switch(l){case "top":c=s.top-t-u+n.y,f=s.left+s.width/2-e/2+n.x,g={left:e/2-d/2,top:t,transform:"rotate(180deg)"};break;case "bottom":c=s.bottom+u+n.y,f=s.left+s.width/2-e/2+n.x,g={left:e/2-d/2,top:-d};break;case "left":c=s.top+s.height/2-t/2+n.y,f=s.left-e-u+n.x,g={top:t/2-d/2,left:e,transform:"rotate(-90deg)"};break;case "right":c=s.top+s.height/2-t/2+n.y,f=s.right+u+n.x,g={top:t/2-d/2,left:-d,transform:"rotate(90deg)"};break}let R=a.scrollX+p,S=a.scrollX+a.width-e-p,x=a.scrollY+p,w=a.scrollY+a.height-t-p,b=f;f=Math.max(R,Math.min(S,f)),(l==="top"||l==="bottom")&&(g.left=(g.left||0)+(b-f));let v=c;return c=Math.max(x,Math.min(w,c)),(l==="left"||l==="right")&&(g.top=(g.top||0)+(v-c)),{top:c,left:f,placement:l,arrowPosition:g}}function ke(o,e=100){let t=o.getBoundingClientRect(),r=Ve(),i=t.top<e,n=t.bottom>r.height-e,p=t.left<e,d=t.right>r.width-e;(i||n||p||d)&&o.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});}function Ge(o){if(!o)return null;if(o.css)try{let e=document.querySelector(o.css);if(e)return e}catch{}if(o.testId){let e=document.querySelector(`[data-testid="${o.testId}"]`);if(e)return e}if(o.xpath)try{let e=document.evaluate(o.xpath,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null);if(e.singleNodeValue)return e.singleNodeValue}catch{}if(o.text){let e=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT),t;for(;t=e.nextNode();)if(t.textContent?.includes(o.text))return t.parentElement}return null}function gt(o,e=8){let t=o.getBoundingClientRect(),r={top:t.top-e,left:t.left-e,right:t.right+e,bottom:t.bottom+e,width:t.width+e*2,height:t.height+e*2};return `polygon(
|
|
1
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var kt="https://api.census.ai",ze=class{constructor(e){this.currentUserId=null;if(!e.apiKey)throw new Error("Census: apiKey is required");["cs_live_","cs_test_","op_live_","op_test_"].some(r=>e.apiKey.startsWith(r))||console.warn('Census: API key should start with "cs_live_" or "cs_test_"'),this.apiKey=e.apiKey,this.baseUrl=e.baseUrl||kt,this.debug=e.debug||false,this.log("Initialized with base URL:",this.baseUrl);}async identify(e){if(!e.userId)throw new Error("Census: userId is required for identify()");this.currentUserId=e.userId,await this.request("/api/sdk/identify","POST",{userId:e.userId,email:e.email,name:e.name,avatarUrl:e.avatarUrl,metadata:e.metadata,organizationId:e.organizationId,organizationName:e.organizationName,organizationDomain:e.organizationDomain,organizationPlan:e.organizationPlan}),this.log("User identified:",e.userId);}reset(){this.currentUserId=null,this.log("User identity reset");}async submitFeedback(e){let t=["feedback","bug_report","feature_request","article_rating"];if(!e.type||!t.includes(e.type))throw new Error(`Census: type must be one of: ${t.join(", ")}`);if(e.type==="article_rating"){if(e.rating===void 0&&e.helpful===void 0)throw new Error("Census: article_rating requires rating or helpful field")}else if(!e.message)throw new Error("Census: message is required for this feedback type");let r=await this.request("/api/sdk/feedback","POST",{type:e.type,message:e.message,rating:e.rating,helpful:e.helpful,userId:this.currentUserId,articleId:e.articleId,pageUrl:typeof window<"u"?window.location.href:void 0,metadata:e.metadata});return this.log("Feedback submitted:",r.feedbackId),{feedbackId:r.feedbackId}}async getArticles(e){let t=new URLSearchParams;e?.category&&t.set("category",e.category),e?.search&&t.set("search",e.search),e?.limit&&t.set("limit",String(e.limit)),e?.offset&&t.set("offset",String(e.offset));let r=t.toString(),i=`/api/sdk/articles${r?`?${r}`:""}`,n=await this.request(i,"GET");return this.log("Fetched articles:",n.articles.length),n}async getArticle(e){try{let t=await this.request(`/api/sdk/articles/${encodeURIComponent(e)}`,"GET");return this.log("Fetched article:",e),t.article}catch(t){if(t.status===404)return null;throw t}}async getFeatureGroups(){let e=await this.request("/api/sdk/feature-groups","GET");return this.log("Fetched feature groups:",e.feature_groups.length),e}async getRequests(e){if(!this.currentUserId)throw new Error("Census: User must be identified before fetching requests. Call identify() first.");let t=new URLSearchParams;t.set("userId",this.currentUserId),e?.status&&t.set("status",e.status),e?.type&&t.set("type",e.type),e?.limit&&t.set("limit",String(e.limit)),e?.offset&&t.set("offset",String(e.offset));let r=await this.request(`/api/sdk/requests?${t.toString()}`,"GET");return this.log("Fetched requests:",r.requests.length),r}async track(e,t){if(!e)throw new Error("Census: eventType is required for track()");await this.request("/api/sdk/events","POST",{eventType:e,userId:this.currentUserId,properties:t}),this.log("Event tracked:",e);}async trackBatch(e){if(!e.events||e.events.length===0)throw new Error("Census: at least one event is required");if(e.events.length>100)throw new Error("Census: maximum 100 events per batch");let t=e.events.map(r=>({eventType:r.eventType,userId:this.currentUserId,articleId:r.articleId,featureId:r.featureId,properties:r.properties}));await this.request("/api/sdk/events","POST",{events:t}),this.log("Batch events tracked:",e.events.length);}async getGuides(e){let t=new URLSearchParams;e?.projectId&&t.set("project_id",e.projectId),e?.url&&t.set("url",e.url),e?.userId&&t.set("user_id",e.userId);let r=t.toString(),i=`/api/sdk/guides${r?`?${r}`:""}`,n=await this.request(i,"GET");return this.log("Fetched guides:",n.guides.length),n}async getGuide(e){try{let t=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}`,"GET");return this.log("Fetched guide:",e),t.guide}catch(t){if(t.status===404)return null;throw t}}async createGuide(e){if(!e.name||!e.slug)throw new Error("Census: name and slug are required for createGuide()");let t=await this.request("/api/sdk/guides","POST",{name:e.name,slug:e.slug,description:e.description,project_id:e.projectId,trigger_type:e.triggerType||"manual",trigger_config:e.triggerConfig||{},theme:e.theme||{},allow_skip:e.allowSkip??true,show_progress:e.showProgress??true});return this.log("Guide created:",t.guide.id),t.guide}async updateGuide(e,t){if(!e)throw new Error("Census: guideId is required for updateGuide()");let r={};t.name!==void 0&&(r.name=t.name),t.slug!==void 0&&(r.slug=t.slug),t.description!==void 0&&(r.description=t.description),t.triggerType!==void 0&&(r.trigger_type=t.triggerType),t.triggerConfig!==void 0&&(r.trigger_config=t.triggerConfig),t.theme!==void 0&&(r.theme=t.theme),t.allowSkip!==void 0&&(r.allow_skip=t.allowSkip),t.showProgress!==void 0&&(r.show_progress=t.showProgress),t.status!==void 0&&(r.status=t.status);let i=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}`,"PUT",r);return this.log("Guide updated:",e),i.guide}async deleteGuide(e){if(!e)throw new Error("Census: guideId is required for deleteGuide()");await this.request(`/api/sdk/guides/${encodeURIComponent(e)}`,"DELETE"),this.log("Guide deleted:",e);}async getGuideSteps(e){let t=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}/steps`,"GET");return this.log("Fetched steps for guide:",e),t.steps}async addGuideStep(e,t){if(!e)throw new Error("Census: guideId is required for addGuideStep()");let r=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}/steps`,"POST",{step_type:t.stepType||"tooltip",sort_order:t.sortOrder,selector_strategy:t.selectorStrategy||{},title:t.title,content:t.content,tooltip_position:t.tooltipPosition||"auto",rich_content:t.richContent||{},display_config:t.displayConfig||{},advance_config:t.advanceConfig||{trigger:"button"},style_config:t.styleConfig||{}});return this.log("Step added to guide:",e),r.step}async updateGuideStep(e,t,r){if(!e||!t)throw new Error("Census: guideId and stepId are required for updateGuideStep()");let i={};r.stepType!==void 0&&(i.step_type=r.stepType),r.sortOrder!==void 0&&(i.sort_order=r.sortOrder),r.selectorStrategy!==void 0&&(i.selector_strategy=r.selectorStrategy),r.title!==void 0&&(i.title=r.title),r.content!==void 0&&(i.content=r.content),r.tooltipPosition!==void 0&&(i.tooltip_position=r.tooltipPosition),r.richContent!==void 0&&(i.rich_content=r.richContent),r.displayConfig!==void 0&&(i.display_config=r.displayConfig),r.advanceConfig!==void 0&&(i.advance_config=r.advanceConfig),r.styleConfig!==void 0&&(i.style_config=r.styleConfig);let n=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}`,"PUT",i);return this.log("Step updated:",t),n.step}async deleteGuideStep(e,t){if(!e||!t)throw new Error("Census: guideId and stepId are required for deleteGuideStep()");await this.request(`/api/sdk/guides/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}`,"DELETE"),this.log("Step deleted:",t);}async reorderGuideSteps(e,t){if(!e)throw new Error("Census: guideId is required for reorderGuideSteps()");let r=await this.request(`/api/sdk/guides/${encodeURIComponent(e)}/steps`,"PUT",{steps:t});return this.log("Steps reordered for guide:",e),r.steps}async trackGuideEvent(e){if(!e.guideId||!e.eventType||!e.sessionId)throw new Error("Census: guideId, eventType, and sessionId are required for trackGuideEvent()");await this.request("/api/sdk/guides/events","POST",{guideId:e.guideId,eventType:e.eventType,stepId:e.stepId,stepIndex:e.stepIndex,pageUrl:e.pageUrl||(typeof window<"u"?window.location.href:void 0),sessionId:e.sessionId,userId:e.userId||this.currentUserId,metadata:e.metadata}),this.log("Guide event tracked:",e.eventType,e.guideId);}async markGuideCompleted(e){if(!e)throw new Error("Census: guideId is required for markGuideCompleted()");if(!this.currentUserId)throw new Error("Census: User must be identified before marking guides complete. Call identify() first.");await this.request("/api/sdk/guides/complete","POST",{guideId:e,userId:this.currentUserId}),this.log("Guide marked completed:",e);}getCurrentUserId(){return this.currentUserId}isIdentified(){return this.currentUserId!==null}async request(e,t,r){let i=`${this.baseUrl}${e}`,n={"X-Census-Key":this.apiKey};r&&(n["Content-Type"]="application/json"),this.log(`${t} ${e}`,r);let s=await fetch(i,{method:t,headers:n,body:r?JSON.stringify(r):void 0});if(!s.ok){let p=`Request failed with status ${s.status}`;try{p=(await s.json()).error||p;}catch{}throw {error:p,status:s.status}}return s.json()}log(...e){this.debug&&console.log("[Census]",...e);}};function Ye(o){return new ze(o)}var Ae=react.createContext(null);function Pt({apiKey:o,baseUrl:e,debug:t,user:r,theme:i={},children:n}){let[s,p]=react.useState(false),[a,l]=react.useState(false),d=react.useMemo(()=>Ye({apiKey:o,baseUrl:e,debug:t}),[o,e,t]);react.useEffect(()=>{r?d.identify(r).then(()=>{l(true),p(true);}).catch(f=>{console.error("[Census] Failed to identify user:",f),p(true);}):p(true);},[d,r]);let c=react.useMemo(()=>({client:d,theme:i,isReady:s,isIdentified:a}),[d,i,s,a]);return jsxRuntime.jsx(Ae.Provider,{value:c,children:n})}function Et(){let o=react.useContext(Ae);if(!o)throw new Error("useCensus must be used within a CensusProvider");return o.client}function O(){let o=react.useContext(Ae);if(!o)throw new Error("useCensusContext must be used within a CensusProvider");return o}function _t(){let{client:o}=O(),[e,t]=react.useState(false),[r,i]=react.useState(null);return {identify:async p=>{t(true),i(null);try{await o.identify(p);}catch(a){throw i(a instanceof Error?a:new Error("Failed to identify user")),a}finally{t(false);}},reset:()=>{o.reset();},isIdentifying:e,isIdentified:o.isIdentified(),error:r}}function Le(){let{client:o}=O(),[e,t]=react.useState(false),[r,i]=react.useState(false),[n,s]=react.useState(null),[p,a]=react.useState(null),l=react.useCallback(async c=>{t(true),i(false),s(null),a(null);try{let f=await o.submitFeedback(c);return a(f.feedbackId),i(!0),f}catch(f){let g=f instanceof Error?f:new Error("Failed to submit feedback");throw s(g),g}finally{t(false);}},[o]),d=react.useCallback(()=>{i(false),s(null),a(null);},[]);return {submitFeedback:l,reset:d,isSubmitting:e,isSuccess:r,error:n,feedbackId:p}}function ue(o){let{client:e,isReady:t}=O(),[r,i]=react.useState(null),[n,s]=react.useState(true),[p,a]=react.useState(null),l=react.useCallback(async()=>{s(true),a(null);try{let d=await e.getArticles(o);i(d);}catch(d){a(d instanceof Error?d:new Error("Failed to fetch articles"));}finally{s(false);}},[e,o?.category,o?.search,o?.limit,o?.offset]);return react.useEffect(()=>{t&&l();},[t,l]),{articles:r?.articles||[],pagination:r?.pagination,isLoading:n,error:p,refetch:l}}function fe(o){let{client:e,isReady:t}=O(),[r,i]=react.useState(null),[n,s]=react.useState(true),[p,a]=react.useState(null),l=react.useCallback(async()=>{if(!o){i(null),s(false);return}s(true),a(null);try{let d=await e.getArticle(o);i(d);}catch(d){a(d instanceof Error?d:new Error("Failed to fetch article"));}finally{s(false);}},[e,o]);return react.useEffect(()=>{t&&l();},[t,l]),{article:r,isLoading:n,error:p,refetch:l}}function qe(){let{client:o,isReady:e}=O(),[t,r]=react.useState([]),[i,n]=react.useState(true),[s,p]=react.useState(null),a=react.useCallback(async()=>{n(true),p(null);try{let l=await o.getFeatureGroups();r(l.feature_groups);}catch(l){p(l instanceof Error?l:new Error("Failed to fetch feature groups"));}finally{n(false);}},[o]);return react.useEffect(()=>{e&&a();},[e,a]),{featureGroups:t,isLoading:i,error:s,refetch:a}}function ne(o){let{client:e,isReady:t,isIdentified:r}=O(),[i,n]=react.useState(null),[s,p]=react.useState(true),[a,l]=react.useState(null),d=react.useCallback(async()=>{if(!r){n(null),p(false);return}p(true),l(null);try{let c=await e.getRequests(o);n(c);}catch(c){l(c instanceof Error?c:new Error("Failed to fetch requests"));}finally{p(false);}},[e,r,o?.status,o?.type,o?.limit,o?.offset]);return react.useEffect(()=>{t&&r&&d();},[t,r,d]),{requests:i?.requests||[],pagination:i?.pagination,isLoading:s,error:a,refetch:d}}function Bt(){let{client:o}=O(),e=react.useCallback(async(r,i)=>{await o.track(r,i);},[o]),t=react.useCallback(async r=>{await o.trackBatch({events:r});},[o]);return {track:e,trackBatch:t}}function Ft(o){let{client:e,isReady:t}=O(),[r,i]=react.useState(null),[n,s]=react.useState(true),[p,a]=react.useState(null),l=react.useCallback(async()=>{s(true),a(null);try{let d=await e.getGuides(o);i(d);}catch(d){a(d instanceof Error?d:new Error("Failed to fetch guides"));}finally{s(false);}},[e,o?.projectId,o?.url,o?.userId]);return react.useEffect(()=>{t&&l();},[t,l]),{guides:r?.guides||[],completedGuides:r?.completedGuides||[],isLoading:n,error:p,refetch:l}}function Oe(){let{client:o,isReady:e}=O(),[t,r]=react.useState(null),[i,n]=react.useState([]),[s,p]=react.useState(false),[a,l]=react.useState(false),[d,c]=react.useState(null),[f,g]=react.useState(null),u=react.useRef(false),R=react.useCallback(async G=>{p(true),c(null);try{let y=await o.getGuide(G);return y&&(r(y),n(y.guide_steps||[]),g(y.guide_steps?.[0]?.id||null)),y}catch(y){return c(y instanceof Error?y:new Error("Failed to load guide")),null}finally{p(false);}},[o]),S=react.useCallback(async G=>{l(true),c(null);try{let y=await o.createGuide(G);return r(y),n([]),g(null),y}catch(y){throw c(y instanceof Error?y:new Error("Failed to create guide")),y}finally{l(false);}},[o]),h=react.useCallback(async G=>{if(!t)throw new Error("No guide loaded");l(true),c(null);try{let y=await o.updateGuide(t.id,G);return r(y),u.current=!1,y}catch(y){throw c(y instanceof Error?y:new Error("Failed to update guide")),y}finally{l(false);}},[o,t]),w=react.useCallback(async()=>h({status:"published"}),[h]),b=react.useCallback(async()=>h({status:"draft"}),[h]),C=react.useCallback(async()=>{if(!t)throw new Error("No guide loaded");l(true),c(null);try{await o.deleteGuide(t.id),r(null),n([]),g(null);}catch(G){throw c(G instanceof Error?G:new Error("Failed to delete guide")),G}finally{l(false);}},[o,t]),E=react.useCallback(async G=>{if(!t)throw new Error("No guide loaded");l(true),c(null);try{let y=await o.addGuideStep(t.id,G);return n(N=>[...N,y]),g(y.id),u.current=!0,y}catch(y){throw c(y instanceof Error?y:new Error("Failed to add step")),y}finally{l(false);}},[o,t]),k=react.useCallback(async(G,y)=>{if(!t)throw new Error("No guide loaded");l(true),c(null);try{let N=await o.updateGuideStep(t.id,G,y);return n(P=>P.map(D=>D.id===G?N:D)),u.current=!0,N}catch(N){throw c(N instanceof Error?N:new Error("Failed to update step")),N}finally{l(false);}},[o,t]),_=react.useCallback(async G=>{if(!t)throw new Error("No guide loaded");l(true),c(null);try{await o.deleteGuideStep(t.id,G),n(y=>y.filter(N=>N.id!==G)),f===G&&g(i[0]?.id||null),u.current=!0;}catch(y){throw c(y instanceof Error?y:new Error("Failed to delete step")),y}finally{l(false);}},[o,t,f,i]),m=react.useCallback(async G=>{if(!t)throw new Error("No guide loaded");l(true),c(null);try{let y=await o.reorderGuideSteps(t.id,G);return n(y),u.current=!0,y}catch(y){throw c(y instanceof Error?y:new Error("Failed to reorder steps")),y}finally{l(false);}},[o,t]),L=react.useCallback(async G=>{let y=i.findIndex(P=>P.id===G);if(y<=0)return;let N=i.map((P,D)=>D===y?{id:P.id,sort_order:y-1}:D===y-1?{id:P.id,sort_order:y}:{id:P.id,sort_order:D});return m(N)},[i,m]),U=react.useCallback(async G=>{let y=i.findIndex(P=>P.id===G);if(y<0||y>=i.length-1)return;let N=i.map((P,D)=>D===y?{id:P.id,sort_order:y+1}:D===y+1?{id:P.id,sort_order:y}:{id:P.id,sort_order:D});return m(N)},[i,m]),j=f&&i.find(G=>G.id===f)||null,T=react.useCallback(()=>{r(null),n([]),g(null),c(null),u.current=false;},[]);return {guide:t,steps:i,selectedStep:j,selectedStepId:f,isLoading:s,isSaving:a,error:d,isReady:e,hasUnsavedChanges:u.current,loadGuide:R,createGuide:S,updateGuide:h,publishGuide:w,unpublishGuide:b,deleteGuide:C,addStep:E,updateStep:k,deleteStep:_,reorderSteps:m,moveStepUp:L,moveStepDown:U,setSelectedStepId:g,reset:T}}function zt(){let{client:o,isReady:e}=O(),[t,r]=react.useState(null),[i,n]=react.useState(0),[s,p]=react.useState(false),[a,l]=react.useState([]),[d,c]=react.useState([]),f=react.useCallback((T,G=0)=>{r(T),n(G),p(true);},[]),g=react.useCallback(()=>{if(!t)return;let T=t.guide_steps||[];i<T.length-1?n(G=>G+1):(l(G=>[...G,t.id]),p(false),r(null));},[t,i]),u=react.useCallback(()=>{i>0&&n(T=>T-1);},[i]),R=react.useCallback(T=>{if(!t)return;let G=t.guide_steps||[];T>=0&&T<G.length&&n(T);},[t]),S=react.useCallback(()=>{t&&c(T=>[...T,t.id]),p(false),r(null),n(0);},[t]),h=react.useCallback(()=>{p(false);},[]),w=react.useCallback(()=>{t&&p(true);},[t]),b=react.useCallback(async(T,G)=>{let y=T.guide_steps?.[G];if(y)try{await o.track("guide_step_viewed",{guide_id:T.id,guide_name:T.name,step_id:y.id,step_index:G,step_type:y.step_type});}catch{}},[o]),C=react.useCallback(async T=>{try{await o.track("guide_completed",{guide_id:T.id,guide_name:T.name,total_steps:T.guide_steps?.length||0});}catch{}},[o]),E=react.useCallback(async(T,G)=>{try{await o.track("guide_dismissed",{guide_id:T.id,guide_name:T.name,dismissed_at_step:G,total_steps:T.guide_steps?.length||0});}catch{}},[o]),k=t?.guide_steps?.[i]||null,_=t?.guide_steps?.length||0,m=i===_-1,L=i===0,U=react.useCallback(T=>a.includes(T),[a]),j=react.useCallback(T=>d.includes(T),[d]);return {activeGuide:t,currentStep:k,currentStepIndex:i,totalSteps:_,isPlaying:s,isFirstStep:L,isLastStep:m,isReady:e,startGuide:f,nextStep:g,prevStep:u,goToStep:R,dismiss:S,pause:h,resume:w,trackStepView:b,trackGuideComplete:C,trackGuideDismiss:E,completedGuideIds:a,dismissedGuideIds:d,isGuideCompleted:U,isGuideDismissed:j}}var oe={button:{position:"fixed",padding:"12px 20px",border:"none",borderRadius:"8px",cursor:"pointer",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px",fontWeight:"500",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",transition:"transform 0.2s, box-shadow 0.2s",zIndex:9999},modal:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:1e4},modalContent:{backgroundColor:"white",borderRadius:"12px",padding:"24px",width:"100%",maxWidth:"400px",margin:"16px",boxShadow:"0 20px 50px rgba(0, 0, 0, 0.2)",fontFamily:"system-ui, -apple-system, sans-serif"},textarea:{width:"100%",padding:"10px 12px",border:"1px solid #e0e0e0",borderRadius:"6px",fontSize:"14px",marginBottom:"16px",minHeight:"100px",resize:"vertical",boxSizing:"border-box",fontFamily:"inherit"},submitButton:{width:"100%",padding:"12px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"14px",fontWeight:"500",transition:"opacity 0.2s"},typeButton:{padding:"8px 16px",border:"1px solid #e0e0e0",borderRadius:"6px",cursor:"pointer",fontSize:"13px",backgroundColor:"white",transition:"all 0.2s",marginRight:"8px",marginBottom:"8px"}},At={"bottom-right":{bottom:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"top-left":{top:"20px",left:"20px"}},Lt={feedback:"General Feedback",bug_report:"Bug Report",feature_request:"Feature Request",article_rating:"Article Rating"},qt={feedback:"\u{1F4AC}",bug_report:"\u{1F41B}",feature_request:"\u{1F4A1}",article_rating:"\u2B50"};function Ot(o){return {primaryColor:o.primaryColor||"#000000",textColor:o.textColor||"#333333",backgroundColor:o.backgroundColor||"#ffffff",borderRadius:o.borderRadius||"8px",fontFamily:o.fontFamily||"system-ui, -apple-system, sans-serif"}}function Dt({position:o="bottom-right",text:e="Feedback",allowedTypes:t=["feedback","bug_report","feature_request"],theme:r,onSubmit:i,onError:n,children:s}){let{theme:p}=O(),{submitFeedback:a,isSubmitting:l,isSuccess:d,reset:c}=Le(),[f,g]=react.useState(false),[u,R]=react.useState(t[0]),[S,h]=react.useState(""),w={...p,...r},b=Ot(w),C=react.useCallback(()=>{g(true),c();},[c]),E=react.useCallback(()=>{g(false),h(""),R(t[0]);},[t]),k=react.useCallback(async _=>{_.preventDefault();let m={type:u,message:S};try{await a(m),i?.(m),setTimeout(E,1500);}catch(L){n?.(L instanceof Error?L:new Error("Failed to submit feedback"));}},[u,S,a,i,n,E]);return s?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{onClick:C,style:{cursor:"pointer"},children:s}),f&&jsxRuntime.jsx(Ze,{isOpen:f,onClose:E,selectedType:u,onTypeChange:R,allowedTypes:t,message:S,onMessageChange:h,onSubmit:k,isSubmitting:l,isSuccess:d,themeStyles:b})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:C,style:{...oe.button,...At[o],backgroundColor:b.primaryColor,color:"white",borderRadius:b.borderRadius,fontFamily:b.fontFamily},"aria-label":"Open feedback form",children:e}),f&&jsxRuntime.jsx(Ze,{isOpen:f,onClose:E,selectedType:u,onTypeChange:R,allowedTypes:t,message:S,onMessageChange:h,onSubmit:k,isSubmitting:l,isSuccess:d,themeStyles:b})]})}function Ze({isOpen:o,onClose:e,selectedType:t,onTypeChange:r,allowedTypes:i,message:n,onMessageChange:s,onSubmit:p,isSubmitting:a,isSuccess:l,themeStyles:d}){return o?l?jsxRuntime.jsx("div",{style:oe.modal,onClick:e,children:jsxRuntime.jsxs("div",{style:{...oe.modalContent,textAlign:"center",fontFamily:d.fontFamily},onClick:c=>c.stopPropagation(),children:[jsxRuntime.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"\u{1F389}"}),jsxRuntime.jsx("h3",{style:{margin:"0 0 8px 0",color:d.textColor},children:"Thanks for your feedback!"}),jsxRuntime.jsx("p",{style:{margin:0,color:"#666"},children:"We appreciate you taking the time to share."})]})}):jsxRuntime.jsx("div",{style:oe.modal,onClick:e,children:jsxRuntime.jsxs("div",{style:{...oe.modalContent,fontFamily:d.fontFamily},onClick:c=>c.stopPropagation(),children:[jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[jsxRuntime.jsx("h3",{style:{margin:0,color:d.textColor},children:"Send Feedback"}),jsxRuntime.jsx("button",{onClick:e,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#999",padding:"0",lineHeight:"1"},"aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("form",{onSubmit:p,children:[jsxRuntime.jsxs("div",{style:{marginBottom:"16px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"13px",color:"#666",fontWeight:"500"},children:"What kind of feedback?"}),jsxRuntime.jsx("div",{style:{display:"flex",flexWrap:"wrap"},children:i.map(c=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>r(c),style:{...oe.typeButton,backgroundColor:t===c?d.primaryColor:"white",color:t===c?"white":d.textColor,borderColor:t===c?d.primaryColor:"#e0e0e0"},children:[qt[c]," ",Lt[c]]},c))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"13px",color:"#666",fontWeight:"500"},children:"Your message"}),jsxRuntime.jsx("textarea",{value:n,onChange:c=>s(c.target.value),placeholder:t==="bug_report"?"Describe the bug and steps to reproduce...":t==="feature_request"?"Describe the feature you would like...":"Share your thoughts...",style:oe.textarea,required:true})]}),jsxRuntime.jsx("button",{type:"submit",disabled:a||!n.trim(),style:{...oe.submitButton,backgroundColor:d.primaryColor,color:"white",opacity:a||!n.trim()?.6:1,cursor:a||!n.trim()?"not-allowed":"pointer"},children:a?"Sending...":"Send Feedback"})]})]})}):null}var q={container:{fontFamily:"system-ui, -apple-system, sans-serif",maxWidth:"800px"},searchInput:{width:"100%",padding:"12px 16px",border:"1px solid #e0e0e0",borderRadius:"8px",fontSize:"15px",marginBottom:"24px",boxSizing:"border-box"},categoryButton:{padding:"8px 16px",border:"1px solid #e0e0e0",borderRadius:"20px",cursor:"pointer",fontSize:"13px",backgroundColor:"white",transition:"all 0.2s",marginRight:"8px",marginBottom:"8px"},articleCard:{padding:"20px",border:"1px solid #e0e0e0",borderRadius:"8px",marginBottom:"12px",cursor:"pointer",transition:"box-shadow 0.2s, border-color 0.2s",backgroundColor:"white"},articleTitle:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"600"},articleDescription:{margin:0,fontSize:"14px",color:"#666",lineHeight:1.5},articleMeta:{display:"flex",gap:"16px",marginTop:"12px",fontSize:"12px",color:"#999"},backButton:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 0",border:"none",background:"none",cursor:"pointer",fontSize:"14px",color:"#666",marginBottom:"16px"},articleContent:{lineHeight:1.7,fontSize:"15px"},loading:{textAlign:"center",padding:"40px",color:"#666"},error:{padding:"20px",backgroundColor:"#fef2f2",borderRadius:"8px",color:"#b91c1c",textAlign:"center"},empty:{textAlign:"center",padding:"40px",color:"#666"}};function Ut(o){return {primaryColor:o.primaryColor||"#000000",textColor:o.textColor||"#333333",backgroundColor:o.backgroundColor||"#ffffff",borderRadius:o.borderRadius||"8px",fontFamily:o.fontFamily||"system-ui, -apple-system, sans-serif"}}function Nt({showSearch:o=true,showCategories:e=true,defaultCategory:t,theme:r,className:i,onArticleView:n}){let{theme:s}=O(),[p,a]=react.useState(""),[l,d]=react.useState(t),[c,f]=react.useState(null),g={...s,...r},u=Ut(g),{articles:R,isLoading:S,error:h}=ue({category:l,search:p||void 0}),{article:w,isLoading:b,error:C}=fe(c||""),E=react.useMemo(()=>{let m=new Set;return R.forEach(L=>{L.category&&m.add(L.category);}),Array.from(m).sort()},[R]),k=m=>{f(m.slug),n?.(m);},_=()=>{f(null);};return c?b?jsxRuntime.jsx("div",{style:{...q.container,fontFamily:u.fontFamily},className:i,children:jsxRuntime.jsx("div",{style:q.loading,children:"Loading article..."})}):C?jsxRuntime.jsxs("div",{style:{...q.container,fontFamily:u.fontFamily},className:i,children:[jsxRuntime.jsx("button",{onClick:_,style:q.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsx("div",{style:q.error,children:"Failed to load article. Please try again."})]}):w?jsxRuntime.jsxs("div",{style:{...q.container,fontFamily:u.fontFamily},className:i,children:[jsxRuntime.jsx("button",{onClick:_,style:q.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsxs("article",{children:[jsxRuntime.jsx("h1",{style:{margin:"0 0 16px 0",color:u.textColor},children:w.title}),w.read_time_minutes&&jsxRuntime.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"24px"},children:[w.read_time_minutes," min read"]}),w.content_html?jsxRuntime.jsx("div",{style:{...q.articleContent,color:u.textColor},dangerouslySetInnerHTML:{__html:w.content_html}}):jsxRuntime.jsx("div",{style:{...q.articleContent,color:u.textColor},children:typeof w.content=="string"?w.content:"No content available."})]})]}):jsxRuntime.jsxs("div",{style:{...q.container,fontFamily:u.fontFamily},className:i,children:[jsxRuntime.jsx("button",{onClick:_,style:q.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsx("div",{style:q.empty,children:"Article not found."})]}):jsxRuntime.jsxs("div",{style:{...q.container,fontFamily:u.fontFamily},className:i,children:[o&&jsxRuntime.jsx("input",{type:"text",placeholder:"Search articles...",value:p,onChange:m=>a(m.target.value),style:q.searchInput}),e&&E.length>0&&jsxRuntime.jsxs("div",{style:{marginBottom:"24px"},children:[jsxRuntime.jsx("button",{onClick:()=>d(void 0),style:{...q.categoryButton,backgroundColor:l?"white":u.primaryColor,color:l?u.textColor:"white",borderColor:l?"#e0e0e0":u.primaryColor},children:"All"}),E.map(m=>jsxRuntime.jsx("button",{onClick:()=>d(m),style:{...q.categoryButton,backgroundColor:l===m?u.primaryColor:"white",color:l===m?"white":u.textColor,borderColor:l===m?u.primaryColor:"#e0e0e0"},children:m},m))]}),S&&jsxRuntime.jsx("div",{style:q.loading,children:"Loading articles..."}),h&&jsxRuntime.jsx("div",{style:q.error,children:"Failed to load articles. Please try again."}),!S&&!h&&R.length===0&&jsxRuntime.jsx("div",{style:q.empty,children:p?`No articles found for "${p}"`:"No articles available yet."}),!S&&!h&&R.length>0&&jsxRuntime.jsx("div",{children:R.map(m=>jsxRuntime.jsxs("div",{onClick:()=>k(m),style:q.articleCard,role:"button",tabIndex:0,onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&k(m);},children:[jsxRuntime.jsx("h3",{style:{...q.articleTitle,color:u.textColor},children:m.title}),m.seo_description&&jsxRuntime.jsx("p",{style:q.articleDescription,children:m.seo_description}),jsxRuntime.jsxs("div",{style:q.articleMeta,children:[m.category&&jsxRuntime.jsx("span",{children:m.category}),m.read_time_minutes&&jsxRuntime.jsxs("span",{children:[m.read_time_minutes," min read"]})]})]},m.id))})]})}var K={container:{fontFamily:"system-ui, -apple-system, sans-serif"},list:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"12px"},card:{border:"1px solid #e5e7eb",borderRadius:"8px",padding:"16px",backgroundColor:"#ffffff",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s"},cardHover:{borderColor:"#d1d5db",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",marginBottom:"8px"},badges:{display:"flex",alignItems:"center",gap:"6px"},badge:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"9999px",fontSize:"12px",fontWeight:500},message:{fontSize:"14px",color:"#111827",margin:0,lineHeight:1.5},meta:{display:"flex",gap:"12px",marginTop:"8px",fontSize:"12px",color:"#6b7280"},empty:{textAlign:"center",padding:"32px 16px",color:"#6b7280"},emptyIcon:{width:"48px",height:"48px",margin:"0 auto 12px",color:"#d1d5db"},loading:{textAlign:"center",padding:"24px",color:"#6b7280"},error:{textAlign:"center",padding:"24px",color:"#dc2626"}},tt={feedback:{label:"Feedback",color:"#2563eb",bg:"#dbeafe"},bug_report:{label:"Bug Report",color:"#dc2626",bg:"#fee2e2"},feature_request:{label:"Feature Request",color:"#d97706",bg:"#fef3c7"},article_rating:{label:"Article Rating",color:"#7c3aed",bg:"#ede9fe"}},ot={new:{label:"New",color:"#6b7280",bg:"#f3f4f6"},reviewed:{label:"Reviewed",color:"#2563eb",bg:"#dbeafe"},in_progress:{label:"In Progress",color:"#d97706",bg:"#fef3c7"},resolved:{label:"Resolved",color:"#059669",bg:"#d1fae5"},closed:{label:"Closed",color:"#6b7280",bg:"#f3f4f6"}};function Ht(o){return new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function Vt({status:o,type:e,limit:t=50,className:r,showEmptyState:i=true,onRequestClick:n}){let{isIdentified:s}=O(),[p,a]=react.useState(null),{requests:l,isLoading:d,error:c,refetch:f}=ne({status:o,type:e,limit:t}),g=react.useCallback(u=>{n?.(u);},[n]);return s?d?jsxRuntime.jsx("div",{style:K.loading,children:jsxRuntime.jsx("p",{children:"Loading requests..."})}):c?jsxRuntime.jsx("div",{style:K.error,children:jsxRuntime.jsxs("p",{children:["Failed to load requests. ",jsxRuntime.jsx("button",{onClick:f,style:{color:"inherit",textDecoration:"underline",background:"none",border:"none",cursor:"pointer"},children:"Try again"})]})}):l.length===0&&i?jsxRuntime.jsxs("div",{style:K.empty,children:[jsxRuntime.jsx("svg",{style:K.emptyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})}),jsxRuntime.jsx("p",{style:{margin:0,fontWeight:500,color:"#111827"},children:"No requests yet"}),jsxRuntime.jsx("p",{style:{margin:"8px 0 0",fontSize:"14px"},children:"When you submit feedback, bug reports, or feature requests, they'll appear here."})]}):jsxRuntime.jsx("div",{style:K.container,className:r,children:jsxRuntime.jsx("ul",{style:K.list,children:l.map(u=>{let R=tt[u.feedback_type]||tt.feedback,S=ot[u.status]||ot.new,h=p===u.id;return jsxRuntime.jsxs("li",{style:{...K.card,...h?K.cardHover:{}},onMouseEnter:()=>a(u.id),onMouseLeave:()=>a(null),onClick:()=>g(u),role:"button",tabIndex:0,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&g(u);},children:[jsxRuntime.jsx("div",{style:K.header,children:jsxRuntime.jsxs("div",{style:K.badges,children:[jsxRuntime.jsx("span",{style:{...K.badge,color:R.color,backgroundColor:R.bg},children:R.label}),jsxRuntime.jsx("span",{style:{...K.badge,color:S.color,backgroundColor:S.bg},children:S.label})]})}),jsxRuntime.jsx("p",{style:K.message,children:u.message||"No message provided"}),jsxRuntime.jsxs("div",{style:K.meta,children:[jsxRuntime.jsx("span",{children:Ht(u.created_at)}),u.page_url&&jsxRuntime.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"},children:["From: ",u.page_url]})]})]},u.id)})})}):i?jsxRuntime.jsx("div",{style:K.empty,children:jsxRuntime.jsx("p",{children:"Please sign in to view your requests."})}):null}var x={container:{fontFamily:"system-ui, -apple-system, sans-serif",display:"flex",minHeight:"400px"},sidebar:{width:"240px",flexShrink:0,borderRight:"1px solid #e5e7eb",paddingRight:"16px",marginRight:"24px"},sidebarSection:{marginBottom:"24px"},sidebarLabel:{fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"#6b7280",marginBottom:"8px",paddingLeft:"8px"},sidebarItem:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",borderRadius:"6px",cursor:"pointer",fontSize:"14px",color:"#374151",transition:"background-color 0.15s, color 0.15s",border:"none",background:"none",width:"100%",textAlign:"left"},sidebarItemActive:{backgroundColor:"#f3f4f6",color:"#111827",fontWeight:500},sidebarFeature:{padding:"6px 12px 6px 32px",fontSize:"13px"},sidebarBadge:{marginLeft:"auto",padding:"2px 6px",borderRadius:"9999px",fontSize:"11px",fontWeight:500,backgroundColor:"#e5e7eb",color:"#374151"},main:{flex:1,minWidth:0},tabs:{display:"flex",gap:"4px",marginBottom:"24px",borderBottom:"1px solid #e5e7eb"},tab:{padding:"12px 20px",border:"none",background:"none",cursor:"pointer",fontSize:"14px",fontWeight:500,color:"#6b7280",borderBottom:"2px solid transparent",marginBottom:"-1px",transition:"color 0.15s, border-color 0.15s"},tabActive:{color:"#111827",borderBottomColor:"#111827"},tabBadge:{marginLeft:"6px",padding:"2px 6px",borderRadius:"9999px",fontSize:"11px",fontWeight:600,backgroundColor:"#e5e7eb",color:"#374151"},groupCardsGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"16px",marginBottom:"24px"},groupCard:{padding:"20px",border:"1px solid #e5e7eb",borderRadius:"12px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s",backgroundColor:"white"},groupCardName:{fontSize:"16px",fontWeight:600,color:"#111827",margin:0},groupCardMeta:{fontSize:"13px",color:"#6b7280",marginTop:"4px"},searchInput:{width:"100%",padding:"10px 14px",border:"1px solid #e5e7eb",borderRadius:"8px",fontSize:"14px",marginBottom:"20px",boxSizing:"border-box"},articleCard:{padding:"16px",border:"1px solid #e5e7eb",borderRadius:"10px",marginBottom:"12px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s",backgroundColor:"white"},articleTitle:{margin:"0 0 6px 0",fontSize:"15px",fontWeight:600},articleDescription:{margin:0,fontSize:"14px",color:"#6b7280",lineHeight:1.5},articleMeta:{display:"flex",gap:"12px",marginTop:"10px",fontSize:"12px",color:"#9ca3af"},backButton:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 0",border:"none",background:"none",cursor:"pointer",fontSize:"14px",color:"#6b7280",marginBottom:"16px"},articleContent:{lineHeight:1.7,fontSize:"15px"},requestCard:{border:"1px solid #e5e7eb",borderRadius:"10px",padding:"16px",backgroundColor:"#ffffff",marginBottom:"12px",transition:"border-color 0.15s"},requestHeader:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"8px"},badge:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:"9999px",fontSize:"12px",fontWeight:500},requestMessage:{fontSize:"14px",color:"#111827",margin:0,lineHeight:1.5},requestMeta:{display:"flex",gap:"12px",marginTop:"10px",fontSize:"12px",color:"#9ca3af"},sectionHeader:{marginBottom:"16px"},sectionTitle:{fontSize:"18px",fontWeight:600,color:"#111827",margin:"0 0 4px 0"},sectionDescription:{fontSize:"14px",color:"#6b7280",margin:0},loading:{textAlign:"center",padding:"40px",color:"#6b7280"},error:{padding:"20px",backgroundColor:"#fef2f2",borderRadius:"10px",color:"#b91c1c",textAlign:"center"},empty:{textAlign:"center",padding:"48px 24px",color:"#6b7280"},emptyIcon:{width:"48px",height:"48px",margin:"0 auto 16px",color:"#d1d5db"}},rt={feedback:{label:"Feedback",color:"#2563eb",bg:"#dbeafe"},bug_report:{label:"Bug",color:"#dc2626",bg:"#fee2e2"},feature_request:{label:"Feature",color:"#d97706",bg:"#fef3c7"},article_rating:{label:"Rating",color:"#7c3aed",bg:"#ede9fe"}},nt={new:{label:"New",color:"#6b7280",bg:"#f3f4f6"},planned:{label:"Planned",color:"#2563eb",bg:"#dbeafe"},in_progress:{label:"In Progress",color:"#d97706",bg:"#fef3c7"},resolved:{label:"Resolved",color:"#059669",bg:"#d1fae5"},closed:{label:"Closed",color:"#6b7280",bg:"#f3f4f6"}};function Kt(o){return new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function jt(o){return {primaryColor:o.primaryColor||"#111827",textColor:o.textColor||"#111827",backgroundColor:o.backgroundColor||"#ffffff",borderRadius:o.borderRadius||"10px",fontFamily:o.fontFamily||"system-ui, -apple-system, sans-serif"}}var Xt={articles:"Articles",requests:"My Requests"};function Yt({group:o,onClick:e}){return jsxRuntime.jsxs("div",{style:x.groupCard,onClick:e,role:"button",tabIndex:0,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&e();},children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{style:x.groupCardName,children:o.name}),jsxRuntime.jsxs("p",{style:x.groupCardMeta,children:[o.feature_count," feature",o.feature_count!==1?"s":""," \xB7 ",o.article_count," article",o.article_count!==1?"s":""]})]}),o.description&&jsxRuntime.jsx("p",{style:{...x.articleDescription,marginTop:"8px"},children:o.description})]})}function it({featureId:o,featureName:e,showSearch:t,themeStyles:r,onArticleView:i,onBack:n}){let[s,p]=react.useState(""),[a,l]=react.useState(null),{articles:d,isLoading:c,error:f}=ue({search:s||void 0}),{article:g,isLoading:u,error:R}=fe(a||""),S=react.useMemo(()=>o?d.filter(b=>b.features?.id===o):d,[d,o]),h=b=>{l(b.slug),i?.(b);},w=()=>{l(null);};return a?u?jsxRuntime.jsx("div",{style:x.loading,children:"Loading article..."}):R?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:w,style:x.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsx("div",{style:x.error,children:"Failed to load article."})]}):g?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:w,style:x.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsxs("article",{children:[jsxRuntime.jsx("h1",{style:{margin:"0 0 12px 0",fontSize:"24px",color:r.textColor},children:g.title}),g.read_time_minutes&&jsxRuntime.jsxs("div",{style:{fontSize:"14px",color:"#6b7280",marginBottom:"24px"},children:[g.read_time_minutes," min read"]}),g.content_html?jsxRuntime.jsx("div",{style:{...x.articleContent,color:r.textColor},dangerouslySetInnerHTML:{__html:g.content_html}}):jsxRuntime.jsx("div",{style:{...x.articleContent,color:r.textColor},children:typeof g.content=="string"?g.content:"No content available."})]})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:w,style:x.backButton,children:"\u2190 Back to articles"}),jsxRuntime.jsx("div",{style:x.empty,children:"Article not found."})]}):jsxRuntime.jsxs("div",{children:[e&&n&&jsxRuntime.jsxs("div",{style:x.sectionHeader,children:[jsxRuntime.jsx("button",{onClick:n,style:x.backButton,children:"\u2190 Back to features"}),jsxRuntime.jsx("h2",{style:x.sectionTitle,children:e}),jsxRuntime.jsx("p",{style:x.sectionDescription,children:"Documentation and guides for this feature"})]}),t&&jsxRuntime.jsx("input",{type:"text",placeholder:"Search articles...",value:s,onChange:b=>p(b.target.value),style:x.searchInput}),c&&jsxRuntime.jsx("div",{style:x.loading,children:"Loading articles..."}),f&&jsxRuntime.jsx("div",{style:x.error,children:"Failed to load articles. Please try again."}),!c&&!f&&S.length===0&&jsxRuntime.jsxs("div",{style:x.empty,children:[jsxRuntime.jsx("svg",{style:x.emptyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),jsxRuntime.jsx("p",{style:{margin:0,fontWeight:500,color:"#111827"},children:s?`No articles found for "${s}"`:"No articles yet"}),jsxRuntime.jsx("p",{style:{margin:"8px 0 0",fontSize:"14px"},children:"Check back soon for helpful content."})]}),!c&&!f&&S.length>0&&jsxRuntime.jsx("div",{children:S.map(b=>jsxRuntime.jsxs("div",{onClick:()=>h(b),style:x.articleCard,role:"button",tabIndex:0,onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&h(b);},children:[jsxRuntime.jsx("h3",{style:{...x.articleTitle,color:r.textColor},children:b.title}),b.seo_description&&jsxRuntime.jsx("p",{style:x.articleDescription,children:b.seo_description}),jsxRuntime.jsxs("div",{style:x.articleMeta,children:[b.category&&jsxRuntime.jsx("span",{children:b.category}),b.read_time_minutes&&jsxRuntime.jsxs("span",{children:[b.read_time_minutes," min read"]})]})]},b.id))})]})}function Qt({onRequestClick:o}){let{isIdentified:e}=O(),{requests:t,isLoading:r,error:i,refetch:n}=ne({limit:50});return e?r?jsxRuntime.jsx("div",{style:x.loading,children:"Loading requests..."}):i?jsxRuntime.jsx("div",{style:x.error,children:jsxRuntime.jsxs("p",{children:["Failed to load requests."," ",jsxRuntime.jsx("button",{onClick:n,style:{color:"inherit",textDecoration:"underline",background:"none",border:"none",cursor:"pointer"},children:"Try again"})]})}):t.length===0?jsxRuntime.jsxs("div",{style:x.empty,children:[jsxRuntime.jsx("svg",{style:x.emptyIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})}),jsxRuntime.jsx("p",{style:{margin:0,fontWeight:500,color:"#111827"},children:"No requests yet"}),jsxRuntime.jsx("p",{style:{margin:"8px 0 0",fontSize:"14px"},children:"When you submit feedback, bug reports, or feature requests, they'll appear here."})]}):jsxRuntime.jsx("div",{children:t.map(s=>{let p=rt[s.feedback_type]||rt.feedback,a=nt[s.status]||nt.new;return jsxRuntime.jsxs("div",{style:x.requestCard,onClick:()=>o?.(s),role:o?"button":void 0,tabIndex:o?0:void 0,onKeyDown:o?l=>{(l.key==="Enter"||l.key===" ")&&o(s);}:void 0,children:[jsxRuntime.jsxs("div",{style:x.requestHeader,children:[jsxRuntime.jsx("span",{style:{...x.badge,color:p.color,backgroundColor:p.bg},children:p.label}),jsxRuntime.jsx("span",{style:{...x.badge,color:a.color,backgroundColor:a.bg},children:a.label}),s.feature_group&&jsxRuntime.jsx("span",{style:{...x.badge,color:s.feature_group.color||"#6b7280",backgroundColor:s.feature_group.color?`${s.feature_group.color}20`:"#f3f4f6",border:`1px solid ${s.feature_group.color||"#e5e7eb"}`},children:s.feature_group.name}),s.feature&&jsxRuntime.jsx("span",{style:{...x.badge,color:"#374151",backgroundColor:"#f3f4f6",border:"1px solid #e5e7eb"},children:s.feature.name})]}),jsxRuntime.jsx("p",{style:x.requestMessage,children:s.message||"No message provided"}),jsxRuntime.jsxs("div",{style:x.requestMeta,children:[jsxRuntime.jsx("span",{children:Kt(s.created_at)}),s.page_url&&jsxRuntime.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"},children:["From: ",s.page_url]})]})]},s.id)})}):jsxRuntime.jsxs("div",{style:x.empty,children:[jsxRuntime.jsx("p",{style:{margin:0,fontWeight:500,color:"#111827"},children:"Sign in required"}),jsxRuntime.jsx("p",{style:{margin:"8px 0 0",fontSize:"14px"},children:"Please sign in to view your requests."})]})}function Jt({tabs:o=["articles","requests"],defaultTab:e,tabLabels:t,showSearch:r=true,showCategories:i=true,theme:n,className:s,onArticleView:p,onRequestClick:a,onTabChange:l}){let{theme:d}=O(),c={...d,...n},f=jt(c),g=e&&o.includes(e)?e:o[0],[u,R]=react.useState(g),[S,h]=react.useState(null),[w,b]=react.useState(null),{featureGroups:C,isLoading:E}=qe(),{requests:k}=ne({limit:100}),_=k.filter(P=>["new","planned","in_progress"].includes(P.status)).length,m={...Xt,...t},L=react.useMemo(()=>C.find(P=>P.id===S)||null,[C,S]),U=P=>{R(P),h(null),b(null),l?.(P);},j=P=>{h(P.id),b(null);},T=P=>{b(P);},G=()=>{h(null),b(null);},y=()=>{b(null);},N=o.length>1;return jsxRuntime.jsxs("div",{style:{...x.container,fontFamily:f.fontFamily},className:s,children:[u==="articles"&&C.length>0&&jsxRuntime.jsxs("div",{style:x.sidebar,children:[jsxRuntime.jsxs("div",{style:x.sidebarSection,children:[jsxRuntime.jsx("div",{style:x.sidebarLabel,children:"Resources"}),jsxRuntime.jsxs("button",{style:{...x.sidebarItem,...S?{}:x.sidebarItemActive},onClick:G,children:[jsxRuntime.jsx("span",{children:"\u{1F3E0}"}),jsxRuntime.jsx("span",{children:"All Features"})]})]}),jsxRuntime.jsxs("div",{style:x.sidebarSection,children:[jsxRuntime.jsx("div",{style:x.sidebarLabel,children:"Features"}),E?jsxRuntime.jsx("div",{style:{padding:"8px 12px",fontSize:"13px",color:"#6b7280"},children:"Loading..."}):C.map(P=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{style:{...x.sidebarItem,...S===P.id?x.sidebarItemActive:{}},onClick:()=>j(P),children:[jsxRuntime.jsx("span",{style:{flex:1},children:P.name}),jsxRuntime.jsx("span",{style:x.sidebarBadge,children:P.feature_count})]}),S===P.id&&jsxRuntime.jsx("div",{children:P.features.map(D=>jsxRuntime.jsxs("button",{style:{...x.sidebarItem,...x.sidebarFeature,...w?.id===D.id?x.sidebarItemActive:{}},onClick:()=>T(D),children:[D.name,D.article_count>0&&jsxRuntime.jsx("span",{style:x.sidebarBadge,children:D.article_count})]},D.id))})]},P.id))]})]}),jsxRuntime.jsxs("div",{style:x.main,children:[N&&jsxRuntime.jsx("div",{style:x.tabs,children:o.map(P=>jsxRuntime.jsxs("button",{onClick:()=>U(P),style:{...x.tab,...u===P?x.tabActive:{},...u===P?{borderBottomColor:f.primaryColor,color:f.primaryColor}:{}},children:[m[P],P==="requests"&&_>0&&jsxRuntime.jsx("span",{style:x.tabBadge,children:_})]},P))}),u==="articles"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!S&&!w&&C.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{style:x.sectionHeader,children:[jsxRuntime.jsx("h2",{style:x.sectionTitle,children:"Browse by Feature"}),jsxRuntime.jsx("p",{style:x.sectionDescription,children:"Select a feature group to find relevant documentation"})]}),jsxRuntime.jsx("div",{style:x.groupCardsGrid,children:C.map(P=>jsxRuntime.jsx(Yt,{group:P,onClick:()=>j(P)},P.id))})]}),L&&!w&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{style:x.sectionHeader,children:[jsxRuntime.jsx("button",{onClick:G,style:x.backButton,children:"\u2190 Back to all features"}),jsxRuntime.jsx("h2",{style:x.sectionTitle,children:L.name}),L.description&&jsxRuntime.jsx("p",{style:x.sectionDescription,children:L.description})]}),jsxRuntime.jsx("div",{style:x.groupCardsGrid,children:L.features.map(P=>jsxRuntime.jsxs("div",{style:x.groupCard,onClick:()=>T(P),role:"button",tabIndex:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&T(P);},children:[jsxRuntime.jsx("h3",{style:x.groupCardName,children:P.name}),jsxRuntime.jsxs("p",{style:x.groupCardMeta,children:[P.article_count," article",P.article_count!==1?"s":""]}),P.description&&jsxRuntime.jsx("p",{style:{...x.articleDescription,marginTop:"8px"},children:P.description})]},P.id))})]}),w&&jsxRuntime.jsx(it,{featureId:w.id,featureName:w.name,showSearch:r,themeStyles:f,onArticleView:p,onBack:y}),C.length===0&&jsxRuntime.jsx(it,{showSearch:r,themeStyles:f,onArticleView:p})]}),u==="requests"&&jsxRuntime.jsx(Qt,{onRequestClick:a})]})]})}var at={tooltip:"Tooltip",modal:"Modal",slideout:"Slideout",hotspot:"Hotspot",banner:"Banner"},to={tooltip:"Points to a specific element with an arrow",modal:"Centered overlay that grabs attention",slideout:"Slides in from the side of the screen",hotspot:"Pulsing beacon that expands on click",banner:"Top or bottom bar announcement"},oo=[{value:"auto",label:"Auto"},{value:"top",label:"Top"},{value:"bottom",label:"Bottom"},{value:"left",label:"Left"},{value:"right",label:"Right"}],ro=[{value:"button",label:"Button click"},{value:"click",label:"Click anywhere"},{value:"delay",label:"After delay"},{value:"form-submit",label:"Form submit"}];function lt({step:o,onUpdate:e,onSelectElement:t,isSelectingElement:r}){let[i,n]=react.useState(false),[s,p]=react.useState(o.step_type),[a,l]=react.useState(o.rich_content?.title||o.title||""),[d,c]=react.useState(o.rich_content?.body||o.content||""),[f,g]=react.useState(o.tooltip_position||o.display_config?.position||"auto"),[u,R]=react.useState(o.selector_strategy?.css||""),[S,h]=react.useState(o.display_config?.backdrop!==false),[w,b]=react.useState(o.advance_config?.trigger||"button"),[C,E]=react.useState(o.advance_config?.delay||3e3),k=react.useCallback(async()=>{n(true);try{let m=u?{css:u}:void 0,L={title:a||void 0,body:d||void 0},U={position:f!=="auto"?f:void 0,backdrop:S},j={trigger:w,delay:w==="delay"?C:void 0};await e(o.id,{stepType:s,selectorStrategy:m,richContent:L,displayConfig:U,advanceConfig:j,tooltipPosition:f});}finally{n(false);}},[o.id,s,a,d,f,u,S,w,C,e]),_=s==="tooltip"||s==="hotspot";return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[jsxRuntime.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid #e5e7eb",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx("span",{style:{fontWeight:500},children:"Edit Step"}),jsxRuntime.jsx("button",{onClick:k,disabled:i,style:{padding:"6px 12px",fontSize:"13px",border:"none",borderRadius:"4px",backgroundColor:"#2563eb",color:"white",cursor:i?"wait":"pointer",opacity:i?.7:1},children:i?"Saving...":"Save Changes"})]}),jsxRuntime.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:[jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Step Type"}),jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"8px"},children:Object.keys(at).map(m=>jsxRuntime.jsxs("button",{onClick:()=>p(m),style:{padding:"10px",border:`2px solid ${s===m?"#2563eb":"#e5e7eb"}`,borderRadius:"6px",backgroundColor:s===m?"#eff6ff":"white",cursor:"pointer",textAlign:"left"},children:[jsxRuntime.jsx("div",{style:{fontWeight:500,fontSize:"13px"},children:at[m]}),jsxRuntime.jsx("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:to[m]})]},m))})]}),_&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Target Element"}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"8px"},children:[jsxRuntime.jsx("input",{type:"text",value:u,onChange:m=>R(m.target.value),placeholder:"CSS selector (e.g., #my-button)",style:{flex:1,padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",fontFamily:"monospace"}}),jsxRuntime.jsx("button",{onClick:t,disabled:r,style:{padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:r?"#f3f4f6":"white",cursor:r?"wait":"pointer"},children:r?"Selecting...":"Select"})]}),jsxRuntime.jsx("p",{style:{fontSize:"11px",color:"#6b7280",marginTop:"4px"},children:'Click "Select" to pick an element on the page, or enter a CSS selector manually'})]}),jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Title"}),jsxRuntime.jsx("input",{type:"text",value:a,onChange:m=>l(m.target.value),placeholder:"Enter step title",style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px"}})]}),jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Content"}),jsxRuntime.jsx("textarea",{value:d,onChange:m=>c(m.target.value),placeholder:"Enter step content (HTML supported)",rows:4,style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",resize:"vertical",fontFamily:"inherit"}})]}),(s==="tooltip"||s==="hotspot")&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Position"}),jsxRuntime.jsx("select",{value:f,onChange:m=>g(m.target.value),style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white"},children:oo.map(m=>jsxRuntime.jsx("option",{value:m.value,children:m.label},m.value))})]}),s==="banner"&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Banner Position"}),jsxRuntime.jsxs("select",{value:f==="bottom"?"bottom":"top",onChange:m=>g(m.target.value),style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white"},children:[jsxRuntime.jsx("option",{value:"top",children:"Top"}),jsxRuntime.jsx("option",{value:"bottom",children:"Bottom"})]})]}),s==="slideout"&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Slideout Side"}),jsxRuntime.jsxs("select",{value:f==="left"?"left":"right",onChange:m=>g(m.target.value),style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white"},children:[jsxRuntime.jsx("option",{value:"right",children:"Right"}),jsxRuntime.jsx("option",{value:"left",children:"Left"})]})]}),(s==="tooltip"||s==="modal")&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[jsxRuntime.jsx("input",{type:"checkbox",checked:S,onChange:m=>h(m.target.checked),style:{width:"16px",height:"16px"}}),jsxRuntime.jsx("span",{style:{fontSize:"13px",fontWeight:500},children:"Show backdrop overlay"})]}),jsxRuntime.jsx("p",{style:{fontSize:"11px",color:"#6b7280",marginTop:"4px",marginLeft:"24px"},children:"Dims the background to focus attention on the step"})]}),jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Advance When"}),jsxRuntime.jsx("select",{value:w,onChange:m=>b(m.target.value),style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white"},children:ro.map(m=>jsxRuntime.jsx("option",{value:m.value,children:m.label},m.value))})]}),w==="delay"&&jsxRuntime.jsxs("div",{style:{marginBottom:"20px"},children:[jsxRuntime.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500},children:"Delay (seconds)"}),jsxRuntime.jsx("input",{type:"number",value:C/1e3,onChange:m=>E(Number(m.target.value)*1e3),min:1,max:60,style:{width:"100%",padding:"8px 12px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"6px"}})]})]})]})}function io(o){let e={},t=o.getAttribute("data-testid");if(t)return e.testId=t,e.css=`[data-testid="${t}"]`,e;if(o.id)return e.css=`#${CSS.escape(o.id)}`,e;let r=[],i=o,n=0,s=5;for(;i&&i!==document.body&&n<s;){let a=i.tagName.toLowerCase(),l=Array.from(i.classList).filter(f=>!f.startsWith("hover")&&!f.startsWith("focus")&&!f.startsWith("active")).slice(0,2);l.length>0&&(a+="."+l.map(f=>CSS.escape(f)).join("."));let d=i.parentElement;if(d){let f=Array.from(d.children).filter(g=>g.tagName===i.tagName);if(f.length>1){let g=f.indexOf(i)+1;a+=`:nth-of-type(${g})`;}}r.unshift(a);let c=r.join(" > ");try{if(document.querySelectorAll(c).length===1){e.css=c;break}}catch{}i=i.parentElement,n++;}!e.css&&r.length>0&&(e.css=r.join(" > "));let p=o.textContent?.trim();return p&&p.length<100&&p.length>2&&(e.text=p.slice(0,50)),e}function so(o){let e=0;if(o.css)try{e=document.querySelectorAll(o.css).length;}catch{}return o.testId&&(e=document.querySelectorAll(`[data-testid="${o.testId}"]`).length),{isUnique:e===1,count:e}}function pt({isActive:o,onSelect:e,onCancel:t,ignoreSelector:r="[data-census-builder]",zIndex:i=99999}){let[n,s]=react.useState(null),[p,a]=react.useState(null),[l,d]=react.useState(null),c=react.useRef(null),f=react.useCallback(()=>{if(!n){a(null);return}a(n.getBoundingClientRect());},[n]);react.useEffect(()=>{if(!o)return;let R=h=>{let b=document.elementsFromPoint(h.clientX,h.clientY).find(C=>!(c.current?.contains(C)||r&&C.closest(r)||C===document.body||C===document.documentElement));b!==n&&(s(b||null),d(b?io(b):null));},S=()=>{f();};return document.addEventListener("mousemove",R,true),window.addEventListener("scroll",S,true),window.addEventListener("resize",S),()=>{document.removeEventListener("mousemove",R,true),window.removeEventListener("scroll",S,true),window.removeEventListener("resize",S);}},[o,n,r,f]),react.useEffect(()=>{f();},[n,f]);let g=react.useCallback(R=>{R.preventDefault(),R.stopPropagation(),n&&l&&e(l,n);},[n,l,e]);if(react.useEffect(()=>{if(!o)return;let R=S=>{S.key==="Escape"&&t();};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[o,t]),!o)return null;let u=l?so(l):null;return jsxRuntime.jsxs("div",{ref:c,"data-census-builder":true,style:{position:"fixed",inset:0,zIndex:i,cursor:"crosshair"},onClick:g,children:[p&&jsxRuntime.jsx("div",{style:{position:"fixed",top:p.top,left:p.left,width:p.width,height:p.height,border:"2px solid #2563eb",borderRadius:"4px",backgroundColor:"rgba(37, 99, 235, 0.1)",pointerEvents:"none",transition:"all 0.1s ease-out"}}),p&&l&&jsxRuntime.jsxs("div",{style:{position:"fixed",top:Math.max(8,p.top-40),left:p.left,padding:"6px 10px",backgroundColor:"#1f2937",color:"white",fontSize:"12px",fontFamily:"monospace",borderRadius:"4px",maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},children:[jsxRuntime.jsx("span",{style:{color:"#9ca3af"},children:l.testId?"data-testid: ":""}),l.testId||l.css,u&&jsxRuntime.jsxs("span",{style:{marginLeft:"8px",color:u.isUnique?"#4ade80":"#fbbf24"},children:["(",u.count," match",u.count!==1?"es":"",")"]})]}),jsxRuntime.jsxs("div",{style:{position:"fixed",bottom:0,left:0,right:0,padding:"12px 20px",backgroundColor:"#1f2937",color:"white",display:"flex",alignItems:"center",justifyContent:"space-between",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px"},children:[jsxRuntime.jsxs("span",{children:["Click on any element to select it, or press ",jsxRuntime.jsx("kbd",{style:{padding:"2px 6px",backgroundColor:"#374151",borderRadius:"4px",marginLeft:"4px",marginRight:"4px"},children:"Esc"})," to cancel"]}),jsxRuntime.jsx("button",{onClick:R=>{R.stopPropagation(),t();},style:{padding:"6px 12px",border:"1px solid #4b5563",borderRadius:"4px",backgroundColor:"transparent",color:"white",cursor:"pointer"},children:"Cancel"})]})]})}function ao({isOpen:o,onClose:e,guideId:t,onSave:r,onPublish:i,trigger:n,className:s}){let[p,a]=react.useState(false),l=o??p,{guide:d,steps:c,selectedStep:f,selectedStepId:g,isLoading:u,isSaving:R,error:S,loadGuide:h,updateGuide:w,publishGuide:b,addStep:C,updateStep:E,deleteStep:k,moveStepUp:_,moveStepDown:m,setSelectedStepId:L,reset:U}=Oe(),j=react.useCallback(async()=>{a(true),t&&await h(t);},[t,h]),T=react.useCallback(()=>{a(false),U(),e?.();},[U,e]),G=react.useCallback(async()=>{if(d)try{await w({}),r?.(d);}catch{}},[d,w,r]),y=react.useCallback(async()=>{if(d)try{let P=await b();i?.(P);}catch{}},[d,b,i]),N=react.useCallback(async(P="tooltip")=>{try{await C({stepType:P,richContent:{title:"New Step",body:"Click to edit..."}});}catch{}},[C]);return n&&o===void 0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{onClick:j,children:n}),l&&jsxRuntime.jsx(ct,{guide:d,steps:c,selectedStep:f,selectedStepId:g,isLoading:u,isSaving:R,error:S,onClose:T,onSave:G,onPublish:y,onAddStep:N,onSelectStep:L,onUpdateStep:E,onDeleteStep:k,onMoveStepUp:_,onMoveStepDown:m,className:s})]}):l?jsxRuntime.jsx(ct,{guide:d,steps:c,selectedStep:f,selectedStepId:g,isLoading:u,isSaving:R,error:S,onClose:T,onSave:G,onPublish:y,onAddStep:N,onSelectStep:L,onUpdateStep:E,onDeleteStep:k,onMoveStepUp:_,onMoveStepDown:m,className:s}):null}function ct({guide:o,steps:e,selectedStep:t,selectedStepId:r,isLoading:i,isSaving:n,error:s,onClose:p,onSave:a,onPublish:l,onAddStep:d,onSelectStep:c,onUpdateStep:f,onDeleteStep:g,onMoveStepUp:u,onMoveStepDown:R,className:S}){let[h,w]=react.useState(false),b={tooltip:"Tooltip",modal:"Modal",slideout:"Slideout",hotspot:"Hotspot",banner:"Banner"},C=react.useCallback((E,k)=>{t&&f(t.id,{selectorStrategy:E}),w(false);},[t,f]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(pt,{isActive:h,onSelect:C,onCancel:()=>w(false),ignoreSelector:"[data-census-builder]"}),jsxRuntime.jsxs("div",{className:S,"data-census-builder":true,style:{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",backgroundColor:"#f8f9fa",fontFamily:"system-ui, -apple-system, sans-serif"},children:[jsxRuntime.jsxs("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 20px",backgroundColor:"white",borderBottom:"1px solid #e5e7eb"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[jsxRuntime.jsx("button",{onClick:p,style:{padding:"8px 12px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white",cursor:"pointer"},children:"Close"}),jsxRuntime.jsx("h1",{style:{margin:0,fontSize:"18px",fontWeight:600},children:o?o.name:"Guide Builder"}),o?.status&&jsxRuntime.jsx("span",{style:{padding:"2px 8px",fontSize:"12px",borderRadius:"4px",backgroundColor:o.status==="published"?"#dcfce7":"#fef3c7",color:o.status==="published"?"#166534":"#92400e"},children:o.status})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"8px"},children:[s&&jsxRuntime.jsx("span",{style:{color:"#dc2626",fontSize:"14px"},children:s.message}),jsxRuntime.jsx("button",{onClick:a,disabled:n||!o,style:{padding:"8px 16px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white",cursor:n?"wait":"pointer",opacity:n?.5:1},children:n?"Saving...":"Save"}),jsxRuntime.jsx("button",{onClick:l,disabled:n||!o||o.status==="published",style:{padding:"8px 16px",border:"none",borderRadius:"6px",backgroundColor:"#2563eb",color:"white",cursor:n?"wait":"pointer",opacity:n||o?.status==="published"?.5:1},children:"Publish"})]})]}),jsxRuntime.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[jsxRuntime.jsxs("aside",{style:{width:"280px",backgroundColor:"white",borderRight:"1px solid #e5e7eb",display:"flex",flexDirection:"column"},children:[jsxRuntime.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid #e5e7eb",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsxs("span",{style:{fontWeight:500},children:["Steps (",e.length,")"]}),jsxRuntime.jsx("button",{onClick:()=>d("tooltip"),disabled:!o,style:{padding:"6px 12px",fontSize:"13px",border:"none",borderRadius:"4px",backgroundColor:"#2563eb",color:"white",cursor:o?"pointer":"not-allowed",opacity:o?1:.5},children:"+ Add Step"})]}),jsxRuntime.jsx("div",{style:{flex:1,overflow:"auto",padding:"8px"},children:i?jsxRuntime.jsx("div",{style:{padding:"20px",textAlign:"center",color:"#6b7280"},children:"Loading..."}):e.length===0?jsxRuntime.jsx("div",{style:{padding:"20px",textAlign:"center",color:"#6b7280"},children:'No steps yet. Click "Add Step" to get started.'}):e.map((E,k)=>jsxRuntime.jsxs("div",{onClick:()=>c(E.id),style:{padding:"12px",marginBottom:"4px",borderRadius:"6px",backgroundColor:r===E.id?"#eff6ff":"white",border:`1px solid ${r===E.id?"#3b82f6":"#e5e7eb"}`,cursor:"pointer"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsxs("span",{style:{fontWeight:500,fontSize:"14px"},children:[k+1,". ",b[E.step_type]]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"4px"},children:[jsxRuntime.jsx("button",{onClick:_=>{_.stopPropagation(),u(E.id);},disabled:k===0,style:{padding:"2px 6px",fontSize:"12px",border:"1px solid #d1d5db",borderRadius:"3px",backgroundColor:"white",cursor:k===0?"not-allowed":"pointer",opacity:k===0?.3:1},children:"Up"}),jsxRuntime.jsx("button",{onClick:_=>{_.stopPropagation(),R(E.id);},disabled:k===e.length-1,style:{padding:"2px 6px",fontSize:"12px",border:"1px solid #d1d5db",borderRadius:"3px",backgroundColor:"white",cursor:k===e.length-1?"not-allowed":"pointer",opacity:k===e.length-1?.3:1},children:"Down"}),jsxRuntime.jsx("button",{onClick:_=>{_.stopPropagation(),confirm("Delete this step?")&&g(E.id);},style:{padding:"2px 6px",fontSize:"12px",border:"1px solid #fecaca",borderRadius:"3px",backgroundColor:"#fef2f2",color:"#dc2626",cursor:"pointer"},children:"Delete"})]})]}),jsxRuntime.jsx("p",{style:{margin:"4px 0 0",fontSize:"13px",color:"#6b7280"},children:E.rich_content?.title||E.title||"Untitled"})]},E.id))})]}),jsxRuntime.jsxs("main",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"#f3f4f6"},children:[jsxRuntime.jsx("div",{style:{padding:"16px",borderBottom:"1px solid #e5e7eb",backgroundColor:"white"},children:jsxRuntime.jsx("span",{style:{fontWeight:500},children:"Preview"})}),jsxRuntime.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"#6b7280"},children:t?jsxRuntime.jsxs("div",{style:{padding:"24px",backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)",maxWidth:"400px",width:"100%"},children:[jsxRuntime.jsx("div",{style:{marginBottom:"12px"},children:jsxRuntime.jsx("span",{style:{padding:"4px 8px",fontSize:"11px",fontWeight:500,borderRadius:"4px",backgroundColor:"#f3f4f6",color:"#6b7280",textTransform:"uppercase"},children:b[t.step_type]})}),jsxRuntime.jsx("h3",{style:{margin:"0 0 8px",fontSize:"16px"},children:t.rich_content?.title||t.title||"Step Preview"}),jsxRuntime.jsx("p",{style:{margin:0,color:"#4b5563"},children:t.rich_content?.body||t.content||"No content"}),t.rich_content?.media&&jsxRuntime.jsx("div",{style:{marginTop:"12px"},children:t.rich_content.media.type==="image"&&jsxRuntime.jsx("img",{src:t.rich_content.media.url,alt:t.rich_content.media.alt||"",style:{maxWidth:"100%",borderRadius:"4px"}})}),t.rich_content?.buttons&&t.rich_content.buttons.length>0&&jsxRuntime.jsx("div",{style:{marginTop:"16px",display:"flex",gap:"8px"},children:t.rich_content.buttons.map((E,k)=>jsxRuntime.jsx("span",{style:{padding:"6px 12px",fontSize:"13px",borderRadius:"4px",backgroundColor:E.style==="primary"?"#2563eb":"#f3f4f6",color:E.style==="primary"?"white":"#374151"},children:E.label},k))}),t.selector_strategy?.css&&jsxRuntime.jsxs("div",{style:{marginTop:"16px",padding:"8px",backgroundColor:"#f9fafb",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace",color:"#6b7280"},children:["Target: ",t.selector_strategy.css]})]}):jsxRuntime.jsx("p",{children:"Select a step to preview"})})]}),jsxRuntime.jsx("aside",{style:{width:"360px",backgroundColor:"white",borderLeft:"1px solid #e5e7eb",display:"flex",flexDirection:"column",overflow:"hidden"},children:t?jsxRuntime.jsx(lt,{step:t,onUpdate:f,onSelectElement:()=>w(true),isSelectingElement:h}):jsxRuntime.jsx("div",{style:{padding:"16px"},children:jsxRuntime.jsx("p",{style:{color:"#6b7280"},children:"Select a step to edit its settings"})})})]})]})]})}function He(o){let e=o.getBoundingClientRect();return {top:e.top+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX,bottom:e.bottom+window.scrollY,width:e.width,height:e.height}}function Ve(){return {width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY}}function $e(o,e,t,r,i){let n=Ve(),{scrollX:s,scrollY:p,width:a,height:l}=n;switch(r){case "top":return o.top-p-t-i>0&&o.left-s+o.width/2-e/2>0&&o.left-s+o.width/2+e/2<a;case "bottom":return o.bottom-p+t+i<l&&o.left-s+o.width/2-e/2>0&&o.left-s+o.width/2+e/2<a;case "left":return o.left-s-e-i>0&&o.top-p+o.height/2-t/2>0&&o.top-p+o.height/2+t/2<l;case "right":return o.right-s+e+i<a&&o.top-p+o.height/2-t/2>0&&o.top-p+o.height/2+t/2<l;default:return true}}function lo(o,e,t,r){let i=["bottom","top","right","left"];for(let n of i)if($e(o,e,t,n,r))return n;return "bottom"}function we(o,e,t,r){let{preferredPosition:i,offset:n={x:0,y:0},containerPadding:s=10,arrowSize:p=8}=r,a=He(o),l=Ve(),d=i;if(i==="auto")d=lo(a,e,t,s);else if(!$e(a,e,t,i,s)){let k={top:"bottom",bottom:"top",left:"right",right:"left"}[i];k&&$e(a,e,t,k,s)&&(d=k);}let c=0,f=0,g={},u=p+4;switch(d){case "top":c=a.top-t-u+n.y,f=a.left+a.width/2-e/2+n.x,g={left:e/2-p/2,top:t,transform:"rotate(180deg)"};break;case "bottom":c=a.bottom+u+n.y,f=a.left+a.width/2-e/2+n.x,g={left:e/2-p/2,top:-p};break;case "left":c=a.top+a.height/2-t/2+n.y,f=a.left-e-u+n.x,g={top:t/2-p/2,left:e,transform:"rotate(-90deg)"};break;case "right":c=a.top+a.height/2-t/2+n.y,f=a.right+u+n.x,g={top:t/2-p/2,left:-p,transform:"rotate(90deg)"};break}let R=l.scrollX+s,S=l.scrollX+l.width-e-s,h=l.scrollY+s,w=l.scrollY+l.height-t-s,b=f;f=Math.max(R,Math.min(S,f)),(d==="top"||d==="bottom")&&(g.left=(g.left||0)+(b-f));let C=c;return c=Math.max(h,Math.min(w,c)),(d==="left"||d==="right")&&(g.top=(g.top||0)+(C-c)),{top:c,left:f,placement:d,arrowPosition:g}}function ke(o,e=100){let t=o.getBoundingClientRect(),r=Ve(),i=t.top<e,n=t.bottom>r.height-e,s=t.left<e,p=t.right>r.width-e;(i||n||s||p)&&o.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});}function Ge(o){if(!o)return null;if(o.css)try{let e=document.querySelector(o.css);if(e)return e}catch{}if(o.testId){let e=document.querySelector(`[data-testid="${o.testId}"]`);if(e)return e}if(o.xpath)try{let e=document.evaluate(o.xpath,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null);if(e.singleNodeValue)return e.singleNodeValue}catch{}if(o.text){let e=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT),t;for(;t=e.nextNode();)if(t.textContent?.includes(o.text))return t.parentElement}return null}function gt(o,e=8){let t=o.getBoundingClientRect(),r={top:t.top-e,left:t.left-e,right:t.right+e,bottom:t.bottom+e,width:t.width+e*2,height:t.height+e*2};return `polygon(
|
|
2
2
|
0 0,
|
|
3
3
|
100% 0,
|
|
4
4
|
100% 100%,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
${r.right}px ${r.bottom}px,
|
|
10
10
|
${r.right}px ${r.top}px,
|
|
11
11
|
${r.left}px ${r.top}px
|
|
12
|
-
)`}function ee({visible:o,spotlightElement:e,spotlightPadding:t=8,onClick:r,dismissOnClick:i=false,zIndex:n=9998,opacity:p=.5}){let[d,s]=react.useState(),a=react.useCallback(()=>{s(e?gt(e,t):void 0);},[e,t]);return react.useEffect(()=>{if(o)return a(),window.addEventListener("scroll",a,true),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a,true),window.removeEventListener("resize",a);}},[o,a]),o?jsxRuntime.jsx("div",{onClick:c=>{i&&r&&r(),c.stopPropagation();},style:{position:"fixed",inset:0,zIndex:n,backgroundColor:`rgba(0, 0, 0, ${p})`,clipPath:d,transition:"clip-path 0.2s ease-out",cursor:i?"pointer":"default",pointerEvents:"auto"},"aria-hidden":"true"}):null}function X({buttons:o,currentStep:e,isLastStep:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:p,accentColor:d="#2563eb"}){if(!o||o.length===0)return jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"16px"},children:[jsxRuntime.jsx("div",{children:e>0&&jsxRuntime.jsx("button",{onClick:i,style:{padding:"8px 16px",fontSize:"14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white",color:"#374151",cursor:"pointer"},children:"Back"})}),jsxRuntime.jsx("button",{onClick:t?n:r,style:{padding:"8px 16px",fontSize:"14px",border:"none",borderRadius:"6px",backgroundColor:d,color:"white",cursor:"pointer"},children:t?"Done":"Next"})]});let s=l=>{switch(l.action){case "next":r();break;case "prev":i();break;case "dismiss":n();break;case "url":l.url&&window.open(l.url,"_blank","noopener,noreferrer");break;case "custom":l.customAction&&p&&p(l.customAction);break}},a=l=>{switch(l){case "primary":return {padding:"8px 16px",fontSize:"14px",border:"none",borderRadius:"6px",backgroundColor:d,color:"white",cursor:"pointer"};case "text":return {padding:"8px 16px",fontSize:"14px",border:"none",borderRadius:"6px",backgroundColor:"transparent",color:d,cursor:"pointer"};default:return {padding:"8px 16px",fontSize:"14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white",color:"#374151",cursor:"pointer"}}};return jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"16px"},children:o.map((l,c)=>jsxRuntime.jsx("button",{onClick:()=>s(l),style:a(l.style),children:l.label},c))})}function Y({step:o,textColor:e="#1f2937",showTitle:t=true}){let r=o.rich_content,i=r?.title||o.title,n=r?.body||o.content;return jsxRuntime.jsxs("div",{children:[t&&i&&jsxRuntime.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:600,color:e,lineHeight:1.4},children:i}),n&&jsxRuntime.jsx("div",{style:{fontSize:"14px",color:e,opacity:.9,lineHeight:1.5},dangerouslySetInnerHTML:n.includes("<")?{__html:mo(n)}:void 0,children:n.includes("<")?null:n}),r?.media&&jsxRuntime.jsxs("div",{style:{marginTop:"12px"},children:[r.media.type==="image"&&jsxRuntime.jsx("img",{src:r.media.url,alt:r.media.alt||"",style:{maxWidth:"100%",height:"auto",borderRadius:"4px"}}),r.media.type==="video"&&jsxRuntime.jsx("video",{src:r.media.url,controls:true,style:{maxWidth:"100%",height:"auto",borderRadius:"4px"},children:"Your browser does not support the video tag."})]})]})}function mo(o){let e=["p","br","b","i","strong","em","u","s","h1","h2","h3","h4","h5","h6","ul","ol","li","a","code","pre","blockquote","span","div"];if(typeof document>"u")return o.replace(/<[^>]*>/g,"");let t=document.createElement("div");return t.innerHTML=o,t.querySelectorAll("script").forEach(n=>n.remove()),t.querySelectorAll("*").forEach(n=>{if(!e.includes(n.tagName.toLowerCase())){let d=document.createTextNode(n.textContent||"");n.parentNode?.replaceChild(d,n);return}Array.from(n.attributes).forEach(d=>{let s=d.name.toLowerCase();if(s.startsWith("on")&&n.removeAttribute(d.name),s==="href"||s==="src"){let l=d.value.toLowerCase().trim();(l.startsWith("javascript:")||l.startsWith("data:"))&&n.removeAttribute(d.name);}["href","target","rel","class","style"].includes(s)||n.removeAttribute(d.name);}),n.tagName.toLowerCase()==="a"&&(n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"));}),t.innerHTML}function ye({step:o,currentStep:e,totalSteps:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:p,showProgress:d=true,globalStyle:s,zIndex:a=9999}){let l=react.useRef(null),[c,f]=react.useState(null),[g,u]=react.useState(null),[R,S]=react.useState(false),x={...s,...o.style_config},w=x.backgroundColor||"white",b=x.textColor||"#1f2937",v=x.accentColor||"#2563eb",E=x.borderRadius||8;react.useEffect(()=>{let T=Ge(o.selector_strategy);f(T),T&&ke(T,120);},[o.selector_strategy]);let k=react.useCallback(()=>{if(!c||!l.current)return;let T=l.current.getBoundingClientRect(),m=we(c,T.width,T.height,{preferredPosition:o.tooltip_position||o.display_config?.position||"auto",offset:o.display_config?.offset,arrowSize:8});u(m),S(true);},[c,o.tooltip_position,o.display_config]);return react.useEffect(()=>{let T=setTimeout(k,10);return window.addEventListener("scroll",k,true),window.addEventListener("resize",k),()=>{clearTimeout(T),window.removeEventListener("scroll",k,true),window.removeEventListener("resize",k);}},[k]),c?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ee,{visible:o.display_config?.backdrop!==false,spotlightElement:c,spotlightPadding:o.display_config?.spotlightPadding||8,dismissOnClick:false}),jsxRuntime.jsxs("div",{ref:l,style:{position:"absolute",top:g?.top||0,left:g?.left||0,zIndex:a,padding:"16px 20px",backgroundColor:w,color:b,borderRadius:E,boxShadow:"0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",maxWidth:o.display_config?.width||320,fontFamily:"system-ui, -apple-system, sans-serif",opacity:R?1:0,transition:"opacity 0.15s ease-out"},children:[g&&jsxRuntime.jsx("div",{style:{position:"absolute",width:0,height:0,borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${w}`,top:g.arrowPosition.top,left:g.arrowPosition.left,transform:g.arrowPosition.transform}}),jsxRuntime.jsx(Y,{step:o,textColor:b}),d&&jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"8px"},children:["Step ",e+1," of ",t]}),jsxRuntime.jsx(X,{buttons:o.rich_content?.buttons,currentStep:e,totalSteps:t,isLastStep:e===t-1,onNext:r,onPrev:i,onDismiss:n,onCustomAction:p,accentColor:v})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ee,{visible:true}),jsxRuntime.jsxs("div",{style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:a,padding:"24px",backgroundColor:w,color:b,borderRadius:E,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",maxWidth:"400px",width:"90%",fontFamily:"system-ui, -apple-system, sans-serif"},children:[jsxRuntime.jsx(Y,{step:o,textColor:b}),d&&jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"8px"},children:["Step ",e+1," of ",t]}),jsxRuntime.jsx(X,{buttons:o.rich_content?.buttons,currentStep:e,totalSteps:t,isLastStep:e===t-1,onNext:r,onPrev:i,onDismiss:n,onCustomAction:p,accentColor:v})]})]})}function Pe({step:o,currentStep:e,totalSteps:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:p,showProgress:d=true,globalStyle:s,zIndex:a=9999}){let l={...s,...o.style_config},c=l.backgroundColor||"white",f=l.textColor||"#1f2937",g=l.accentColor||"#2563eb",u=l.borderRadius||12,R=o.display_config||{},S=R.width||480,x=R.position||"center",w=R.backdrop!==false;return react.useEffect(()=>{let v=E=>{E.key==="Escape"&&n();};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[n]),react.useEffect(()=>{let v=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=v;}},[]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ee,{visible:true,onClick:w?n:void 0,dismissOnClick:w,opacity:.6}),jsxRuntime.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"guide-modal-title",style:{position:"fixed",...(()=>{switch(x){case "top":return {top:"10%",left:"50%",transform:"translateX(-50%)"};case "bottom":return {bottom:"10%",left:"50%",transform:"translateX(-50%)"};default:return {top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})(),zIndex:a,width:"90%",maxWidth:S,maxHeight:"85vh",overflow:"auto",padding:"24px",backgroundColor:c,color:f,borderRadius:u,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",fontFamily:"system-ui, -apple-system, sans-serif"},children:[jsxRuntime.jsx("button",{onClick:n,"aria-label":"Close",style:{position:"absolute",top:"12px",right:"12px",width:"28px",height:"28px",border:"none",borderRadius:"50%",backgroundColor:"transparent",color:"#9ca3af",fontSize:"20px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"color 0.15s"},onMouseEnter:v=>v.currentTarget.style.color="#6b7280",onMouseLeave:v=>v.currentTarget.style.color="#9ca3af",children:"\xD7"}),jsxRuntime.jsx(Y,{step:o,textColor:f}),d&&t>1&&jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"center",gap:"6px",marginTop:"16px"},children:Array.from({length:t}).map((v,E)=>jsxRuntime.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:E===e?g:"#e5e7eb",transition:"background-color 0.15s"}},E))}),jsxRuntime.jsx(X,{buttons:o.rich_content?.buttons,currentStep:e,totalSteps:t,isLastStep:e===t-1,onNext:r,onPrev:i,onDismiss:n,onCustomAction:p,accentColor:g})]})]})}function Ee({step:o,currentStep:e,totalSteps:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:p,showProgress:d=true,globalStyle:s,zIndex:a=9999}){let[l,c]=react.useState(true),f={...s,...o.style_config},g=f.backgroundColor||"white",u=f.textColor||"#1f2937",R=f.accentColor||"#2563eb",S=f.borderRadius||0,x=o.display_config||{},w=x.width||400,b=x.position==="left"?"left":"right",v=x.backdrop!==false;return react.useEffect(()=>{let k=setTimeout(()=>c(false),50);return ()=>clearTimeout(k)},[]),react.useEffect(()=>{let k=T=>{T.key==="Escape"&&n();};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[n]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[v&&jsxRuntime.jsx(ee,{visible:true,onClick:n,dismissOnClick:true,opacity:.4}),jsxRuntime.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"guide-slideout-title",style:(()=>{let k={position:"fixed",top:0,bottom:0,width:"90%",maxWidth:w,zIndex:a,backgroundColor:g,color:u,boxShadow:b==="right"?"-10px 0 30px -5px rgba(0, 0, 0, 0.1)":"10px 0 30px -5px rgba(0, 0, 0, 0.1)",fontFamily:"system-ui, -apple-system, sans-serif",overflow:"auto",transition:"transform 0.3s ease-out"};return b==="right"?{...k,right:0,borderTopLeftRadius:S,borderBottomLeftRadius:S,transform:l?"translateX(100%)":"translateX(0)"}:{...k,left:0,borderTopRightRadius:S,borderBottomRightRadius:S,transform:l?"translateX(-100%)":"translateX(0)"}})(),children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",position:"sticky",top:0,backgroundColor:g,zIndex:1},children:[jsxRuntime.jsx("h2",{id:"guide-slideout-title",style:{margin:0,fontSize:"18px",fontWeight:600,color:u},children:o.rich_content?.title||o.title||"Guide"}),jsxRuntime.jsx("button",{onClick:n,"aria-label":"Close",style:{width:"28px",height:"28px",border:"none",borderRadius:"50%",backgroundColor:"transparent",color:"#9ca3af",fontSize:"20px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"\xD7"})]}),jsxRuntime.jsxs("div",{style:{padding:"20px"},children:[jsxRuntime.jsx(Y,{step:o,textColor:u,showTitle:false}),d&&t>1&&jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"16px"},children:["Step ",e+1," of ",t]})]}),jsxRuntime.jsx("div",{style:{padding:"16px 20px",borderTop:"1px solid #e5e7eb",position:"sticky",bottom:0,backgroundColor:g},children:jsxRuntime.jsx(X,{buttons:o.rich_content?.buttons,currentStep:e,totalSteps:t,isLastStep:e===t-1,onNext:r,onPrev:i,onDismiss:n,onCustomAction:p,accentColor:R})})]})]})}function _e({step:o,currentStep:e,totalSteps:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:p,showProgress:d=true,globalStyle:s,zIndex:a=9999}){let l=react.useRef(null),[c,f]=react.useState(null),[g,u]=react.useState(false),[R,S]=react.useState({top:0,left:0}),[x,w]=react.useState(null),b={...s,...o.style_config},v=b.backgroundColor||"white",E=b.textColor||"#1f2937",k=b.accentColor||"#2563eb",T=b.borderRadius||8,m=o.display_config||{};react.useEffect(()=>{let G=Ge(o.selector_strategy);f(G),G&&ke(G,120);},[o.selector_strategy]);let U=react.useCallback(()=>{if(!c)return;let G=$e(c);S({top:G.top-8,left:G.right-8});},[c]),j=react.useCallback(()=>{if(!c||!l.current||!g)return;let G=l.current.getBoundingClientRect(),y=we(c,G.width,G.height,{preferredPosition:o.tooltip_position||"auto",offset:o.display_config?.offset,arrowSize:8});w(y);},[c,g,o.tooltip_position,o.display_config?.offset]);if(react.useEffect(()=>(U(),g&&setTimeout(j,10),window.addEventListener("scroll",U,true),window.addEventListener("resize",U),()=>{window.removeEventListener("scroll",U,true),window.removeEventListener("resize",U);}),[U,j,g]),react.useEffect(()=>{if(!g)return;let G=y=>{l.current&&!l.current.contains(y.target)&&u(false);};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[g]),!c)return null;let _=`
|
|
12
|
+
)`}function ee({visible:o,spotlightElement:e,spotlightPadding:t=8,onClick:r,dismissOnClick:i=false,zIndex:n=9998,opacity:s=.5}){let[p,a]=react.useState(),l=react.useCallback(()=>{a(e?gt(e,t):void 0);},[e,t]);return react.useEffect(()=>{if(o)return l(),window.addEventListener("scroll",l,true),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l,true),window.removeEventListener("resize",l);}},[o,l]),o?jsxRuntime.jsx("div",{onClick:c=>{i&&r&&r(),c.stopPropagation();},style:{position:"fixed",inset:0,zIndex:n,backgroundColor:`rgba(0, 0, 0, ${s})`,clipPath:p,transition:"clip-path 0.2s ease-out",cursor:i?"pointer":"default",pointerEvents:"auto"},"aria-hidden":"true"}):null}function X({buttons:o,currentStep:e,isLastStep:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:s,accentColor:p="#2563eb"}){if(!o||o.length===0)return jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"16px"},children:[jsxRuntime.jsx("div",{children:e>0&&jsxRuntime.jsx("button",{onClick:i,style:{padding:"8px 16px",fontSize:"14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white",color:"#374151",cursor:"pointer"},children:"Back"})}),jsxRuntime.jsx("button",{onClick:t?n:r,style:{padding:"8px 16px",fontSize:"14px",border:"none",borderRadius:"6px",backgroundColor:p,color:"white",cursor:"pointer"},children:t?"Done":"Next"})]});let a=d=>{switch(d.action){case "next":r();break;case "prev":i();break;case "dismiss":n();break;case "url":d.url&&window.open(d.url,"_blank","noopener,noreferrer");break;case "custom":d.customAction&&s&&s(d.customAction);break}},l=d=>{switch(d){case "primary":return {padding:"8px 16px",fontSize:"14px",border:"none",borderRadius:"6px",backgroundColor:p,color:"white",cursor:"pointer"};case "text":return {padding:"8px 16px",fontSize:"14px",border:"none",borderRadius:"6px",backgroundColor:"transparent",color:p,cursor:"pointer"};default:return {padding:"8px 16px",fontSize:"14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white",color:"#374151",cursor:"pointer"}}};return jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"16px"},children:o.map((d,c)=>jsxRuntime.jsx("button",{onClick:()=>a(d),style:l(d.style),children:d.label},c))})}function Y({step:o,textColor:e="#1f2937",showTitle:t=true}){let r=o.rich_content,i=r?.title||o.title,n=r?.body||o.content;return jsxRuntime.jsxs("div",{children:[t&&i&&jsxRuntime.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:600,color:e,lineHeight:1.4},children:i}),n&&jsxRuntime.jsx("div",{style:{fontSize:"14px",color:e,opacity:.9,lineHeight:1.5},dangerouslySetInnerHTML:n.includes("<")?{__html:mo(n)}:void 0,children:n.includes("<")?null:n}),r?.media&&jsxRuntime.jsxs("div",{style:{marginTop:"12px"},children:[r.media.type==="image"&&jsxRuntime.jsx("img",{src:r.media.url,alt:r.media.alt||"",style:{maxWidth:"100%",height:"auto",borderRadius:"4px"}}),r.media.type==="video"&&jsxRuntime.jsx("video",{src:r.media.url,controls:true,style:{maxWidth:"100%",height:"auto",borderRadius:"4px"},children:"Your browser does not support the video tag."})]})]})}function mo(o){let e=["p","br","b","i","strong","em","u","s","h1","h2","h3","h4","h5","h6","ul","ol","li","a","code","pre","blockquote","span","div"];if(typeof document>"u")return o.replace(/<[^>]*>/g,"");let t=document.createElement("div");return t.innerHTML=o,t.querySelectorAll("script").forEach(n=>n.remove()),t.querySelectorAll("*").forEach(n=>{if(!e.includes(n.tagName.toLowerCase())){let p=document.createTextNode(n.textContent||"");n.parentNode?.replaceChild(p,n);return}Array.from(n.attributes).forEach(p=>{let a=p.name.toLowerCase();if(a.startsWith("on")&&n.removeAttribute(p.name),a==="href"||a==="src"){let d=p.value.toLowerCase().trim();(d.startsWith("javascript:")||d.startsWith("data:"))&&n.removeAttribute(p.name);}["href","target","rel","class","style"].includes(a)||n.removeAttribute(p.name);}),n.tagName.toLowerCase()==="a"&&(n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"));}),t.innerHTML}function ye({step:o,currentStep:e,totalSteps:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:s,showProgress:p=true,globalStyle:a,zIndex:l=9999}){let d=react.useRef(null),[c,f]=react.useState(null),[g,u]=react.useState(null),[R,S]=react.useState(false),h={...a,...o.style_config},w=h.backgroundColor||"white",b=h.textColor||"#1f2937",C=h.accentColor||"#2563eb",E=h.borderRadius||8;react.useEffect(()=>{let _=Ge(o.selector_strategy);f(_),_&&ke(_,120);},[o.selector_strategy]);let k=react.useCallback(()=>{if(!c||!d.current)return;let _=d.current.getBoundingClientRect(),m=we(c,_.width,_.height,{preferredPosition:o.tooltip_position||o.display_config?.position||"auto",offset:o.display_config?.offset,arrowSize:8});u(m),S(true);},[c,o.tooltip_position,o.display_config]);return react.useEffect(()=>{let _=setTimeout(k,10);return window.addEventListener("scroll",k,true),window.addEventListener("resize",k),()=>{clearTimeout(_),window.removeEventListener("scroll",k,true),window.removeEventListener("resize",k);}},[k]),c?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ee,{visible:o.display_config?.backdrop!==false,spotlightElement:c,spotlightPadding:o.display_config?.spotlightPadding||8,dismissOnClick:false}),jsxRuntime.jsxs("div",{ref:d,style:{position:"absolute",top:g?.top||0,left:g?.left||0,zIndex:l,padding:"16px 20px",backgroundColor:w,color:b,borderRadius:E,boxShadow:"0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",maxWidth:o.display_config?.width||320,fontFamily:"system-ui, -apple-system, sans-serif",opacity:R?1:0,transition:"opacity 0.15s ease-out"},children:[g&&jsxRuntime.jsx("div",{style:{position:"absolute",width:0,height:0,borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${w}`,top:g.arrowPosition.top,left:g.arrowPosition.left,transform:g.arrowPosition.transform}}),jsxRuntime.jsx(Y,{step:o,textColor:b}),p&&jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"8px"},children:["Step ",e+1," of ",t]}),jsxRuntime.jsx(X,{buttons:o.rich_content?.buttons,currentStep:e,totalSteps:t,isLastStep:e===t-1,onNext:r,onPrev:i,onDismiss:n,onCustomAction:s,accentColor:C})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ee,{visible:true}),jsxRuntime.jsxs("div",{style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:l,padding:"24px",backgroundColor:w,color:b,borderRadius:E,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",maxWidth:"400px",width:"90%",fontFamily:"system-ui, -apple-system, sans-serif"},children:[jsxRuntime.jsx(Y,{step:o,textColor:b}),p&&jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"8px"},children:["Step ",e+1," of ",t]}),jsxRuntime.jsx(X,{buttons:o.rich_content?.buttons,currentStep:e,totalSteps:t,isLastStep:e===t-1,onNext:r,onPrev:i,onDismiss:n,onCustomAction:s,accentColor:C})]})]})}function Pe({step:o,currentStep:e,totalSteps:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:s,showProgress:p=true,globalStyle:a,zIndex:l=9999}){let d={...a,...o.style_config},c=d.backgroundColor||"white",f=d.textColor||"#1f2937",g=d.accentColor||"#2563eb",u=d.borderRadius||12,R=o.display_config||{},S=R.width||480,h=R.position||"center",w=R.backdrop!==false;return react.useEffect(()=>{let C=E=>{E.key==="Escape"&&n();};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[n]),react.useEffect(()=>{let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C;}},[]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ee,{visible:true,onClick:w?n:void 0,dismissOnClick:w,opacity:.6}),jsxRuntime.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"guide-modal-title",style:{position:"fixed",...(()=>{switch(h){case "top":return {top:"10%",left:"50%",transform:"translateX(-50%)"};case "bottom":return {bottom:"10%",left:"50%",transform:"translateX(-50%)"};default:return {top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})(),zIndex:l,width:"90%",maxWidth:S,maxHeight:"85vh",overflow:"auto",padding:"24px",backgroundColor:c,color:f,borderRadius:u,boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",fontFamily:"system-ui, -apple-system, sans-serif"},children:[jsxRuntime.jsx("button",{onClick:n,"aria-label":"Close",style:{position:"absolute",top:"12px",right:"12px",width:"28px",height:"28px",border:"none",borderRadius:"50%",backgroundColor:"transparent",color:"#9ca3af",fontSize:"20px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"color 0.15s"},onMouseEnter:C=>C.currentTarget.style.color="#6b7280",onMouseLeave:C=>C.currentTarget.style.color="#9ca3af",children:"\xD7"}),jsxRuntime.jsx(Y,{step:o,textColor:f}),p&&t>1&&jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"center",gap:"6px",marginTop:"16px"},children:Array.from({length:t}).map((C,E)=>jsxRuntime.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:E===e?g:"#e5e7eb",transition:"background-color 0.15s"}},E))}),jsxRuntime.jsx(X,{buttons:o.rich_content?.buttons,currentStep:e,totalSteps:t,isLastStep:e===t-1,onNext:r,onPrev:i,onDismiss:n,onCustomAction:s,accentColor:g})]})]})}function Ee({step:o,currentStep:e,totalSteps:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:s,showProgress:p=true,globalStyle:a,zIndex:l=9999}){let[d,c]=react.useState(true),f={...a,...o.style_config},g=f.backgroundColor||"white",u=f.textColor||"#1f2937",R=f.accentColor||"#2563eb",S=f.borderRadius||0,h=o.display_config||{},w=h.width||400,b=h.position==="left"?"left":"right",C=h.backdrop!==false;return react.useEffect(()=>{let k=setTimeout(()=>c(false),50);return ()=>clearTimeout(k)},[]),react.useEffect(()=>{let k=_=>{_.key==="Escape"&&n();};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[n]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[C&&jsxRuntime.jsx(ee,{visible:true,onClick:n,dismissOnClick:true,opacity:.4}),jsxRuntime.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"guide-slideout-title",style:(()=>{let k={position:"fixed",top:0,bottom:0,width:"90%",maxWidth:w,zIndex:l,backgroundColor:g,color:u,boxShadow:b==="right"?"-10px 0 30px -5px rgba(0, 0, 0, 0.1)":"10px 0 30px -5px rgba(0, 0, 0, 0.1)",fontFamily:"system-ui, -apple-system, sans-serif",overflow:"auto",transition:"transform 0.3s ease-out"};return b==="right"?{...k,right:0,borderTopLeftRadius:S,borderBottomLeftRadius:S,transform:d?"translateX(100%)":"translateX(0)"}:{...k,left:0,borderTopRightRadius:S,borderBottomRightRadius:S,transform:d?"translateX(-100%)":"translateX(0)"}})(),children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",position:"sticky",top:0,backgroundColor:g,zIndex:1},children:[jsxRuntime.jsx("h2",{id:"guide-slideout-title",style:{margin:0,fontSize:"18px",fontWeight:600,color:u},children:o.rich_content?.title||o.title||"Guide"}),jsxRuntime.jsx("button",{onClick:n,"aria-label":"Close",style:{width:"28px",height:"28px",border:"none",borderRadius:"50%",backgroundColor:"transparent",color:"#9ca3af",fontSize:"20px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"\xD7"})]}),jsxRuntime.jsxs("div",{style:{padding:"20px"},children:[jsxRuntime.jsx(Y,{step:o,textColor:u,showTitle:false}),p&&t>1&&jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"16px"},children:["Step ",e+1," of ",t]})]}),jsxRuntime.jsx("div",{style:{padding:"16px 20px",borderTop:"1px solid #e5e7eb",position:"sticky",bottom:0,backgroundColor:g},children:jsxRuntime.jsx(X,{buttons:o.rich_content?.buttons,currentStep:e,totalSteps:t,isLastStep:e===t-1,onNext:r,onPrev:i,onDismiss:n,onCustomAction:s,accentColor:R})})]})]})}function Te({step:o,currentStep:e,totalSteps:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:s,showProgress:p=true,globalStyle:a,zIndex:l=9999}){let d=react.useRef(null),[c,f]=react.useState(null),[g,u]=react.useState(false),[R,S]=react.useState({top:0,left:0}),[h,w]=react.useState(null),b={...a,...o.style_config},C=b.backgroundColor||"white",E=b.textColor||"#1f2937",k=b.accentColor||"#2563eb",_=b.borderRadius||8,m=o.display_config||{};react.useEffect(()=>{let G=Ge(o.selector_strategy);f(G),G&&ke(G,120);},[o.selector_strategy]);let U=react.useCallback(()=>{if(!c)return;let G=He(c);S({top:G.top-8,left:G.right-8});},[c]),j=react.useCallback(()=>{if(!c||!d.current||!g)return;let G=d.current.getBoundingClientRect(),y=we(c,G.width,G.height,{preferredPosition:o.tooltip_position||"auto",offset:o.display_config?.offset,arrowSize:8});w(y);},[c,g,o.tooltip_position,o.display_config?.offset]);if(react.useEffect(()=>(U(),g&&setTimeout(j,10),window.addEventListener("scroll",U,true),window.addEventListener("resize",U),()=>{window.removeEventListener("scroll",U,true),window.removeEventListener("resize",U);}),[U,j,g]),react.useEffect(()=>{if(!g)return;let G=y=>{d.current&&!d.current.contains(y.target)&&u(false);};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[g]),!c)return null;let T=`
|
|
13
13
|
@keyframes census-hotspot-pulse {
|
|
14
14
|
0% {
|
|
15
15
|
transform: scale(1);
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
box-shadow: 0 0 0 0 ${k}00;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:
|
|
27
|
+
`;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),jsxRuntime.jsx("button",{onClick:()=>u(!g),"aria-label":"Show more information","aria-expanded":g,style:{position:"absolute",top:R.top,left:R.left,width:"24px",height:"24px",borderRadius:"50%",border:"none",backgroundColor:k,color:"white",cursor:"pointer",zIndex:l,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:600,animation:!g?"census-hotspot-pulse 2s infinite":"none",transition:"transform 0.15s"},children:"?"}),g&&jsxRuntime.jsxs("div",{ref:d,style:{position:"absolute",top:h?.top||R.top+30,left:h?.left||R.left-140,zIndex:l+1,padding:"16px 20px",backgroundColor:C,color:E,borderRadius:_,boxShadow:"0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",maxWidth:m.width||300,fontFamily:"system-ui, -apple-system, sans-serif"},children:[h&&jsxRuntime.jsx("div",{style:{position:"absolute",width:0,height:0,borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${C}`,top:h.arrowPosition.top,left:h.arrowPosition.left,transform:h.arrowPosition.transform}}),jsxRuntime.jsx(Y,{step:o,textColor:E}),p&&t>1&&jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"8px"},children:["Step ",e+1," of ",t]}),jsxRuntime.jsx(X,{buttons:o.rich_content?.buttons,currentStep:e,totalSteps:t,isLastStep:e===t-1,onNext:()=>{u(false),r();},onPrev:()=>{u(false),i();},onDismiss:()=>{u(false),n();},onCustomAction:s,accentColor:k})]})]})}var Ie={info:{bg:"#eff6ff",text:"#1e40af",icon:"i"},warning:{bg:"#fef3c7",text:"#92400e",icon:"!"},success:{bg:"#dcfce7",text:"#166534",icon:"\u2713"},custom:{bg:"#2563eb",text:"white",icon:""}};function Be({step:o,currentStep:e,totalSteps:t,onNext:r,onPrev:i,onDismiss:n,onCustomAction:s,showProgress:p=true,globalStyle:a,zIndex:l=9999}){let [d,c]=react.useState(true),[f,g]=react.useState(true),u={...a,...o.style_config},S=(o.display_config||{}).bannerPosition||"top",h="custom",w=u.backgroundColor||Ie[h].bg,b=u.textColor||Ie[h].text;react.useEffect(()=>{let U=setTimeout(()=>c(false),50);return ()=>clearTimeout(U)},[]);let E=()=>{c(true),setTimeout(()=>{g(false),n();},200);};if(!f)return null;let k=o.rich_content,_=k?.title||o.title,m=k?.body||o.content,L=k?.buttons&&k.buttons.length>0;return jsxRuntime.jsx("div",{role:"alert",style:{position:"fixed",left:0,right:0,[S]:0,zIndex:l,padding:"12px 20px",backgroundColor:w,color:b,boxShadow:S==="top"?"0 4px 6px -1px rgba(0, 0, 0, 0.1)":"0 -4px 6px -1px rgba(0, 0, 0, 0.1)",fontFamily:"system-ui, -apple-system, sans-serif",transform:d?S==="top"?"translateY(-100%)":"translateY(100%)":"translateY(0)",transition:"transform 0.2s ease-out"},children:jsxRuntime.jsxs("div",{style:{maxWidth:"1200px",margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"16px"},children:[jsxRuntime.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:"12px"},children:[Ie[h].icon,jsxRuntime.jsxs("div",{style:{flex:1},children:[_&&jsxRuntime.jsx("strong",{style:{display:"block",marginBottom:m?"2px":0},children:_}),m&&jsxRuntime.jsx("span",{style:{opacity:.9,fontSize:"14px"},children:m})]}),p&&t>1&&jsxRuntime.jsxs("span",{style:{fontSize:"12px",opacity:.7,flexShrink:0},children:[e+1,"/",t]})]}),jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[L?jsxRuntime.jsx(X,{buttons:k.buttons,currentStep:e,totalSteps:t,isLastStep:e===t-1,onNext:r,onPrev:i,onDismiss:E,onCustomAction:s,accentColor:"white"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e<t-1?jsxRuntime.jsx("button",{onClick:r,style:{padding:"6px 12px",fontSize:"14px",border:"none",borderRadius:"4px",backgroundColor:"rgba(255,255,255,0.2)",color:b,cursor:"pointer"},children:"Next"}):jsxRuntime.jsx("button",{onClick:E,style:{padding:"6px 12px",fontSize:"14px",border:"none",borderRadius:"4px",backgroundColor:"rgba(255,255,255,0.2)",color:b,cursor:"pointer"},children:"Got it"})}),jsxRuntime.jsx("button",{onClick:E,"aria-label":"Dismiss",style:{width:"28px",height:"28px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:b,opacity:.7,fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"\xD7"})]})]})})}function Ro({guide:o,onComplete:e,onDismiss:t,onStepChange:r,onCustomAction:i,globalStyle:n,startStep:s=0,zIndex:p=9999}){let[a,l]=react.useState(s),[d,c]=react.useState(true),f=o.guide_steps||[],g=f.length,u=f[a];react.useEffect(()=>{r?.(a,g);},[a,g,r]);let R=react.useCallback(()=>{a<g-1?l(C=>C+1):(c(false),e?.(o));},[a,g,o,e]),S=react.useCallback(()=>{a>0&&l(C=>C-1);},[a]),h=react.useCallback(()=>{c(false),t?.(o,a);},[o,a,t]),w=react.useCallback(C=>{u&&i?.(C,u);},[u,i]);if(!d||!u||f.length===0)return null;let b={step:u,currentStep:a,totalSteps:g,onNext:R,onPrev:S,onDismiss:h,onCustomAction:w,showProgress:o.show_progress!==false,globalStyle:{...o.theme,...n},zIndex:p};switch(u.step_type){case "tooltip":return jsxRuntime.jsx(ye,{...b});case "modal":return jsxRuntime.jsx(Pe,{...b});case "slideout":return jsxRuntime.jsx(Ee,{...b});case "hotspot":return jsxRuntime.jsx(Te,{...b});case "banner":return jsxRuntime.jsx(Be,{...b});default:return jsxRuntime.jsx(ye,{...b})}}exports.Backdrop=ee;exports.BannerStep=Be;exports.CensusProvider=Pt;exports.FeedbackButton=Dt;exports.GuideBuilder=ao;exports.GuideRenderer=Ro;exports.HelpCenter=Jt;exports.HotspotStep=Te;exports.KnowledgeBase=Nt;exports.ModalStep=Pe;exports.Requests=Vt;exports.SlideoutStep=Ee;exports.StepButtons=X;exports.StepContent=Y;exports.TooltipStep=ye;exports.useArticle=fe;exports.useArticles=ue;exports.useCensus=Et;exports.useCensusContext=O;exports.useFeatureGroups=qe;exports.useFeedback=Le;exports.useGuideBuilder=Oe;exports.useGuideRenderer=zt;exports.useGuides=Ft;exports.useIdentify=_t;exports.useRequests=ne;exports.useTrack=Bt;//# sourceMappingURL=index.cjs.map
|
|
28
28
|
//# sourceMappingURL=index.cjs.map
|