1"use strict";(globalThis.webpackChunkao_react_app||=[]).push([[8170],{37988(e,t,r){r.d(t,{A:()=>w});var n=r(9950),o=r(99163),i=r(32127),a=r(70974);const s=["sky","rose","mint","night"],c="appopener:stage-theme";let l="night",d=!1;function u(){if(d)return l;try{const e=sessionStorage.getItem("appo.stage.theme");return s.includes(e)?e:"night"}catch{return l}}function p(){const[e,t]=(0,n.useState)(u);(0,n.useEffect)(()=>{const e=e=>{var r;s.includes(null===(r=e.detail)||void 0===r?void 0:r.theme)&&t(e.detail.theme)},r=e=>{e.key&&"appo.stage.theme"!==e.key||t(u())};return window.addEventListener(c,e),window.addEventListener("storage",r),()=>{window.removeEventListener(c,e),window.removeEventListener("storage",r)}},[]);return[e,(0,n.useCallback)(e=>{s.includes(e)&&(t(e),function(e){if(s.includes(e)){l=e;try{sessionStorage.setItem("appo.stage.theme",e),d=!1}catch{d=!0}"undefined"!==typeof window&&window.dispatchEvent(new CustomEvent(c,{detail:{theme:e}}))}}(e))},[])]}var h=r(44414);const m=(0,n.lazy)(()=>Promise.all([r.e(7669),r.e(9323),r.e(1912)]).then(()=>r(68414)));class f extends n.Component{constructor(){super(...arguments),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,h.jsx)("p",{role:"alert",children:"The Story editor could not load. Your saved link and QR are still available. Close this kit and try again."}):this.props.children}}function w(e){let{target:t,onClose:r,onCloseAutoFocus:s}=e;const c=(0,n.useRef)(null),[l,d]=(0,n.useState)(""),[u]=p();return(0,h.jsx)(i.lG,{open:!0,onOpenChange:e=>{e||r()},children:(0,h.jsxs)(i.Cf,{"data-stage-theme":u,className:"appo-story-dialog paid-launch-kit w-[calc(100%_-_24px)] max-w-[980px] max-h-[94dvh] overflow-y-auto rounded-2xl border border-sky-200/25 bg-[#0b1424] p-4 text-white sm:p-6",onCloseAutoFocus:s,children:[(0,h.jsxs)(i.c7,{className:"pr-10 text-left",children:[(0,h.jsx)(i.L3,{children:"Your launch kit"}),(0,h.jsx)(i.rr,{className:"text-slate-200",children:"Story PNG + QR, included. Nothing posts automatically."})]}),(0,h.jsx)("p",{className:"paid-launch-note rounded-xl border p-3 text-sm",role:"note",children:"sandbox"===t.mode?"Sandbox test \xb7 no real-money purchase.":"Payment confirmed \xb7 link delivered."}),(0,h.jsxs)("details",{className:"paid-launch-details",children:[(0,h.jsx)("summary",{children:"Saved link & QR"}),(0,h.jsxs)("section",{"aria-label":"Your saved link and QR",className:"paid-launch-saved grid min-w-0 gap-3 rounded-xl border p-3 sm:grid-cols-[1fr_auto]",children:[(0,h.jsxs)("div",{className:"min-w-0",children:[(0,h.jsx)("p",{className:"paid-launch-label text-xs uppercase tracking-wider",children:"Exact saved link"}),(0,h.jsx)("p",{className:"paid-launch-url break-all text-sm",children:t.url}),(0,h.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,h.jsx)("button",{type:"button",className:"min-h-[44px] rounded-xl border border-sky-200/40 px-3 text-sm",onClick:async()=>{try{await navigator.clipboard.writeText(t.url),d("Saved link copied.")}catch{d("Copy is unavailable. Select the saved link above to copy it.")}},children:"Copy saved link"}),(0,h.jsx)("button",{type:"button",className:"min-h-[44px] rounded-xl border border-sky-200/40 px-3 text-sm",onClick:()=>{try{var e;const r=null===(e=c.current)||void 0===e?void 0:e.querySelector("svg");if(!r)throw new Error;(0,a.NH)(new Blob([(new XMLSerializer).serializeToString(r)],{type:"image/svg+xml"}),`appopener-${t.linkId}-qr.svg`),d("QR download requested. It opens your exact saved link.")}catch{d("The QR could not download. Your link is unchanged; try again.")}},children:"Download QR SVG"})]})]}),(0,h.jsx)("div",{ref:c,className:"justify-self-start rounded-lg bg-white p-2",children:(0,h.jsx)(o.h,{value:t.url,size:144,level:"M",marginSize:4,title:"QR for your exact saved link"})})]}),(0,h.jsx)("p",{className:"paid-launch-explainer text-sm",children:"No extra charge. Story premium upgrades are not included. Your PNG is a still image, not a video or a clickable image."})]}),l&&(0,h.jsx)("p",{role:"status",className:"paid-launch-notice text-sm",children:l}),(0,h.jsx)("p",{className:"paid-launch-explainer text-sm",children:"1080 \xd7 1920 PNG. Add your saved link as a sticker when you post."}),(0,h.jsx)(f,{children:(0,h.jsx)(n.Suspense,{fallback:(0,h.jsx)("p",{role:"status",children:"Loading your Story tools\u2026"}),children:(0,h.jsx)(m,{url:t.url,videoId:t.linkId,headline:"Your next chapter starts here.",premium:!1,onRequestUnlock:()=>d("That Story option requires separate existing premium access. No upgrade or payment is started here; the free layouts and PNG export remain available.")})})})]})})}},91373(e,t,r){r.d(t,{A:()=>a});var n=r(9950),o=r(31406),i=r(50540);function a(e){const t=(0,o.sB)(),r=(0,n.useRef)(null),a=(0,n.useRef)({user:null,revision:0});r.current=(null===t||void 0===t?void 0:t.user)||null;const s=null!==e&&void 0!==e&&e.loading?null:(0,i.xE)(e,t);return a.current.user!==(null===s||void 0===s?void 0:s.user)&&(a.current={user:null===s||void 0===s?void 0:s.user,revision:a.current.revision+1}),null!==s&&void 0!==s&&s.user?{...s,currentUser:()=>r.current,sessionKey:`${s.key}:${a.current.revision}`}:s}},33949(e,t,r){r.d(t,{oI:()=>d,vE:()=>c,Rf:()=>u});const n=/(?:token|password|passwd|secret|credential|signature|authorization|session|access.?key|api.?key|upi|vpa|pin|otp|jwt|payment|order.?id|recovery)/i,o=/(?:^|\.)(?:localhost|local|localdomain|internal|intranet|lan|home|home\.arpa|test|invalid|onion|nip\.io|sslip\.io|localtest\.me|lvh\.me)$/i,i=/[A-Za-z0-9._-]+@[A-Za-z][A-Za-z0-9.-]+/;var a=r(17102);const s="appo.link-maker.destination.v1";function c(e){try{return(0,a.Z9)(e),decodeURIComponent(e),function(e){if("string"!==typeof e||!e||e.length>2048||/[\s\\\u0000-\u001f\u007f]/.test(e))throw new Error("Add a complete public link of at most 2,048 characters without spaces or control characters.");let t;try{t=new URL(e)}catch{throw new Error("Add the complete http:// or https:// link.")}const r=t.hostname.replace(/\.$/,"").toLowerCase();if(!["https:","http:"].includes(t.protocol)||t.username||t.password||t.port||!r.includes(".")||/^\d+(?:\.\d+){3}$/.test(r)||r.includes(":")||r.length>253||o.test(r)||r.split(".").some(e=>!/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(e)))throw new Error("Use a public web link without credentials, private addresses or custom ports.");for(const o of[t.pathname,t.search,t.hash]){let e=o;for(let r=0;r<4;r++){if(/[\u0000-\u001f\u007f\\]/.test(e)||i.test(e))throw new Error("Remove private addresses or control characters before saving this link.");
1if(o!==t.pathname)for(const[t]of new URLSearchParams(e.replace(/^[?#]/,""))){const e=t.replace(/[^a-z0-9]/gi,"");if(n.test(e)||/^(?:code|key|auth)$/i.test(e))throw new Error("Remove private access, payment or sign-in information before saving this link.")}if(!/%[a-f0-9]{2}/i.test(e))break;try{e=decodeURIComponent(e)}catch{throw new Error("Use a valid public link without malformed encoded fields.")}if(3===r)throw new Error("Use a public link without repeatedly encoded private fields.")}}if(t.hostname=r,t.href.length>2048)throw new Error("Keep the public destination within 2,048 characters.");t.href}(e),e}catch{return""}}function l(){try{return window.sessionStorage}catch{return null}}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l();try{const t=c(null===e||void 0===e?void 0:e.getItem(s));return t||null===e||void 0===e||e.removeItem(s),t}catch{return""}}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l();const r=c(e);try{return r?null===t||void 0===t||t.setItem(s,r):null===t||void 0===t||t.removeItem(s),Boolean(r&&t)}catch{return!1}}},91475(e,t,r){r.d(t,{Z:()=>o});var n=r(50540);function o(e){try{const t=(0,n.vH)({order:e}).order;if("paid"!==t.status||!t.link||!0===t.paidRevoked||!0===t.link.paidRevoked||!0===t.link.revoked)return null;const{id:r,url:o}=t.link;return{key:JSON.stringify([t.id,t.product,t.mode,r,o]),orderId:t.id,linkId:r,url:o,mode:t.mode,title:n.EX[t.product].title}}catch{return null}}},50540(e,t,r){r.d(t,{A4:()=>f,Io:()=>c,bz:()=>p,dE:()=>u,kf:()=>m,lg:()=>s,vH:()=>h,xE:()=>d});var n=r(33949);const o={app:{title:"Your app page",amountPaise:1100},a4:{title:"Your four-link showcase",amountPaise:2500},direct:{title:"Your direct link",amountPaise:4500}},i=e=>"ad-free"===e?"direct":e,a="appo.paid-link.public-draft.v1";function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{if(!(0,n.vE)(e))return;const r={destination:new URL(e).href,picks:t.slice(0,4).map(e=>(0,n.vE)(e)?e:"")};window.sessionStorage.setItem(a,JSON.stringify(r))}catch{}}function c(e){try{const t=window.sessionStorage.getItem(a);if(!t||t.length>12e3)return["","","",""];const r=JSON.parse(t);if(r.destination===new URL(e).href&&Array.isArray(r.picks))return[0,1,2,3].map(e=>(0,n.vE)(r.picks[e])?r.picks[e]:"")}catch{}return["","","",""]}const l="Secure paid-link checkout is not enabled here yet. Your free links and phone previews still work.";function d(e,t){var r,n,o;return null!==e&&void 0!==e&&null!==(r=e.member)&&void 0!==r&&r.id&&e.memberToken?{key:`member:${e.member.id}`,token:e.memberToken}:null!==e&&void 0!==e&&null!==(n=e.user)&&void 0!==n&&n.mobile&&e.token?{key:`legacy:${String(e.user.mobile).replace(/\D/g,"").replace(/^91(?=\d{10}$)/,"")}`,token:e.token}:/^[A-Za-z0-9_-]{1,128}$/.test((null===t||void 0===t||null===(o=t.user)||void 0===o?void 0:o.uid)||"")&&"function"===typeof t.user.getIdToken?{key:`profile:${t.user.uid}`,user:t.user}:null}function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e=i(e),!o[e]||!(0,n.vE)(t))throw new Error("Enter a public link before choosing a paid format.");const a="a4"===e?r.map(e=>e.trim()).filter(Boolean):[];if("a4"===e&&(!a.length||a.length>4||a.some(e=>!(0,n.vE)(e))))throw new Error("Add one to four public links to your showcase.");return{product:e,destination:new URL(t).href,picks:a.map(e=>new URL(e).href)}}function p(e){if("paid-links-v1"!==(null===e||void 0===e?void 0:e.contract)||!Array.isArray(e.products))throw new Error(l);if("paid-links-restored-inr-v2"!==e.priceVersion)throw new Error("Paid-link prices are updating. Refresh before continuing.");if(!0!==e.enabled||!0!==e.checkoutEnabled)throw new Error(l);if(!["sandbox","production"].includes(e.mode))throw new Error(l);if(Object.entries(o).some(t=>{let[r,n]=t;return!e.products.some(e=>e.id===r&&e.amountPaise===n.amountPaise&&"INR"===e.currency)}))throw new Error("Paid-link prices have changed. Checkout is paused; refresh before continuing.");return e}function h(e,t,r){var n;const i=null===e||void 0===e?void 0:e.order,a="legacy-payment-receipt-v1"===(null===i||void 0===i?void 0:i.priceVersion),s=a?o[i.product]&&Number.isSafeInteger(i.amountPaise)&&i.amountPaise>0&&i.amountPaise<=1e8&&["INR","USD"].includes(i.currency):(null===(n={app:[1100],a4:[2500,4500],direct:[4500,5e4]}[null===i||void 0===i?void 0:i.product])||void 0===n?void 0:n.includes(null===i||void 0===i?void 0:i.amountPaise))&&"INR"===(null===i||void 0===i?void 0:i.currency);if(!i||"string"!==typeof i.id||!/^[A-Za-z0-9_-]{6,100}$/.test(i.id)||!s||!["pending","paid","expired","refunded"].includes(i.status))throw new Error("The order
1could not be confirmed. Check My paid links before paying again.");if(a&&(e.checkout||!["paid","refunded"].includes(i.status)))throw new Error("A recovered receipt cannot start another payment.");if(t&&(i.product!==t.product||i.destination!==t.destination||JSON.stringify(i.picks||[])!==JSON.stringify(t.picks)))throw new Error("This order belongs to a different link. Check My paid links; no new payment was started.");if(r&&i.id!==r)throw new Error("The server returned a different order. No payment was started.");if(!["production","sandbox"].includes(i.mode))throw new Error("The order environment is not confirmed.");const c=u(i.product,i.destination,i.picks||[]);if(JSON.stringify(c.picks)!==JSON.stringify(i.picks||[]))throw new Error("The stored showcase links could not be confirmed.");if(i.link){const e=new URL(i.link.url);if("https:"!==e.protocol||!["appopener.com","www.appopener.com","appopener.net","www.appopener.net"].includes(e.hostname)||e.port||e.username||e.password||e.search||e.hash||!/^\/(?:free\/)?[a-z]+\/(?:a4\/)?pl[a-f0-9]{16,64}$/.test(e.pathname)||e.pathname.split("/").pop()!==i.link.id)throw new Error("The server has not confirmed a safe delivered link. Keep your order reference.");if("paid"===i.status&&i.link.linkType!==("direct"===i.product?"ad-free":"app"))throw new Error("Paid delivery is not confirmed. Check order status.");if("refunded"===i.status&&null!=i.link.linkType)throw new Error("The refunded link status is not confirmed.")}if(e.checkout&&(!["production","sandbox"].includes(e.checkout.mode)||"string"!==typeof e.checkout.paymentSessionId||!e.checkout.paymentSessionId||e.checkout.paymentSessionId.length>4096||"pending"!==i.status))throw new Error("Checkout details could not be confirmed. Check your order status.");if(e.checkout&&e.checkout.mode!==i.mode)throw new Error("The checkout and order environments do not match.");return e}async function m(e){let{token:t,user:r,currentUser:n=()=>r,body:o,signal:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!/^(capabilities|me|orders(?:\/[A-Za-z0-9_-]{6,100}\/(?:verify|resume))?|legacy-orders\/ORDER_[A-Za-z0-9_]{1,100}\/claim)$/.test(e))throw new Error("Invalid paid-link request.");if("capabilities"!==e&&!r&&!/^[A-Za-z0-9._-]{20,8192}$/.test(t||""))throw new Error("Sign in to keep this purchase in your account.");const a=new AbortController,s=()=>a.abort();null!==i&&void 0!==i&&i.aborted&&s(),null===i||void 0===i||i.addEventListener("abort",s,{once:!0});const c=setTimeout(s,2e4);try{if("capabilities"!==e&&r){if(!/^[A-Za-z0-9_-]{1,128}$/.test(r.uid||"")||"function"!==typeof r.getIdToken||e.startsWith("legacy-orders/"))throw new Error("Use your original mobile account to recover an older receipt.");if(t=await r.getIdToken(),!/^[A-Za-z0-9._-]{20,8192}$/.test(t||""))throw new Error("Google did not return a valid account session. Sign in again.")}const i=()=>!a.signal.aborted&&(!r||n()===r);if(!i())throw new Error("Your account session changed. Retry from your current account.");const s=await fetch(`/api/paid-links/${e}`,{method:o?"POST":"GET",headers:{Accept:"application/json",...t?{Authorization:`Bearer ${t}`}:{},...o?{"Content-Type":"application/json"}:{}},...o?{body:JSON.stringify(o)}:{},signal:a.signal,cache:"no-store",credentials:"omit",redirect:"error",referrerPolicy:"no-referrer"});if(!(s.headers.get("content-type")||"").includes("application/json"))throw new Error(l);const c=await async function(e){var t;const r=15e5;if(Number(e.headers.get("content-length"))>r)throw new Error("The account response is too large.");if(null===(t=e.body)||void 0===t||!t.getReader){const t=await e.text();if(t.length>r)throw new Error("The account response is too large.");return JSON.parse(t)}const n=e.body.getReader(),o=new TextDecoder;let i=0,a="";try{for(;;){const{done:e,value:t}=await n.read();if(e)break;if(i+=t.byteLength,i>r)throw await n.cancel(),new Error("The account response is too large.");a+=o.decode(t,{stream:!0})}return JSON.parse(a+o.decode())}finally{n.releaseLock()}}(s);if(!i())throw new Error("Your account session changed. Retry from your current account.");if(!s.ok){const e=new Error([404,503].includes(s.status)?l:401===s.status?"Your session has expired. Sign in again to recover your order.":String(c.error||"The order
1could not be confirmed. Please check its status.").slice(0,220));throw e.status=s.status,e}return c}finally{clearTimeout(c),null===i||void 0===i||i.removeEventListener("abort",s)}}async function f(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0===r)try{r=window.sessionStorage}catch{r=null}const o=(new TextEncoder).encode(JSON.stringify([e,t])),i=`appo.paid-link.retry.${Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",o)),e=>e.toString(16).padStart(2,"0")).join("")}`;let a;try{a=r.getItem(i)}catch{}if(n||!/^[a-f0-9]{32}$/.test(a||"")){a=Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("");try{r.setItem(i,a)}catch{}}return a}r.d(t,["EX",0,o,"kS",0,i])},17102(e,t,r){r.d(t,{Jp:()=>p,PQ:()=>n,Qw:()=>d,Xi:()=>a,Z9:()=>o,mq:()=>u,mx:()=>l});class n extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"invalid";super(e),this.code=t}}function o(e){if("string"!==typeof e)throw new n("Paste a complete public HTTPS URL.");const t=e.trim();if(!t||t.length>2048||/[\\\u0000-\u0020\u007f]/.test(t))throw new n("Use a public HTTPS URL of at most 2,048 characters, without spaces or control characters.");let r;try{r=new URL(t)}catch{throw new n("Include https:// and a public destination, such as a video or profile URL.")}const o=r.hostname.toLowerCase();if("https:"!==r.protocol||r.username||r.password||!o.includes(".")||/^[\d.]+$/.test(o)||o.includes(":")||o.endsWith(".")||/(^|\.)(localhost|local|internal|lan|home|arpa|test|invalid|onion)$/.test(o))throw new n("Use a public HTTPS domain, not a local address, raw IP address or URL containing credentials.");const i=/^(?:access[_-]?token|refresh[_-]?token|token|api[_-]?key|password|secret|signature|sig|authorization|auth|x-amz-.+)$/i;if([...r.searchParams.keys(),...new URLSearchParams(r.hash.slice(1)).keys()].some(e=>i.test(e)))throw new n("Use a public share URL without access tokens, signed credentials or secret parameters.");return r.href}const i=(e,t)=>e===t||e.endsWith(`.${t}`);function a(e){const t=e instanceof URL?e:new URL(e),r=t.hostname.toLowerCase();return i(r,"youtube.com")||i(r,"youtu.be")?{apptype:"Youtube",label:/^\/shorts\//.test(t.pathname)?"YouTube Shorts":"YouTube"}:i(r,"instagram.com")?{apptype:"Instagram",label:"Instagram"}:i(r,"spotify.com")?{apptype:"Spotify",label:"Spotify"}:["t.me","telegram.me","telegram.org"].some(e=>i(r,e))?{apptype:"Telegram",label:"Telegram"}:i(r,"twitter.com")||i(r,"x.com")?{apptype:"Twitter",label:"X / Twitter"}:i(r,"linkedin.com")?{apptype:"Linkedin",label:"LinkedIn"}:"play.google.com"===r?{apptype:"Playstore",label:"Google Play"}:"docs.google.com"===r?{apptype:"Docs",label:"Google Docs"}:i(r,"facebook.com")||i(r,"fb.watch")?{apptype:"Facebook",label:"Facebook"}:{apptype:"Other",label:"Public web link"}}const s=new Map([["youtube","yt"],["yt","yt"],["vr","vr"],["instagram","ig"],["ig","ig"],["spotify","sp"],["sp","sp"],["telegram","tg"],["tg","tg"],["twitter","tw"],["tw","tw"],["linkedin","lk"],["lk","lk"],["playstore","ps"],["ps","ps"],["docs","docs"],["facebook","fb"],["fb","fb"],["other","other"]]),c=new Map([["yt","Youtube"],["vr","Youtube"],["ig","Instagram"],["sp","Spotify"],["tg","Telegram"],["tw","Twitter"],["lk","Linkedin"],["ps","Playstore"],["docs","Docs"],["fb","Facebook"]]);function l(e,t){if(!e||"object"!==typeof e||Array.isArray(e)||"string"!==typeof e.shortid||!/^[A-Za-z0-9_-]{1,128}$/.test(e.shortid)||"string"!==typeof e.tag||"string"!==typeof e.originalURL)throw new n("The service did not return a complete link confirmation. No share URL has been invented.","unconfirmed");const r=o(e.originalURL);if(r!==o(t))throw new n("The returned destination did not match your URL. This result has not been accepted.","unconfirmed");const i=e.tag.trim().toLowerCase();let l=s.get(i);if(!l)throw new n("The service returned an unrecognised redirect type. Link creation is unconfirmed here.","unconfirmed");"youtube"===i&&/^\/shorts\//.test(new URL(r).pathname)&&(l="vr");const d=a(r);if("other"!==l&&c.get(l)!==d.apptype)throw new n("The returned redirect type did not match the destination. This result has not been accepted.","unconfirmed");return{shortUrl:`https://appopener.com/${l}/${e.shortid}`,destination:r,platform:"other"===l?"Public web link":d.label,tag:l,createdAt:(new Date).toISOString(),clicks:null}}function d(e){let t,{localPreview:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!==typeof e||!e.trim())throw new n("Link creation is not configured in this environment. You can still explore the Studio.","configuration");if(!0===r&&"http://127.0.0.1:3101/api/"===e.trim())return"http://127.0.0.1:3101/api/createOpenURL";try{t=new URL(e.trim())}catch{throw new n("The link service configuration is unavailable.","configuration")}if("https:"!==t.protocol||t.username||t.password||t.search||t.hash)throw new n("The link service requires a valid HTTPS configuration.","configuration");return`${t.href.endsWith("/")?t.href:`${t.href}/`}createOpenURL`}async function u(e){var t;if(null===(t=e.headers.get("content-type"))||void 0===t||!t.toLowerCase().includes("application/json"))throw new n("The service returned an unexpected response. Link creation is unconfirmed.","unconfirmed");if(Number(e.headers.get("content-length"))>65536||!e.body)throw new n("The link confirmation was missing or too large.","unconfirmed");const r=e.body.getReader(),o=new TextDecoder;let i=0,a="";for(;;){const e=await r.read();if(e.done)break;if(i+=e.value.byteLength,i>65536)throw await r.cancel(),new n("The service response exceeded the confirmation limit.","unconfirmed");a+=o.decode(e.value,{stream:!0})}a+=o.decode();try{return JSON.parse(a)}
1catch{throw new n("The service returned invalid confirmation data. Link creation is unconfirmed.","unconfirmed")}}function p(e){return JSON.stringify({version:1,scope:"this-browser-session",exportedAt:(new Date).toISOString(),note:"Server-returned links only. Account ownership and click analytics are not established by this export.",links:e.map(e=>({shortUrl:e.shortUrl,destination:e.destination,platform:e.platform,tag:e.tag,createdAt:e.createdAt,clicks:null}))},null,2)}}}]);
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.