PageSourceSearch

https://www.palmador.ai/_next/static/chunks/63b9ae1618e0bf81.js?dpl=dpl_Ao6tv3ycM3ErsYAJ6pFxH2DqEEzy

js palmador.ai collected 2026-10-05 12:22:23 UTC 43,444 bytes, 18 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,19273,80166,e=>{"use strict";e.i(47167);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function i(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>i,"timeoutManager",()=>r],80166);var o="u"<typeof window||"Deno"in globalThis;function a(){}function n(e,t){return"function"==typeof e?e(t):e}function s(e){return"number"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c(e,t){return"function"==typeof e?e(t):e}function d(e,t){return"function"==typeof e?e(t):e}function u(e,t){let{type:r="all",exact:i,fetchStatus:o,predicate:a,queryKey:n,stale:s}=e;if(n){if(i){if(t.queryHash!==h(n,t.options))return!1}else if(!g(t.queryKey,n))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&(!o||o===t.state.fetchStatus)&&(!a||!!a(t))}function p(e,t){let{exact:r,status:i,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(f(t.options.mutationKey)!==f(a))return!1}else if(!g(t.options.mutationKey,a))return!1}return(!i||t.state.status===i)&&(!o||!!o(t))}function h(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function g(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>g(e[r],t[r]))}var y=Object.prototype.hasOwnProperty;function m(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!w(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!w(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function S(e){return new Promise(t=>{r.setTimeout(t,e)})}function I(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,i=0){if(t===r)return t;if(i>500)return r;let o=v(t)&&v(r);if(!o&&!(b(t)&&b(r)))return r;let a=(o?t:Object.keys(t)).length,n=o?r:Object.keys(r),s=n.length,l=o?Array(s):{},c=0;for(let d=0;d<s;d++){let s=o?d:n[d],u=t[s],p=r[s];if(u===p){l[s]=u,(o?d<a:y.call(t,s))&&c++;continue}if(null===u||null===p||"object"!=typeof u||"object"!=typeof p){l[s]=p;continue}let h=e(u,p,i+1);l[s]=h,h===u&&c++}return a===s&&c===a?t:l}(e,t):t}function P(e,t,r=0){let i=[...e,t];return r&&i.length>r?i.slice(1):i}function V(e,t,r=0){let i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var _=Symbol();function T(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==_?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function C(e,t){return"function"==typeof e?e(...t):!!e}function O(e,t,r){let i,o=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),o||(o=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}e.s(["addConsumeAwareSignal",()=>O,"addToEnd",()=>P,"addToStart",()=>V,"ensureQueryFn",()=>T,"functionalUpdate",()=>n,"hashKey",()=>f,"hashQueryKeyByOptions",()=>h,"isServer",()=>o,"isValidTimeout",()=>s,"matchMutation",()=>p,"matchQuery",()=>u,"noop",()=>a,"partialMatchKey",()=>g,"replaceData",()=>I,"resolveEnabled",()=>d,"resolveStaleTime",()=>c,"shallowEqualObjects",()=>m,"shouldThrowError",()=>C,"skipToken",()=>_,"sleep",()=>S,"timeUntilStale",()=>l],19273)},40143,e=>{"use strict";let t,r,i,o,a,n;var s=e.i(80166).systemSetTimeoutZero,l=(t=[],r=0,i=e=>{e()},o=e=>{e()},a=s,{batch:e=>{let n;r++;try{n=e()}finally{let e;--r||(e=t,t=[],e.length&&a(()=>{o(()=>
1{e.forEach(e=>{i(e)})})}))}return n},batchCalls:e=>(...t)=>{n(()=>{e(...t)})},schedule:n=e=>{r?t.push(e):a(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{o=e},setScheduler:e=>{a=e}});e.s(["notifyManager",()=>l])},15823,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t])},75555,e=>{"use strict";var t=e.i(15823),r=e.i(19273),i=new class extends t.Subscribable{#r;#i;#o;constructor(){super(),this.#o=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#i||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#o=e,this.#i?.(),this.#i=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>i])},86491,81991,93803,36553,88587,12598,e=>{"use strict";e.i(47167);var t=e.i(19273),r=e.i(40143),i=e.i(75555),o=e.i(15823),a=new class extends o.Subscribable{#a=!0;#i;#o;constructor(){super(),this.#o=e=>{if(!t.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#i||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#o=e,this.#i?.(),this.#i=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function n(){let e,t,r=new Promise((r,i)=>{e=r,t=i});function i(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},r.reject=e=>{i({status:"rejected",reason:e}),t(e)},r}function s(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||a.isOnline()}e.s(["onlineManager",()=>a],81991),e.s(["pendingThenable",()=>n],93803);var c=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function d(e){let r,o=!1,d=0,u=n(),p=()=>i.focusManager.isFocused()&&("always"===e.networkMode||a.isOnline())&&e.canRun(),h=()=>l(e.networkMode)&&e.canRun(),f=e=>{"pending"===u.status&&(r?.(),u.resolve(e))},g=e=>{"pending"===u.status&&(r?.(),u.reject(e))},y=()=>new Promise(t=>{r=e=>{("pending"!==u.status||p())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===u.status&&e.onContinue?.()}),m=()=>{let r;if("pending"!==u.status)return;let i=0===d?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if("pending"!==u.status)return;let i=e.retry??3*!t.isServer,a=e.retryDelay??s,n="function"==typeof a?a(d,r):a,l=!0===i||"number"==typeof i&&d<i||"function"==typeof i&&i(d,r);o||!l?g(r):(d++,e.onFail?.(d,r),(0,t.sleep)(n).then(()=>p()?void 0:y()).then(()=>{o?g(r):m()}))})};return{promise:u,status:()=>u.status,cancel:t=>{if("pending"===u.status){let r=new c(t);g(r),e.onCancel?.(r)}},continue:()=>(r?.(),u),cancelRetry:()=>{o=!0},continueRetry:()=>{o=!1},canStart:h,start:()=>(h()?m():y().then(m),u)}}e.s(["CancelledError",()=>c,"canFetch",()=>l,"createRetryer",()=>d],36553);var u=e.i(80166),p=class{#n;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#n=u.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(t.isServer?1/0:3e5))}clearGcTimeout(){this.#n&&(u.timeoutManager.clearTimeout(this.#n),this.#n=void 0)}};e.s(["Removable",()=>p],88587);var h=class extends p{#s;#l;#c;#d;#u;#p;#h;constructor(e){super(),this.#h=!1,this.#p=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#d=e.client,this.#c=this.#d.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#s=y(this.options),this.state=e.state??this.#s,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#u?.promise}setOptions(e){if(this.options={...this.#p,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=y(this.options);void 0!==e.data&&(this.setState(g(e.data,e.dataUpdatedAt)),this.#s=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,r){let i=(0,t.replaceData)(this.state.data,e,this.options);return this.#f({data:i,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),i}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#u?.promise;return this.#u?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#s)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdate
1Count===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#u?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#u?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#u&&(this.#h?this.#u.cancel({revert:!0}):this.#u.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,r){let i;if("idle"!==this.state.fetchStatus&&this.#u?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#u)return this.#u.continueRetry(),this.#u.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let o=new AbortController,a=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,o.signal)})},n=()=>{let e,i=(0,t.ensureQueryFn)(this.options,r),o=(a(e={client:this.#d,queryKey:this.queryKey,meta:this.meta}),e);return(this.#h=!1,this.options.persister)?this.options.persister(i,o,this):i(o)},s=(a(i={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#d,state:this.state,fetchFn:n}),i);this.options.behavior?.onFetch(s,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#f({type:"fetch",meta:s.fetchOptions?.meta}),this.#u=d({initialPromise:r?.initialPromise,fn:s.fetchFn,onCancel:e=>{e instanceof c&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),o.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{let e=await this.#u.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof c){if(e.silent)return this.#u.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#f({type:"error",error:e}),this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#f(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...f(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...g(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function f(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function g(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function y(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,i=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdate
1Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>h,"fetchState",()=>f],86491);var m=e.i(71645),v=e.i(43476),b=m.createContext(void 0),w=e=>{let t=m.useContext(b);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},S=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,v.jsx)(b.Provider,{value:e,children:t}));e.s(["QueryClientProvider",()=>S,"useQueryClient",()=>w],12598)},86033,33918,e=>{"use strict";var t=e.i(68834),r=e.i(79473);e.i(47167);var i=e.i(54346);let o="https://palmador-production-1018498370553.us-east1.run.app",a=`${o}/api/video`,n=`${o}/api/ugc`,s=`${o}/api/user/videos`,l=`${o}/api/asset/resource`,c=`${o}/api/product-demos`;class d extends Error{code;status;constructor(e,t,r){super(e),this.name="VideoApiError",this.status=t,this.code=r}}class u extends Error{warning;reason;preview;constructor(e,t,r){super(e),this.name="PlacementWarningError",this.warning=e,this.reason=t,this.preview=r}}function p(e){return null==e?"An error occurred":"string"==typeof e?e:"object"!=typeof e?String(e):"string"==typeof e.message&&e.message||"string"==typeof e.error&&e.error||"string"==typeof e.msg&&e.msg||"string"==typeof e.detail&&e.detail||(Array.isArray(e.details)&&e.details[0]&&"string"==typeof e.details[0].message?e.details[0].message:null)||(Array.isArray(e.errors)&&e.errors[0]&&"string"==typeof e.errors[0]?e.errors[0]:null)||"An error occurred"}function h(e,t){if(404===e){let e=t.slice(0,120);return`Video service not found (404). ${e} — The video API may not be deployed at this URL yet. Check with your backend team.`}return 401===e?"Session expired or invalid. Please sign in again.":403===e?"You don’t have permission to start video generation.":e>=500?`Server error (${e}). Please try again later.`:t}async function f(e){if(console.log("[VideoAPI] handleResponse - Status:",e.status,e.ok),!e.ok){let t,r="An error occurred";try{let i=await e.text();if(console.error("[VideoAPI] Error response raw:",i.slice(0,500)),i.trim())if(i.trim().toLowerCase().startsWith("<!doctype")||i.trim().toLowerCase().startsWith("<html")){let t,o;o=(t=i.trim()).match(/<pre[^>]*>([\s\S]*?)<\/pre>/i),r=o?.[1]?o[1].trim().slice(0,200):t.toLowerCase().startsWith("<!doctype")||t.toLowerCase().startsWith("<html")?"Server returned an HTML error page (endpoint may not exist or server error).":t.slice(0,200)||"An error occurred",r=h(e.status,r)}else try{let o=JSON.parse(i);console.error("[VideoAPI] Error response body:",o),r=p(o),r=h(e.status,r),t="string"==typeof o.code?o.code:void 0}catch{r=h(e.status,i.slice(0,200)||e.statusText)}else r=h(e.status,e.statusText||r)}catch(t){console.error("[VideoAPI] Could not read error response:",t),r=h(e.status,e.statusText||r)}throw console.error("[VideoAPI] Throwing error:",{errorMessage:r,status:e.status,errorCode:t}),new d(r,e.status,t)}let t=e.headers.get("content-type");if(console.log("[VideoAPI] Response content-type:",t),!t||!t.includes("application/json"))return console.warn("[VideoAPI] Non-JSON response, returning empty object"),{};let r=await e.json();return console.log("[VideoAPI] Parsed JSON response:",r),r}function g(e){return{id:String(e.id),job_id:function(e){if(e)try{let t=JSON.parse(e);return"string"==typeof t.jobId?t.jobId:void 0}catch{return}}(e.message)||String(e.id),name:e.name,description:e.description,prompt:e.prompt,product_description:"",product_category:"",status:e.status,video_url:e.output??void 0,caption_video_url:e.caption_videos??void 0,thumbnail_url:e.thumbnail??void 0,duration:e.duration??void 0,created_at:e.created_at,updated_at:e.updated_at}}let y={async startVideoJob(e){console.log("[VideoAPI] POST video-jobs");let t=await (0,i.authenticatedFetch)(`${a}/video-jobs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(400===t.status){let e=null,r="";try{r=await t.text(),e=JSON.parse(r)}catch{}if(e&&!0===e.requires_confirmation){let t=e.preview||{interaction_hint:"",placement_style:"",is_warning:!0},r="string"==typeof e.reason&&e.reason||t.reason||"";throw new u(e.warning||"Product placement may not look natural.",r,t)}throw new d(e?h(400,p(e)):h(400,r.slice(0,200)||"Bad request"),400,e&&"string"==typeof e.code?e.code:void 0)}try{return await f(t)}catch(e){throw console.error("[VideoAPI] startVideoJob failed:",e),e}},getJobStatus:async e=>f(await (0,i.authenticatedFetch)(`${a}/jobs/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})),async getActors(e=1,t=20){let r=`${n}/actors?page=${e}&limit=${t}`;console.log("[VideoAPI] Fetching actors from:",r);try{let o=await (0,i.authenticatedFetch)(r,{method:"GET",headers:{"Content-Type":"application/json"}});console.log("[VideoAPI] Response status:",o.status,o.statusText);let a=await f(o),n={actors:a?.data??[],total:a?.pagination?.total??0,page:a?.pagination?.page??e,limit:a?.pagination?.limit??t};return console.log("[VideoAPI] Normalized response:",{actorsCount:n.actors.length,total:n.total,page:n.page,limit:n.limit}),n}catch(e){throw console.error("[VideoAPI] ❌ Failed to fetch actors:",e),e}},async getUgcIdea(e,t,r,o){let a=`${n}/idea?companyDetailsId=${e}`;t&&(a+=`&productId=${t}`),r&&(a+=`&actorId=${r}`),o&&(a+=`&language=${o}`),console.log("[VideoAPI] Fetching UGC idea from:",a);try{let e=await (0,i.authenticatedFetch)(a,{method:"GET",headers:{"Content-Type":"application/json"}}),t=await f(e);return console.log("[VideoAPI] UGC idea response:",t),t}catch(e){throw console.error("[VideoAPI] ❌ Failed to fetch UGC idea:",e),e}},async getUserVideos(e=1,t=20){let r=`${s}?page=${e}&limit=${t}`,o=await (0,i.authenticatedFetch)(r,{method:"GET",headers:{"Content-Type":"application/json"}}),a=await f(o);return{videos:(a?.data??[]).map(g),total:a?.pagination?.total??0,page:a?.pagination?.page??e,limit:a?.pagination?.limit??t}},async getPresignUrl(e){let t=`${l}/presign?ext=${encodeURIComponent(e)}`;return console.log("[VideoAPI] Getting presign URL for extension:",e),f(await (0,i.authenticatedFetch)(t,{method:"GET"}))},async uploadToS3(e,t,r){console.log("[VideoAPI] Uploading to S3...");let i=await fetch(e,{method:"PUT",headers:t,body:r});if(!i.ok)throw new d(`S3 upload failed (${i.status})`,i.status);console.log("[VideoAPI] S3 upload complete")},async confirmUpload(e,t,r){console.log("[VideoAPI] Confirming upload for resource:",e);let o={resourceId:e,key:t};return r&&(o.language=r),f(await (0,i.authenticatedFetch)(`${l}/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}))},async startCircleOverlap(e){console.log("[VideoAPI] POST circle-overlap");let t=await (0,i.authenticatedFetch)(`${a}/circle-overlap`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{return await f(t)}catch(e){throw console.error("[VideoAPI] startCircleOverlap failed:",e),e}},getCircleOverlapStatus:async e=>f(await (0,i.authenticatedFetch)(`${a}/circle-overlap/jobs/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})),async startStreetInterview(e){console.log("[VideoAPI] POST street-interview");let t=await (0,i.authenticatedFetch)(`${a}/street-interview`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{return await f(t)}catch(e){throw console.error("[VideoAPI] startStreetInterview failed:",e),e}},getStreetInterviewStatus:async e=>f(await (0,i.authenticatedFetch)(`${a}/street-interview/jobs/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})),async pollJobByType(e,t){return"circle_overlap"===t?m(await this.getCircleOverlapStatus(e)):"street_interview"===t?m(await this.get
1StreetInterviewStatus(e)):this.getJobStatus(e)},getVideoUploadUrl:async()=>(console.log("[VideoAPI] Getting video upload presign URL"),f(await (0,i.authenticatedFetch)(`${a}/video-upload-url`,{method:"GET"}))),async uploadVideoFile(e){console.log("[VideoAPI] Uploading video file");let t=await this.getVideoUploadUrl();return await fetch(t.presigned_url,{method:"PUT",headers:{"Content-Type":e.type||"video/mp4"},body:e}).then(e=>{if(!e.ok)throw new d(`S3 video upload failed (${e.status})`,e.status)}),console.log("[VideoAPI] Video upload complete, public URL:",t.public_url),{cdnUrl:t.public_url}},getProductDemoUploadUrl:async e=>(console.log("[VideoAPI] Getting product demo upload URL"),f(await (0,i.authenticatedFetch)(`${c}/upload-url`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({companyDetailsId:e})}))),async uploadProductDemoToS3(e,t){console.log("[VideoAPI] Uploading product demo to S3...");let r=await fetch(e,{method:"PUT",headers:{"Content-Type":t.type||"video/mp4"},body:t});if(!r.ok)throw new d(`S3 product demo upload failed (${r.status})`,r.status);console.log("[VideoAPI] Product demo S3 upload complete")},confirmProductDemo:async(e,t)=>(console.log("[VideoAPI] Confirming product demo:",e),f(await (0,i.authenticatedFetch)(`${c}/${e}/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:t?JSON.stringify({language:t}):void 0}))),startProductDemo:async e=>(console.log("[VideoAPI] POST product-demos/start"),f(await (0,i.authenticatedFetch)(`${c}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}))),getProductDemo:async e=>f(await (0,i.authenticatedFetch)(`${c}/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})),patchProductDemo:async(e,t)=>(console.log("[VideoAPI] Patching product demo:",e),f(await (0,i.authenticatedFetch)(`${c}/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}))),async getProductDemoUgcIdea(e,t,r,o){let a=`${n}/idea?companyDetailsId=${e}&productDemoId=${t}`;r&&(a+=`&actorId=${r}`),o&&(a+=`&language=${o}`),console.log("[VideoAPI] Fetching product demo UGC idea:",a);try{let e=await (0,i.authenticatedFetch)(a,{method:"GET",headers:{"Content-Type":"application/json"}}),t=await f(e);return console.log("[VideoAPI] Product demo UGC idea response:",t),t}catch(e){throw console.error("[VideoAPI] ❌ Failed to fetch product demo UGC idea:",e),e}}};function m(e){return{job_id:e.job_id,status:e.status,result:e.output?{video_s3_url:e.output,video_url:e.output,thumbnail_url:e.thumbnail??void 0,caption_s3url:e.caption_videos??void 0}:void 0,error:e.message??void 0,updated_at:e.updated_at}}function v(e){return e instanceof d||e instanceof Error?e.message:"string"==typeof e?e:"Failed to start video generation. Please try again."}e.s(["PlacementWarningError",()=>u,"getVideoApiErrorMessage",()=>v,"videoApi",0,y],33918);var b=e.i(48131);let w=["completed","failed","error"],S=(0,t.create)()((0,r.persist)((e,t)=>({activeJobs:{},isStarting:!1,startError:null,optimisticVideos:[],videos:[],totalVideos:0,libraryPage:1,libraryLimit:20,isLoadingLibrary:!1,libraryError:null,lastLibraryFetch:null,cachedVideoCount:0,captionPreferences:{},isGenerationBoxExpanded:!1,selectedVideoType:null,ugcIdea:null,isLoadingIdea:!1,ideaError:null,productImage:{file:null,previewUrl:null,cdnUrl:null,resourceId:null,promptAnalysis:null,status:"idle",error:null},productVideo:{file:null,previewUrl:null,cdnUrl:null,resourceId:null,ugcAngle:null,scenes:null,status:"idle",error:null},startVideoGeneration:async t=>{let r=`optimistic_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,i=t.name||t.prompt.slice(0,80)||"Generated Video",o=45===t.duration?45:30===t.duration?30:15;e(e=>({optimisticVideos:[{id:r,name:i,prompt:t.prompt,createdAt:new Date().toISOString(),targetDurationSec:o},...e.optimisticVideos],isStarting:!0,startError:null}));try{console.log("[VideoStore] Starting video job:",t);let a=await y.startVideoJob(t);console.log("[VideoStore] Job started successfully:",a.job_id),(0,b.trackVideoGenerationSuccess)(a.job_id),e(e=>{let t={...e.activeJobs};return t[a.job_id]={job_id:a.job_id,name:i,status:a.status,created_at:new Date().toISOString(),targetDurationSec:o},{activeJobs:t,optimisticVideos:e.optimisticVideos.filter(e=>e.id!==r),isStarting:!1,startError:null}})}catch(i){console.error("[VideoStore] Failed to start job:",i);let t=i instanceof Error?i.message:"Failed to start video generation";throw e(e=>({optimisticVideos:e.optimisticVideos.filter(e=>e.id!==r),isStarting:!1,startError:t})),i}},startCircleOverlapGeneration:async t=>{let r=`optimistic_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,i=t.prompt?.slice(0,80)||"Spotlight Video",o=(t.duration??15)>=45?45:(t.duration??15)>=30?30:15;e(e=>({optimisticVideos:[{id:r,name:i,prompt:t.prompt||"",createdAt:new Date().toISOString(),targetDurationSec:o},...e.optimisticVideos],isStarting:!0,startError:null}));try{let a=await y.startCircleOverlap(t);(0,b.trackVideoGenerationSuccess)(a.job_id),e(e=>{let t={...e.activeJobs};return t[a.job_id]={job_id:a.job_id,name:i,status:a.status,created_at:new Date().toISOString(),targetDurationSec:o,videoType:"circle_overlap"},{activeJobs:t,optimisticVideos:e.optimisticVideos.filter(e=>e.id!==r),isStarting:!1,startError:null}})}catch(t){throw console.error("[VideoStore] Failed to start circle overlap job:",t),e(e=>({optimisticVideos:e.optimisticVideos.filter(e=>e.id!==r),isStarting:!1,startError:t instanceof Error?t.message:"Failed to start video generation"})),t}},startStreetInterviewGeneration:async t=>{let r=`optimistic_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,i=t.payload.product_context.slice(0,80)||"Street Interview";e(e=>({optimisticVideos:[{id:r,name:i,prompt:t.payload.product_context,createdAt:new Date().toISOString(),targetDurationSec:30},...e.optimisticVideos],isStarting:!0,startError:null}));try{let o=await y.startStreetInterview(t);(0,b.trackVideoGenerationSuccess)(o.job_id),e(e=>{let t={...e.activeJobs};return t[o.job_id]={job_id:o.job_id,name:i,status:o.status,created_at:new Date().toISOString(),targetDurationSec:30,videoType:"street_interview"},{activeJobs:t,optimisticVideos:e.optimisticVideos.filter(e=>e.id!==r),isStarting:!1,startError:null}})}catch(t){throw console.error("[VideoStore] Failed to start street interview job:",t),e(e=>({optimisticVideos:e.optimisticVideos.filter(e=>e.id!==r),isStarting:!1,startError:t instanceof Error?t.message:"Failed to start video generation"})),t}},updateJobStatus:(t,r)=>
1{e(e=>e.activeJobs[t]&&e.activeJobs[t].status!==r?{activeJobs:{...e.activeJobs,[t]:{...e.activeJobs[t],status:r}}}:e)},removeJob:t=>{console.log("[VideoStore] Removing job:",t),e(e=>{let{[t]:r,...i}=e.activeJobs;return{activeJobs:i}})},removeOptimisticVideo:t=>{e(e=>({optimisticVideos:e.optimisticVideos.filter(e=>e.id!==t)}))},promoteOptimisticToJob:(t,r,i)=>{e(e=>{let o=e.optimisticVideos.find(e=>e.id===t);if(!o)return e;let a={...e.activeJobs};return a[r]={job_id:r,name:o.name,status:i,created_at:o.createdAt,targetDurationSec:o.targetDurationSec},{activeJobs:a,optimisticVideos:e.optimisticVideos.filter(e=>e.id!==t)}})},fetchLibrary:async(r=1,i=20)=>{let{isLoadingLibrary:o}=t();if(!o){e({isLoadingLibrary:!0,libraryError:null});try{let t=await y.getUserVideos(r,i);e({videos:t.videos,totalVideos:t.total,libraryPage:t.page,libraryLimit:t.limit,isLoadingLibrary:!1,lastLibraryFetch:Date.now(),cachedVideoCount:t.total})}catch(t){console.error("[VideoStore] Failed to fetch library:",t),e({isLoadingLibrary:!1,libraryError:t instanceof Error?t.message:"Failed to load videos"})}}},setVideos:(t,r)=>{e({videos:t,totalVideos:r,cachedVideoCount:r})},invalidateLibrary:()=>{e({lastLibraryFetch:null})},setCaptionPreference:(t,r)=>{e(e=>({captionPreferences:{...e.captionPreferences,[t]:r}}))},setGenerationBoxExpanded:t=>{e({isGenerationBoxExpanded:t})},setSelectedVideoType:t=>{e({selectedVideoType:t})},openGenerationBox:()=>{e({isGenerationBoxExpanded:!0})},fetchUgcIdea:async(t,r,i,o)=>{e({isLoadingIdea:!0,ideaError:null,ugcIdea:null});try{let a=await y.getUgcIdea(t,r,i,o);e({ugcIdea:a.data?.idea??null,isLoadingIdea:!1})}catch(t){console.error("[VideoStore] Failed to fetch UGC idea:",t),e({isLoadingIdea:!1,ideaError:t instanceof Error?t.message:"Failed to generate idea"})}},clearUgcIdea:()=>{e({ugcIdea:null,ideaError:null})},uploadProductImage:async(t,r)=>{let i=URL.createObjectURL(t);e({productImage:{file:t,previewUrl:i,cdnUrl:null,resourceId:null,promptAnalysis:null,status:"uploading",error:null}});try{let o=t.name.split(".").pop()?.toLowerCase()||"jpg",a=await y.getPresignUrl(o);await y.uploadToS3(a.upload.url,a.upload.requiredHeaders,t),e(e=>({productImage:{...e.productImage,status:"analyzing"}}));let n=await y.confirmUpload(a.resourceId,a.key,r);e({productImage:{file:t,previewUrl:i,cdnUrl:n.image_cdn_url,resourceId:n.resourceId,promptAnalysis:n.prompt_analysis,status:"analyzed",error:null}}),console.log("[VideoStore] Product image analyzed:",n.image_cdn_url)}catch(t){console.error("[VideoStore] Product image upload failed:",t),e(e=>({productImage:{...e.productImage,status:"error",error:t instanceof Error?t.message:"Upload failed"}}))}},updatePromptAnalysis:t=>{e(e=>({productImage:{...e.productImage,promptAnalysis:t}}))},clearProductImage:()=>{let{productImage:r}=t();r.previewUrl&&URL.revokeObjectURL(r.previewUrl),e({productImage:{file:null,previewUrl:null,cdnUrl:null,resourceId:null,promptAnalysis:null,status:"idle",error:null}})},uploadProductVideo:async(t,r,i)=>{let o=URL.createObjectURL(t);e({productVideo:{file:t,previewUrl:o,cdnUrl:null,resourceId:null,ugcAngle:null,scenes:null,status:"uploading",error:null}});try{let a=await y.getProductDemoUploadUrl(r),n=a.data.id,s=a.data.presignedUrl;await y.uploadProductDemoToS3(s,t),e(e=>({productVideo:{...e.productVideo,status:"analyzing",resourceId:n}})),await y.confirmProductDemo(n,i);let l=0,c=async()=>{if(++l>60)throw Error("Analysis timed out — please try again");let r=await y.getProductDemo(n),i=r.data.status;if("completed"===i){e({productVideo:{file:t,previewUrl:o,cdnUrl:null,resourceId:n,ugcAngle:r.data.ugc_angle??null,scenes:r.data.scenes??null,status:"analyzed",error:null}}),console.log("[VideoStore] Product demo analyzed, ugc_angle:",r.data.ugc_angle);return}if("failed"===i)throw Error("string"==typeof r.data.error&&r.data.error||"Analysis failed — please try again");return await new Promise(e=>setTimeout(e,2500)),c()};await c()}catch(t){console.error("[VideoStore] Product demo upload failed:",t),e(e=>({productVideo:{...e.productVideo,status:"error",error:t instanceof Error?t.message:"Upload failed"}}))}},generateProductVideo:async(t,r)=>
1{e({productVideo:{file:null,previewUrl:null,cdnUrl:null,resourceId:null,ugcAngle:null,scenes:null,status:"generating",error:null}});try{let i=(await y.startProductDemo({companyDetailsId:t,...r?{instructions:r}:{}})).id;if(!i)throw Error("Backend did not return a demo id");e(e=>({productVideo:{...e.productVideo,resourceId:i}}));let o=Date.now(),a=async()=>{if(Date.now()-o>6e5)throw Error("Demo generation timed out — please try again");let t=await y.getProductDemo(i),r=t.data.status,n="string"==typeof t.data.file_url?t.data.file_url:null;if("completed"===r){e({productVideo:{file:null,previewUrl:n,cdnUrl:n,resourceId:i,ugcAngle:t.data.ugc_angle??null,scenes:t.data.scenes??null,status:"analyzed",error:null}}),console.log("[VideoStore] Auto-generated product demo ready:",n);return}if("failed"===r){let e="string"==typeof t.data.error_message&&t.data.error_message||"string"==typeof t.data.error&&t.data.error||"Demo generation failed — please try again";throw Error(e)}return await new Promise(e=>setTimeout(e,4e3)),a()};await a()}catch(t){console.error("[VideoStore] Product demo auto-generation failed:",t),e(e=>({productVideo:{...e.productVideo,status:"error",error:t instanceof Error?t.message:"Demo generation failed"}}))}},updateProductVideoUgcAngle:t=>{e(e=>({productVideo:{...e.productVideo,ugcAngle:t}}))},patchProductDemoUgcAngle:async(e,t)=>{try{await y.patchProductDemo(e,{ugc_angle:t}),console.log("[VideoStore] Product demo ugc_angle patched")}catch(e){console.error("[VideoStore] Failed to patch product demo:",e)}},clearProductVideo:()=>{let{productVideo:r}=t();r.previewUrl&&URL.revokeObjectURL(r.previewUrl),e({productVideo:{file:null,previewUrl:null,cdnUrl:null,resourceId:null,ugcAngle:null,scenes:null,status:"idle",error:null}})},fetchProductDemoUgcIdea:async(t,r,i,o)=>{e({isLoadingIdea:!0,ideaError:null,ugcIdea:null});try{let a=await y.getProductDemoUgcIdea(t,r,i,o);e({ugcIdea:a.data?.idea??null,isLoadingIdea:!1})}catch(t){console.error("[VideoStore] Failed to fetch product demo UGC idea:",t),e({isLoadingIdea:!1,ideaError:t instanceof Error?t.message:"Failed to generate idea"})}},cleanupOldJobs:()=>{let t=Date.now()-864e5;e(e=>{let r=Object.entries(e.activeJobs),i=r.filter(([,e])=>{let r=w.includes(e.status),i=new Date(e.created_at).getTime();return!r||i>t});if(i.length===r.length)return e;let o={};return i.forEach(([e,t])=>{o[e]=t}),{activeJobs:o}})},reset:()=>{let{productImage:r,productVideo:i}=t();r.previewUrl&&URL.revokeObjectURL(r.previewUrl),i.previewUrl&&URL.revokeObjectURL(i.previewUrl),e({activeJobs:{},isStarting:!1,startError:null,optimisticVideos:[],videos:[],totalVideos:0,isLoadingLibrary:!1,libraryError:null,lastLibraryFetch:null,isGenerationBoxExpanded:!1,selectedVideoType:null,ugcIdea:null,isLoadingIdea:!1,ideaError:null,productImage:{file:null,previewUrl:null,cdnUrl:null,resourceId:null,promptAnalysis:null,status:"idle",error:null},productVideo:{file:null,previewUrl:null,cdnUrl:null,resourceId:null,ugcAngle:null,scenes:null,status:"idle",error:null}})}}),{name:"palmador_video_store",storage:(0,r.createJSONStorage)(()=>localStorage),partialize:e=>({activeJobs:e.activeJobs,cachedVideoCount:e.cachedVideoCount,captionPreferences:e.captionPreferences})})),I=null;function P(){I||(S.getState().cleanupOldJobs(),I=setInterval(()=>{S.getState().cleanupOldJobs()},36e5))}function V(){I&&(clearInterval(I),I=null)}e.s(["startJobCleanup",()=>P,"stopJobCleanup",()=>V,"useVideoStore",0,S],86033)},8341,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i={cancelIdleCallback:function(){return n},requestIdleCallback:function(){return a}};for(var o in i)Object.defineProperty(r,o,{enumerable:!0,get:i[o]});let a="u">typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},n="u">typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esMo
1dule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},79520,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i={default:function(){return b},handleClientScriptLoad:function(){return y},initScriptLoader:function(){return m}};for(var o in i)Object.defineProperty(r,o,{enumerable:!0,get:i[o]});let a=e.r(55682),n=e.r(90809),s=e.r(43476),l=a._(e.r(74080)),c=n._(e.r(71645)),d=e.r(42732),u=e.r(22737),p=e.r(8341),h=new Map,f=new Set,g=e=>{let{src:t,id:r,onLoad:i=()=>{},onReady:o=null,dangerouslySetInnerHTML:a,children:n="",strategy:s="afterInteractive",onError:c,stylesheets:d}=e,p=r||t;if(p&&f.has(p))return;if(h.has(t)){f.add(p),h.get(t).then(i,c);return}let g=()=>{o&&o(),f.add(p)},y=document.createElement("script"),m=new Promise((e,t)=>{y.addEventListener("load",function(t){e(),i&&i.call(this,t),g()}),y.addEventListener("error",function(e){t(e)})}).catch(function(e){c&&c(e)});a?(y.innerHTML=a.__html||"",g()):n?(y.textContent="string"==typeof n?n:Array.isArray(n)?n.join(""):"",g()):t&&(y.src=t,h.set(t,m)),(0,u.setAttributesFromProps)(y,e),"worker"===s&&y.setAttribute("type","text/partytown"),y.setAttribute("data-nscript",s),d&&(e=>{if(l.default.preinit)return e.forEach(e=>{l.default.preinit(e,{as:"style"})});if("u">typeof window){let t=document.head;e.forEach(e=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,t.appendChild(r)})}})(d),document.body.appendChild(y)};function y(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,p.requestIdleCallback)(()=>g(e))}):g(e)}function m(e){e.forEach(y),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");f.add(t)})}function v(e){let{id:t,src:r="",onLoad:i=()=>{},onReady:o=null,strategy:a="afterInteractive",onError:n,stylesheets:u,...h}=e,{updateScripts:y,scripts:m,getIsSsr:v,appDir:b,nonce:w}=(0,c.useContext)(d.HeadManagerContext);w=h.nonce||w;let S=(0,c.useRef)(!1);(0,c.useEffect)(()=>{let e=t||r;S.current||(o&&e&&f.has(e)&&o(),S.current=!0)},[o,t,r]);let I=(0,c.useRef)(!1);if((0,c.useEffect)(()=>{if(!I.current){if("afterInteractive"===a)g(e);else"lazyOnload"===a&&("complete"===document.readyState?(0,p.requestIdleCallback)(()=>g(e)):window.addEventListener("load",()=>{(0,p.requestIdleCallback)(()=>g(e))}));I.current=!0}},[e,a]),("beforeInteractive"===a||"worker"===a)&&(y?(m[a]=(m[a]||[]).concat([{id:t,src:r,onLoad:i,onReady:o,onError:n,...h,nonce:w}]),y(m)):v&&v()?f.add(t||r):v&&!v()&&g({...e,nonce:w})),b){if(u&&u.forEach(e=>{l.default.preinit(e,{as:"style"})}),"beforeInteractive"===a)if(!r)return h.dangerouslySetInnerHTML&&(h.children=h.dangerouslySetInnerHTML.__html,delete h.dangerouslySetInnerHTML),(0,s.jsx)("script",{nonce:w,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([0,{...h,id:t}])})`}});else return l.default.preload(r,h.integrity?{as:"script",integrity:h.integrity,nonce:w,crossOrigin:h.crossOrigin}:{as:"script",nonce:w,crossOrigin:h.crossOrigin}),(0,s.jsx)("script",{nonce:w,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([r,{...h,id:t}])})`}});"afterInteractive"===a&&r&&l.default.preload(r,h.integrity?{as:"script",integrity:h.integrity,nonce:w,crossOrigin:h.crossOrigin}:{as:"script",nonce:w,crossOrigin:h.crossOrigin})}return null}Object.defineProperty(v,"__nextScript",{value:!0});let b=v;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},3303,(e,t,r)=>{t.exports=e.r(79520)},58994,e=>{"use strict";e.i(47167);var t=e.i(43476),r=e.i(71645),i=e.i(3303),o=e.i(18566),a=e.i(68200);let n={product:"palmador",alignment:"left",horizontal_padding:20,vertical_padding:20,background_color:"#F40752",action_color:"#4732C9"},s=["/dashboard","/callback"],l=(0,r.createContext)(void 0),c="lj9no98u";e.s(["IntercomProvider",0,({children:e})=>{let{user:d,isAuthenticated:u}=(0,a.useAuth)(),p=(0,o.usePathname)(),h=(0,r.useRef)(!1),f=(0,r.useCallback)((e,...t)=>{window.Intercom&&window.Intercom(e,...t)},[]);(0,r.useEffect)(()=>
1{if(u&&d){let e={app_id:c,user_id:d.id,name:d.name,email:d.email,created_at:d.created_at?Math.floor(new Date(d.created_at).getTime()/1e3):void 0,...n};h.current?f("update",e):(f("boot",e),h.current=!0)}else!u&&h.current?(f("shutdown"),f("boot",{app_id:c,...n})):h.current||(f("boot",{app_id:c,...n}),h.current=!0)},[u,d,f]),(0,r.useEffect)(()=>{var e;let t=p.split("/");f("update",{hide_default_launcher:(e=t.length>2?"/"+t.slice(2).join("/"):t[1]?"/"+t[1]:"/",s.some(t=>{if(t.endsWith("/*")){let r=t.slice(0,-2);return e===r||e.startsWith(`${r}/`)}return e===t}))})},[p,f]),(0,r.useEffect)(()=>()=>{h.current&&(f("shutdown"),h.current=!1)},[f]),(0,r.useEffect)(()=>{f("update")},[p,f]);let g=(0,r.useCallback)(()=>f("show"),[f]),y=(0,r.useCallback)(()=>f("hide"),[f]),m=(0,r.useCallback)(e=>f("showNewMessage",e??""),[f]),v=(0,r.useCallback)((e,t)=>f("trackEvent",e,t),[f]),b=(0,r.useCallback)(e=>f("update",e),[f]);return(0,t.jsxs)(l.Provider,{value:{show:g,hide:y,showNewMessage:m,trackEvent:v,update:b},children:[c&&(0,t.jsx)(i.default,{id:"intercom-widget",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:`
2              (function(){
3                var w=window;var ic=w.Intercom;
4                if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}
5                else{
6                  var d=document;var i=function(){i.c(arguments);};
7                  i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;
8                  var l=function(){
9                    var s=d.createElement('script');s.type='text/javascript';s.async=true;
10                    s.src='https://widget.intercom.io/widget/${c}';
11                    var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);
12                  };
13                  if(document.readyState==='complete'){l();}
14                  else if(w.attachEvent){w.attachEvent('onload',l);}
15                  else{w.addEventListener('load',l,false);}
16                }
17              })();
18            `}}),e]})},"useIntercom",0,()=>{let e=(0,r.useContext)(l);if(void 0===e)throw Error("useIntercom must be used within an IntercomProvider");return e}],58994)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.