@tinkerlandai/indiana-sdk 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +6 -6
- package/README.zh-CN.md +4 -4
- package/THIRD_PARTY_NOTICES.md +0 -1
- package/dist/ai-usage-BzydP8eN.d.ts +11085 -0
- package/dist/chunk-3OSMEG44.js +17 -0
- package/dist/chunk-GA6X57BO.js +1 -0
- package/dist/chunk-GTBD4BJ4.js +11 -0
- package/dist/{chunk-2UFPTDCV.js → chunk-QUW4UOKZ.js} +1 -1
- package/dist/chunk-RMFH5TWV.js +1 -0
- package/dist/chunk-YNUVRZRQ.js +1 -0
- package/dist/funnel-runtime-host-RZRB2CY6.js +1 -0
- package/dist/{funnel-runtime-start-B93fV5gJ.d.ts → funnel-runtime-start-JHA9ES24.d.ts} +63 -29
- package/dist/index.d.ts +108 -53
- package/dist/index.js +1 -1
- package/dist/native-shell.js +1 -1
- package/dist/openrouter.d.ts +3 -2
- package/dist/openrouter.js +1 -1
- package/dist/page.d.ts +12 -12
- package/dist/page.js +1 -1
- package/dist/{paywall-M5CIDUIT.js → paywall-MYBEOVTQ.js} +1 -1
- package/dist/popup.d.ts +254 -1
- package/dist/popup.js +6 -6
- package/dist/{screen-Keau_Qa2.d.ts → screen-16d-xADb.d.ts} +354 -463
- package/dist/server.d.ts +4 -3
- package/dist/server.js +1 -1
- package/dist/src-E2GXK6WA.js +1 -0
- package/dist/visual-editor-agent-FDCV3BXP.js +1 -0
- package/dist/visual.js +1 -1
- package/package.json +3 -2
- package/dist/ai-usage-D9xVKhvu.d.ts +0 -9953
- package/dist/chunk-LFNFVYC2.js +0 -1
- package/dist/chunk-PVJKOUNE.js +0 -11
- package/dist/chunk-TZ6REIUE.js +0 -17
- package/dist/chunk-VTSEZ4GI.js +0 -1
- package/dist/funnel-runtime-host-4PQY2MFC.js +0 -1
- package/dist/src-XEDJAKEB.js +0 -1
- package/dist/visual-editor-agent-PYMKMPY3.js +0 -1
package/dist/chunk-TZ6REIUE.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function G(e){let t=2166136261,n=e.length;for(let r=0;r<n;r++)t^=e.charCodeAt(r),t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24);return t>>>0}function T(e,t,n){return n===2?G(G(e+t)+"")%1e4/1e4:null}function se(e){return e<=0?[]:new Array(e).fill(1/e)}function C(e,t){return e>=t[0]&&e<t[1]}function P(e,t){for(let n=0;n<t.length;n++)if(C(e,t[n]))return n;return-1}function K(e,t,n){t=t===void 0?1:t,t<0?t=0:t>1&&(t=1);let r=se(e);n=n||r,n.length!==e&&(n=r);let o=n.reduce((a,u)=>u+a,0);(o<.99||o>1.01)&&(n=r);let i=0,s=t;return n.map(a=>{let u=i;return i+=a,[u,u+s*a]})}function M(e,t,n){if(!t)return null;let r=t.split("?")[1];if(!r)return null;let o=r.replace(/#.*/,"").split("&").map(i=>i.split("=",2)).filter(([i])=>i===e).map(([,i])=>parseInt(i));return o.length>0&&o[0]>=0&&o[0]<n?o[0]:null}function I(e){try{return e()}catch{return!1}}function E(e){return typeof e=="string"?e:JSON.stringify(e)}function g(e){typeof e=="number"&&(e=e+""),(!e||typeof e!="string")&&(e="0");let t=e.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return t.length===3&&t.push("~"),t.map(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function ie(e){try{let t=e.replace(/([^\\])\//g,"$1\\/");return new RegExp(t)}catch{return}}function N(e,t){if(!t.length)return!1;let n=!1,r=!1;for(let o=0;o<t.length;o++){let i=Ue(e,t[o].type,t[o].pattern);if(t[o].include===!1){if(i)return!1}else n=!0,i&&(r=!0)}return r||!n}function Oe(e,t,n){try{let r=t.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(r="\\/?"+r.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+r+"$","i").test(e)}catch{return!1}}function Le(e,t){try{let n=new URL(t.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),r=[[e.host,n.host,!1],[e.pathname,n.pathname,!0]];return n.hash&&r.push([e.hash,n.hash,!1]),n.searchParams.forEach((o,i)=>{r.push([e.searchParams.get(i)||"",o,!1])}),!r.some(o=>!Oe(o[0],o[1],o[2]))}catch{return!1}}function Ue(e,t,n){try{let r=new URL(e,"https://_");if(t==="regex"){let o=ie(n);return o?o.test(r.href)||o.test(r.href.substring(r.origin.length)):!1}else if(t==="simple")return Le(r,n);return!1}catch{return!1}}function q(e){for(let n of["namespace","status","url","groups"])if(Object.hasOwn(e,n))throw new TypeError(`Retired experiment field: ${n}`);let t=e;if(t.hashVersion!==void 0&&t.hashVersion!==2)throw new TypeError("Only hash version 2 is supported");if(t.filters?.some(n=>n.hashVersion!==2))throw new TypeError("Only hash version 2 is supported")}function $(e){for(let t of Object.values(e)){if(Array.isArray(t))throw new TypeError("Saved groups require typed list or condition entries");if(t&&Object.hasOwn(t,"useEmptyListGroup"))throw new TypeError("Retired saved group field: useEmptyListGroup")}}function ae(e){for(let t of["overrides","groups"])if(Object.hasOwn(e,t))throw new TypeError(`Retired evaluation context field: ${t}`);$(e.savedGroups??{})}var _e=e=>e/2**32|0,De=e=>e>>>0;function ue(e,t,n,r){let o=_e(n),i=De(n);e.setUint32(t,r?i:o,r),e.setUint32(t+4,r?o:i,r)}function ce(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}var W=e=>e?`"${e}" `:"";function je(e,t=""){if(typeof e!="number")throw new TypeError(W(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(W(t)+"expected integer >= 0, got "+e);return e}function H(e,t,n=""){if(ce(e)&&(t===void 0||e.length===t))return e;t!==void 0&&je(t,"length");let r=ce(e),o=t!==void 0?` of length ${t}`:"",i=r?`length=${e.length}`:`type=${typeof e}`,s=W(n)+"expected Uint8Array"+o+", got "+i;throw r?new RangeError(s):new TypeError(s)}var Ge=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},fe=(e,t)=>{Ge(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw new TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw new TypeError(`"${t}.__proto__" is not allowed`)};function J(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function le(e,t){H(e,void 0,"output");let n=t.outputLen;if(!(e.length>=n))throw new RangeError('"output" expected length >= '+n)}function Q(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function O(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function x(e,t){return e<<32-t|e>>>t}var Pe=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Ke=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function de(e){if(H(e),Pe)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Ke[e[n]];return t}function Me(e,t,n="opts"){return fe(e,"defaults"),t!==void 0&&fe(t,n),Object.assign(Object.create(null),e,t)}function he(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=Me({},t,"info");let n=(o,i)=>e(i).update(o).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=o=>e(o),Object.assign(n,t),Object.freeze(n)}var be=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function ge(e,t,n){return e&t^~e&n}function pe(e,t,n){return e&t^e&n^t&n}var L=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,n,r,o){this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=O(this.buffer)}update(t){J(this),H(t);let{view:n,buffer:r,blockLen:o}=this,i=t.length,s=!1;for(let a=0;a<i;){let u=Math.min(o-this.pos,i-a);if(u===o){let f=O(t);for(;o<=i-a;a+=o)this.process(f,a);s=!0;continue}r.set(a===0&&u===i?t:t.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===o&&(this.process(n,0),this.pos=0,s=!0)}return this.length+=t.length,s&&this.roundClean(),this}digestInto(t){J(this),le(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:o,isLE:i}=this,{pos:s}=this;n[s++]=128,n.fill(0,s),this.padOffset>o-s&&(this.process(r,0),n.fill(0)),ue(r,o-8,this.length*8,i),this.process(r,0),this.roundClean();let a=t===n?r:O(t),u=this.outputLen,f=u/4,l=this.get();if(u%4||f>l.length)throw new Error("invalid outputLen");for(let c=0;c<f;c++)a.setUint32(4*c,l[c],i)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneIntoMeta(t){let{buffer:n,length:r,finished:o,destroyed:i,pos:s}=this;return t.destroyed=i,t.finished=o,t.length=r,t.pos=s,s&&t.buffer.set(n),t}clone(){return this._cloneInto()}},xe=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var Ie=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),w=new Uint32Array(64),X=class extends L{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(t,n){super(64,t,8,!1),this.A=n[0]|0,this.B=n[1]|0,this.C=n[2]|0,this.D=n[3]|0,this.E=n[4]|0,this.F=n[5]|0,this.G=n[6]|0,this.H=n[7]|0}get(){let{A:t,B:n,C:r,D:o,E:i,F:s,G:a,H:u}=this;return[t,n,r,o,i,s,a,u]}set(t,n,r,o,i,s,a,u){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=s|0,this.G=a|0,this.H=u|0}_cloneInto(t){return(t||=new this.constructor).set(...this.get()),this._cloneIntoMeta(t)}process(t,n){for(let c=0;c<16;c++,n+=4)w[c]=t.getUint32(n,!1);for(let c=16;c<64;c++){let p=w[c-15],y=w[c-2],A=x(p,7)^x(p,18)^p>>>3,b=x(y,17)^x(y,19)^y>>>10;w[c]=b+w[c-7]+A+w[c-16]|0}let{A:r,B:o,C:i,D:s,E:a,F:u,G:f,H:l}=this;for(let c=0;c<64;c++){let p=x(a,6)^x(a,11)^x(a,25),y=l+p+ge(a,u,f)+Ie[c]+w[c]|0,b=(x(r,2)^x(r,13)^x(r,22))+pe(r,o,i)|0;l=f,f=u,u=a,a=s+y|0,s=i,i=o,o=r,r=y+b|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,u=u+this.F|0,f=f+this.G|0,l=l+this.H|0,this.set(r,o,i,s,a,u,f,l)}roundClean(){Q(w)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Q(this.buffer)}},z=class extends X{constructor(){super(32,xe)}};var ye=he(()=>new z,be(1));var ke=new Map,Y=32,me=new WeakMap,we=new WeakMap;function Ne(e){return de(ye(new TextEncoder().encode(String(e))))}var _=e=>Array.isArray(e)?e.map(_):typeof e=="string"||typeof e=="number"?Ne(e):null,U=e=>typeof e=="string"?e.toLowerCase():e;function Be(e){let t=me.get(e);return t||(t=new Set(e),me.set(e,t)),t}function qe(e){let t=we.get(e);return t||(t=new Set(e.map(U)),we.set(e,t)),t}function We(e){$(e);for(let t of Object.values(e)){let n=t?.type==="list"||t?.type==="hashed"?t.values:null;n&&n.length>=Y&&Be(n)}return e}function k(e,t,n,r){n=n||{},r||$(n),r=r||new Set;for(let[o,i]of Object.entries(t))switch(o){case"$or":if(!ve(e,i,n,r))return!1;break;case"$nor":if(ve(e,i,n,r))return!1;break;case"$and":if(!Ye(e,i,n,r))return!1;break;case"$not":if(k(e,i,n,r))return!1;break;case"$savedGroup":if(!Je(e,i,n,r))return!1;break;default:if(!V(i,Re(e,o),n,!1,r))return!1}return!0}function Je(e,t,n,r){if(!t||typeof t!="object"||Array.isArray(t))return!1;let{id:o,attributeKey:i}=t;if(typeof o!="string"||r.has(o)||i!==void 0&&typeof i!="string")return!1;let s=n[o];if(!s||Array.isArray(s)||typeof s!="object")return!1;let a=new Set(r).add(o);if(s.type==="list"||s.type==="hashed"){let u=i??s.attributeKey;if(typeof u!="string"||!Array.isArray(s.values))return!1;let f=Re(e,u);return v(s.type==="hashed"?_(f):f,s.values)}return s.type==="condition"?!s.condition||typeof s.condition!="object"?!1:k(e,s.condition,n,a):!1}function Re(e,t){let n=t.split("."),r=e;for(let o=0;o<n.length;o++)if(r&&typeof r=="object"&&n[o]in r)r=r[n[o]];else return null;return r}function Se(e,t=!1){let n=`${e}${t?"/i":""}`,r=ke.get(n);return r||(r=new RegExp(e.replace(/([^\\])\//g,"$1\\/"),t?"i":void 0),ke.set(n,r)),r}function V(e,t,n,r=!1,o=new Set){if(typeof e=="string")return r?String(t).toLowerCase()===e.toLowerCase():t+""===e;if(typeof e=="number")return t*1===e;if(typeof e=="boolean")return t!==null&&!!t===e;if(e===null)return t===null;if(Array.isArray(e)||!Te(e))return JSON.stringify(t)===JSON.stringify(e);let i=e;for(let s in i)if(!ze(s,t,i[s],n,o))return!1;return!0}function Te(e){let t=Object.keys(e);return t.length>0&&t.filter(n=>n[0]==="$").length===t.length}function Qe(e){if(e===null)return"null";if(Array.isArray(e))return"array";let t=typeof e;return["string","number","boolean","object","undefined"].includes(t)?t:"unknown"}function Xe(e,t,n,r){if(!Array.isArray(e))return!1;let o=Te(t)?i=>V(t,i,n,!1,r):i=>k(i,t,n,r);for(let i=0;i<e.length;i++)if((e[i]??null)!==null&&o(e[i]))return!0;return!1}function v(e,t,n=!1){if(n){let o;if(t.length>=Y){let i=qe(t);o=s=>{let a=U(s);return!(typeof a=="number"&&Number.isNaN(a))&&i.has(a)}}else o=i=>t.some(s=>U(i)===U(s));return Array.isArray(e)?e.some(i=>o(i)):o(e)}let r=t.length>=Y?(o=>i=>o.has(i))(Be(t)):o=>t.includes(o);return Array.isArray(e)?e.some(o=>r(o)):r(e)}function Ae(e){return e===void 0?[]:e&&typeof e=="object"&&(e.type==="list"||e.type==="hashed")&&Array.isArray(e.values)?e.values:null}function Ee(e,t,n,r=!1,o=new Set){if(!Array.isArray(e))return!1;for(let i=0;i<t.length;i++){let s=!1;for(let a=0;a<e.length;a++)if(V(t[i],e[a],n,r,o)){s=!0;break}if(!s)return!1}return!0}function ze(e,t,n,r,o=new Set){let i=t,s=n;switch(e){case"$veq":return g(t)===g(n);case"$vne":return g(t)!==g(n);case"$vgt":return g(t)>g(n);case"$vgte":return g(t)>=g(n);case"$vlt":return g(t)<g(n);case"$vlte":return g(t)<=g(n);case"$eq":return t===n;case"$ne":return t!==n;case"$lt":return i<s;case"$lte":return i<=s;case"$gt":return i>s;case"$gte":return i>=s;case"$exists":return n?t!=null:t==null;case"$in":return Array.isArray(n)?v(t,n):!1;case"$ini":return Array.isArray(n)?v(t,n,!0):!1;case"$inGroup":{let a=r[n],u=Ae(a);return u===null?!1:v(a?.type==="hashed"?_(t):t,u)}case"$notInGroup":{let a=r[n],u=Ae(a);return u===null?!1:!v(a?.type==="hashed"?_(t):t,u)}case"$nin":return Array.isArray(n)?!v(t,n):!1;case"$nini":return Array.isArray(n)?!v(t,n,!0):!1;case"$not":return!V(n,t,r,!1,o);case"$size":return Array.isArray(t)?V(n,t.length,r,!1,o):!1;case"$elemMatch":return Xe(t,n,r,o);case"$all":return Array.isArray(n)?Ee(t,n,r,!1,o):!1;case"$alli":return Array.isArray(n)?Ee(t,n,r,!0,o):!1;case"$regex":try{return Se(n).test(t)}catch{return!1}case"$regexi":try{return Se(n,!0).test(t)}catch{return!1}case"$type":return Qe(t)===n;default:return!1}}function ve(e,t,n,r){if(!t.length)return!0;for(let o=0;o<t.length;o++)if(k(e,t[o],n,r))return!0;return!1}function Ye(e,t,n,r){for(let o=0;o<t.length;o++)if(!k(e,t[o],n,r))return!1;return!0}function Z(e){return ae(e),{context:e,stack:{evaluatedFeatures:new Set}}}function ee(e){return{...e.attributes,...e.attributeOverrides}}function m(e,t,n){let r=t||"id",o="",i=ee(e);return i[r]&&(o=i[r]),!o&&n&&(i[n]&&(o=i[n]),o&&(r=n)),{hashAttribute:r,hashValue:o}}function d(e,t,n){e.context.log?.(t,n)}function F(e,t){return t=t||0,`${e}__${t}`}function D(e,t){return`${e}||${t}`}function Ze(e,t,n){let r=e.stickyBucketAssignmentDocs;if(!r)return{};let{hashAttribute:o,hashValue:i}=m(e,t),s=D(o,E(i)),{hashAttribute:a,hashValue:u}=m(e,n),f=u?D(a,E(u)):null,l={};return f&&r[f]&&Object.assign(l,r[f].assignments||{}),r[s]&&Object.assign(l,r[s].assignments||{}),l}function te({context:e,expKey:t,expBucketVersion:n,expHashAttribute:r,expFallbackAttribute:o,expMinBucketVersion:i,expMeta:s}){n=n||0,i=i||0,r=r||"id",s=s||[];let a=F(t,n),u=Ze(e,r,o);if(i>0)for(let c=0;c<i;c++){let p=F(t,c);if(u[p]!==void 0)return{variation:-1,versionIsBlocked:!0}}let f=u[a];if(f===void 0)return{variation:-1};let l=s.findIndex(c=>c.key===f);return l<0?{variation:-1}:{variation:l}}function ne(e,t,n,r){let o=D(t,n),i=e.stickyBucketAssignmentDocs,s=i&&i[o]?i[o].assignments||{}:{},a={...s,...r},u=JSON.stringify(s)!==JSON.stringify(a);return{key:o,doc:{attributeName:t,attributeValue:n,assignments:a},changed:u}}function et(e){let t=new Set;return Object.keys(e).forEach(n=>{let r=e[n];if(r.rules)for(let o of r.rules)o.variations&&(t.add(o.hashAttribute||"id"),o.fallbackAttribute&&t.add(o.fallbackAttribute))}),Array.from(t)}function tt(e,t=e.features||{}){let n={};return et(t).forEach(r=>{let{hashValue:o}=m(e,r);n[r]=E(o)}),n}function nt(e,t){let n=Z(t),r=Ve(e,null,n);return t.onExperimentEval?.(e,r),r}function rt(e,t){return oe(e,Z(t))}function ot(e){return e.forcedVariations||{}}function Ce(e,t,n){let{context:r}=e;if(r.trackedExperiments){let o=He(t,n);if(r.trackedExperiments.has(o))return;r.trackedExperiments.add(o)}re(()=>r.onExperimentViewed?.(t,n))}function st(e,t,n){let{context:r}=e;if(r.trackedFeatureUsage){let o=JSON.stringify(n.value);if(r.trackedFeatureUsage[t]===o)return;r.trackedFeatureUsage[t]=o}re(()=>r.onFeatureUsage?.(t,n))}function re(e){try{let t=e();t&&typeof t.catch=="function"&&t.catch(()=>{})}catch{}}function oe(e,t){let{context:n}=t;if(t.stack.evaluatedFeatures.has(e))return d(t,`evalFeature: circular dependency detected: ${t.stack.id} -> ${e}`,{from:t.stack.id,to:e}),S(t,e,null,"cyclicPrerequisite");t.stack.evaluatedFeatures.add(e),t.stack.id=e;let r=n.features?.[e];for(let i of r?.rules??[])q(i);let o=n.forcedFeatureValues;if(o&&o.has(e))return d(t,"Global override",{id:e,value:o.get(e)}),S(t,e,o.get(e),"override");if(!r)return d(t,"Unknown feature",{id:e}),S(t,e,null,"unknownFeature");if(r.rules){let i=new Set(t.stack.evaluatedFeatures);e:for(let s of r.rules){if(s.parentConditions)for(let f of s.parentConditions){t.stack.evaluatedFeatures=new Set(i);let l=oe(f.id,t);if(l.source==="cyclicPrerequisite")return S(t,e,null,"cyclicPrerequisite");let c={value:l.value};if(!k(c,f.condition||{},n.savedGroups||{})){if(f.gate)return d(t,"Feature blocked by prerequisite",{id:e,rule:s}),S(t,e,null,"prerequisite");d(t,"Skip rule because prerequisite evaluation fails",{id:e,rule:s});continue e}}if(s.filters&&$e(s.filters,t)){d(t,"Skip rule because of filters",{id:e,rule:s});continue}if("force"in s){if(s.condition&&!Fe(s.condition,t)){d(t,"Skip rule because of condition ff",{id:e,rule:s});continue}if(!it(t,s.seed||e,s.hashAttribute,n.saveStickyBucketAssignmentDoc&&!s.disableStickyBucketing?s.fallbackAttribute:void 0,s.range,s.coverage,s.hashVersion)){d(t,"Skip rule because user not included in rollout",{id:e,rule:s});continue}return d(t,"Force value from rule",{id:e,rule:s}),s.tracks&&s.tracks.forEach(f=>{Ce(t,f.experiment,f.result)}),S(t,e,s.force,"force",s.id)}if(!s.variations){d(t,"Skip invalid rule",{id:e,rule:s});continue}let a={variations:s.variations,key:s.key||e};"coverage"in s&&(a.coverage=s.coverage),s.weights&&(a.weights=s.weights),s.hashAttribute&&(a.hashAttribute=s.hashAttribute),s.fallbackAttribute&&(a.fallbackAttribute=s.fallbackAttribute),s.disableStickyBucketing&&(a.disableStickyBucketing=s.disableStickyBucketing),s.bucketVersion!==void 0&&(a.bucketVersion=s.bucketVersion),s.minBucketVersion!==void 0&&(a.minBucketVersion=s.minBucketVersion),s.meta&&(a.meta=s.meta),s.ranges&&(a.ranges=s.ranges),s.name&&(a.name=s.name),s.phase&&(a.phase=s.phase),s.seed&&(a.seed=s.seed),s.hashVersion&&(a.hashVersion=s.hashVersion),s.filters&&(a.filters=s.filters),s.condition&&(a.condition=s.condition);let u=Ve(a,e,t);if(n.onExperimentEval?.(a,u),u.inExperiment&&!u.passthrough)return S(t,e,u.value,"experiment",s.id,a,u)}}return d(t,"Use default value",{id:e,value:r.defaultValue}),S(t,e,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function Ve(e,t,n){let{context:r}=n;q(e);let o=e.key,i=e.variations.length;if(i<2)return d(n,"Invalid experiment",{id:o}),h(n,e,-1,!1,t);if(r.enabled===!1)return d(n,"Context disabled",{id:o}),h(n,e,-1,!1,t);if(e.urlPatterns&&!N(r.url||"",e.urlPatterns))return d(n,"Skip because of url targeting",{id:o}),h(n,e,-1,!1,t);let s=M(o,r.url||"",i);if(s!==null)return d(n,"Force via querystring",{id:o,variation:s}),h(n,e,s,!1,t);let a=ot(r);if(o in a){let b=a[o];return d(n,"Force via dev tools",{id:o,variation:b}),h(n,e,b,!1,t)}if(e.active===!1)return d(n,"Skip because inactive",{id:o}),h(n,e,-1,!1,t);let{hashAttribute:u,hashValue:f}=m(r,e.hashAttribute,r.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0);if(!f)return d(n,"Skip because missing hashAttribute",{id:o}),h(n,e,-1,!1,t);let l=-1,c=!1,p=!1;if(r.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing){let{variation:b,versionIsBlocked:B}=te({context:r,expKey:e.key,expBucketVersion:e.bucketVersion,expHashAttribute:e.hashAttribute,expFallbackAttribute:e.fallbackAttribute,expMinBucketVersion:e.minBucketVersion,expMeta:e.meta});c=b>=0,l=b,p=!!B}if(!c){if(e.filters&&$e(e.filters,n))return d(n,"Skip because of filters",{id:o}),h(n,e,-1,!1,t);if(e.include&&!I(e.include))return d(n,"Skip because of include function",{id:o}),h(n,e,-1,!1,t);if(e.condition&&!Fe(e.condition,n))return d(n,"Skip because of condition exp",{id:o}),h(n,e,-1,!1,t);if(e.parentConditions){let b=new Set(n.stack.evaluatedFeatures);for(let B of e.parentConditions){n.stack.evaluatedFeatures=new Set(b);let R=oe(B.id,n);if(R.source==="cyclicPrerequisite")return h(n,e,-1,!1,t);let j={value:R.value};if(!k(j,B.condition||{},r.savedGroups||{}))return d(n,"Skip because prerequisite evaluation fails",{id:o}),h(n,e,-1,!1,t)}}}let y=T(e.seed||o,f,e.hashVersion??2);if(y===null)return d(n,"Skip because of invalid hash version",{id:o}),h(n,e,-1,!1,t);if(!c){let b=e.ranges||K(i,e.coverage===void 0?1:e.coverage,e.weights);l=P(y,b)}if(p)return d(n,"Skip because sticky bucket version is blocked",{id:o}),h(n,e,-1,!1,t,void 0,!0);if(l<0)return d(n,"Skip because of coverage",{id:o}),h(n,e,-1,!1,t);if("force"in e)return d(n,"Force variation",{id:o,variation:e.force}),h(n,e,e.force===void 0?-1:e.force,!1,t);if(r.qaMode)return d(n,"Skip because QA mode",{id:o}),h(n,e,-1,!1,t);let A=h(n,e,l,!0,t,y,c);if(r.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing){let{changed:b,key:B,doc:R}=ne(r,u,E(f),{[F(e.key,e.bucketVersion)]:A.key});if(b){r.stickyBucketAssignmentDocs=r.stickyBucketAssignmentDocs||{},r.stickyBucketAssignmentDocs[B]=R;let j=r.saveStickyBucketAssignmentDoc;re(()=>j(R))}}return Ce(n,e,A),d(n,"In experiment",{id:o,variation:A.variationId}),A}function S(e,t,n,r,o,i,s){let a={value:n,on:!!n,off:!n,source:r,ruleId:o||""};return i&&(a.experiment=i),s&&(a.experimentResult=s),r!=="override"&&st(e,t,a),a}function Fe(e,t){return k(ee(t.context),e,t.context.savedGroups||{})}function $e(e,t){return e.some(n=>{let{hashValue:r}=m(t.context,n.attribute);if(!r)return!0;let o=T(n.seed,r,n.hashVersion||2);return o===null?!0:!n.ranges.some(i=>C(o,i))})}function it(e,t,n,r,o,i,s){if(!o&&i===void 0)return!0;if(!o&&i===0)return!1;let{hashValue:a}=m(e.context,n,r);if(!a)return!1;let u=T(t,a,s??2);return u===null?!1:o?C(u,o):i!==void 0?u<=i:!0}function h(e,t,n,r,o,i,s){let a=!0;(n<0||n>=t.variations.length)&&(n=0,a=!1);let{hashAttribute:u,hashValue:f}=m(e.context,t.hashAttribute,e.context.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0),l=t.meta?t.meta[n]:{},c={key:l.key||""+n,featureId:o,inExperiment:a,hashUsed:r,variationId:n,value:t.variations[n],hashAttribute:u,hashValue:f,stickyBucketUsed:!!s};return l.name&&(c.name=l.name),i!==void 0&&(c.bucket=i),l.passthrough&&(c.passthrough=l.passthrough),c}function He(e,t){return t.hashAttribute+t.hashValue+e.key+t.variationId}/*!
|
|
2
|
-
Copyright (c) 2025 GrowthBook, Inc.
|
|
3
|
-
|
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
5
|
-
furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all
|
|
8
|
-
copies or substantial portions of the Software.
|
|
9
|
-
|
|
10
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
-
SOFTWARE.
|
|
17
|
-
*/export{M as a,E as b,N as c,We as d,k as e,tt as f,nt as g,rt as h,He as i};
|
package/dist/chunk-VTSEZ4GI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as c,b as x}from"./chunk-LFNFVYC2.js";import{Fk as T,Lk as L,gi as N,hf as k,hi as _,ki as q,ma as b,ui as A,uk as U}from"./chunk-PVJKOUNE.js";import{d as P,e as D,g as V,h as R}from"./chunk-TZ6REIUE.js";function j(a){let e=null,u=null,l=0,r=0,s=new Set,n=null,i=null,y=new Set,v=()=>{for(let t of y)try{t()}catch{}},o={attributes:b.parse(a.attributes??{}),onFeatureUsage:a.onFeatureUsage?(t,f)=>{!s.has(t)&&(!e||!("analyticsConfig"in e)||e.analyticsConfig.featureUsageEnabled)&&a.onFeatureUsage(t,structuredClone(f))}:void 0,onExperimentViewed:a.onExperimentViewed?(t,f)=>(!e||!("analyticsConfig"in e)||e.analyticsConfig.experimentViewsEnabled)&&a.onExperimentViewed(structuredClone(t),structuredClone(f)):void 0,stickyBucketAssignmentDocs:structuredClone(a.stickyBucketAssignmentDocs),saveStickyBucketAssignmentDoc:a.saveStickyBucketAssignmentDoc?t=>a.saveStickyBucketAssignmentDoc(structuredClone(t)):void 0,trackedFeatureUsage:{},trackedExperiments:new Set},w=()=>({value:null,source:"unknownFeature",on:!1,off:!0,ruleId:""});function d(t,f=new Set){return s.has(t)?!n||!n.features[t]||["unknownFeature","cyclicPrerequisite"].includes(n.features[t].source):f.has(t)?!1:(f.add(t),(e?.features[t]?.rules??[]).some(p=>[...p.parentConditions??[],...(p.tracks??[]).flatMap(h=>h.experiment.parentConditions??[])].some(h=>d(h.id,f))))}let m=t=>{if(!e)throw new Error("Initialize the Feature client before evaluation");if(e.expiresAt&&Date.parse(e.expiresAt)<=Date.now())throw new Error("Feature configuration expired; refresh before evaluation");return n?.expiresAt&&Date.parse(n.expiresAt)<=Date.now()&&(n=null,o.features=e.features),s.has(t)?!n||n.expiresAt&&Date.parse(n.expiresAt)<=Date.now()?w():structuredClone(n.features[t]??w()):d(t)?w():structuredClone(R(t,o))};async function g(){if(!e||!s.size)return;if(!a.evaluateRemote)throw new Error("Remote Feature evaluation requires a server loader");let t=r;if(i?.revision===t)return i.loading;let f=l,p=e,h=[...s],I=(async()=>{let E=q.parse(await a.evaluateRemote({attributes:structuredClone(o.attributes),features:h}));if(!(f!==l||t!==r||p!==e)){if(E.generation!==p.generation)throw new Error("Feature configuration changed; refresh before evaluation");if(h.some(S=>!Object.hasOwn(E.features,S))||Object.keys(E.features).some(S=>!s.has(S)))throw new Error("Invalid remote Feature results");n=structuredClone(E),o.features={...p.features,...Object.fromEntries(Object.entries(n.features).map(([S,B])=>[S,{defaultValue:B.value}]))},v()}})();i={revision:t,loading:I};try{await I}finally{i?.loading===I&&(i=null)}}function C(){g().catch(t=>{try{a.onError?.(t)}catch{}})}async function F(){if(u)return u;let t=l,f=(async()=>{let p=await a.load(),h="remoteFeatures"in p?_.parse(p):null,I=h??N.parse(p);if(I.scope.projectId!==a.scope.projectId||I.scope.environment!==a.scope.environment)throw new Error("Feature payload scope changed");if(t!==l)throw new Error("Feature client was reset");let E=new Set(h?.remoteFeatures??[]);if([...E].some(S=>Object.hasOwn(I.features,S)))throw new Error("Remote Feature definitions must not be delivered locally");return e&&"analyticsConfig"in e&&"analyticsConfig"in I&&!e.analyticsConfig.experimentViewsEnabled&&h?.analyticsConfig.experimentViewsEnabled&&o.trackedExperiments?.clear(),e=structuredClone(I),s=E,n=null,i=null,r++,o.features=e.features,o.savedGroups=P(e.savedGroups),o.trackedFeatureUsage={},v(),C(),structuredClone(e)})();u=f;try{return await f}finally{u===f&&(u=null)}}return{init:F,refresh:F,refreshRemote:g,get generation(){return e?.generation??null},get expiresAt(){return e?.expiresAt??null},subscribe(t){return y.add(t),()=>{y.delete(t)}},setAttributes(t){o.attributes=b.parse(t),r++,n=null,i=null,o.features=e?.features??{},o.trackedFeatureUsage={},v(),C()},evalFeature:m,isOn(t){return m(t).on},isOff(t){return m(t).off},getFeatureValue(t,f){let p=m(t).value;return structuredClone(p===null?f:p)},reset(){l++,r++,u=null,i=null,e=null,n=null,s.clear(),o.features={},o.savedGroups={},o.stickyBucketAssignmentDocs={},o.attributes={},o.trackedFeatureUsage={},o.trackedExperiments?.clear(),v()}}}async function M(a,e){if(!/^gg_ct_[A-Za-z0-9_-]{43}$/.test(e.customerToken))throw new c("INVALID_TOKEN","A verified Customer credential is required");let u=x(a);u.identify(e.customerToken);let l=A.resolvePaywall.request.parse({selector:{type:"paywall",paywallId:e.paywallId},commerce:e.commerce,locale:e.locale,...e.requirement?{requirement:e.requirement}:{}}),r=null,s=null,n=null,i=null,y=null;async function v(){let d=A.resolvePaywall,m=d.response.parse(await u.request(d.path,d.request.parse({...l,selector:r?{type:"version",versionId:r.id}:l.selector})));if(m.paywall.paywallId!==e.paywallId)throw new c("INVALID_RESPONSE","The requested Paywall changed");if(r&&(m.paywall.id!==r.id||m.paywall.paywallId!==r.paywallId||m.paywall.offering.id!==r.offering.id))throw new c("INVALID_RESPONSE","The pinned Paywall or Offering Version changed");return r=m.paywall,structuredClone(r)}async function o(d){if(!s)throw new c("INVALID_REQUEST","A quoted purchase is required");let m=d==="read"?A.readSubscriptionOperation:A.attach,g=m.response.parse(await u.request(m.path,m.request.parse({operationId:s.operationId,...d==="read"?{}:{intent:d}})));if(g.operation.operationId!==s.operationId||g.operation.currency!==l.commerce.currency)throw new c("INVALID_RESPONSE","The purchase operation changed");return n?.status==="complete"&&g.operation.status!=="complete"||n&&n.status!=="pending"&&g.operation.status==="pending"||(n=g.operation),structuredClone(n)}let w={get view(){return r?structuredClone(r):null},get quote(){return s?structuredClone(s):null},get operation(){return n?structuredClone(n):null},get webViewUrl(){return u.webViewUrl()},refresh:v,async preview(d){if(!r)throw new c("INVALID_REQUEST","Load the Paywall first");let m=r.document.buttons[d.actionId];if(m?.type!=="checkout")throw new c("INVALID_REQUEST","Choose an authored purchase action");let g=k(m.product,d.selection,r.capabilities);if(!g)throw new c("PRODUCT_UNAVAILABLE","Choose an available Product");let C=A.previewAttach.request.parse({requestId:d.requestId,plans:[{productVersionId:g}],provider:l.commerce.provider,currency:l.commerce.currency,...d.offerId?{offerId:d.offerId}:{},...d.nativeOffer?{nativeOffer:d.nativeOffer}:{}}),F=JSON.stringify(C);if(i&&i!==F&&(!n||n.status==="pending"))throw new c("COMMAND_PENDING","Finish or cancel the original purchase before changing it");if(i===F){if(y)return y;if(s)return structuredClone(s)}i=F;let t=(async()=>{let f=A.previewAttach,p=f.response.parse(await u.request(f.path,C));if(p.quote.currency!==l.commerce.currency||p.quote.provider!==l.commerce.provider||p.quote.lines.length!==1||p.quote.lines[0].productVersionId!==g)throw new c("INVALID_RESPONSE","The purchase quote changed its selected Product or presentment");return s=p.quote,n=null,structuredClone(s)})();y=t;try{return await t}finally{y===t&&(y=null)}},confirm:()=>o("confirm"),cancel:()=>o("cancel"),read:()=>o("read"),destroy(){u.reset(),r=null,s=null,n=null,i=null}};return await v(),w}function X(a,e,u){let l=L.parse(a);if(l.evaluationMode!=="local")throw new c("EVALUATION_MODE","Remote nodes are evaluated by Grow");if(l.expiresAt&&Date.parse(l.expiresAt)<=Date.now())throw new c("CONFIGURATION_EXPIRED","Refresh local rules at the scheduled transition");let r=l.topology.nodes.find(o=>o.id===e);if(!r)throw new c("NOT_FOUND","Funnel node is unavailable");let s=b.parse(u.attributes??{}),n={attributes:s,saveStickyBucketAssignmentDoc:u.saveStickyBucketAssignmentDoc?o=>u.saveStickyBucketAssignmentDoc(structuredClone(o)):void 0,onFeatureUsage:u.onFeatureUsage?(o,w)=>u.onFeatureUsage(o,structuredClone(w)):void 0,onExperimentViewed:u.onExperimentViewed?(o,w)=>u.onExperimentViewed(structuredClone(o),structuredClone(w)):void 0,features:structuredClone(l.growth.features),savedGroups:P(l.growth.savedGroups),stickyBucketAssignmentDocs:structuredClone(u.stickyBucketAssignmentDocs)},i,y;if(r.type==="condition"){let o=l.conditions[r.id];if(!o)throw new c("INVALID_RESPONSE","Local condition rules are unavailable");i=o.find(w=>D(s,w.condition,n.savedGroups))?.port??"default"}else if(r.type==="feature"){if(!r.resources.featureKey)throw new c("INVALID_RESPONSE","Feature reference is unavailable");y=R(r.resources.featureKey,n).value,i="next"}else if(r.type==="split"){let o=r.resources.experimentId,w=o?l.growth.experiments[o]:null;if(!w||!o)throw new c("INVALID_RESPONSE","Experiment reference is unavailable");let d=V(w,n);y=d.value,i=d.inExperiment&&!d.passthrough&&typeof d.value=="string"?d.value:"notParticipating"}else throw new c("SERVER_REQUIRED","This node is driven by the authoritative Funnel runtime");let v=r.outputs[i];if(!v)throw new c("INVALID_RESPONSE","Evaluated node exit is unavailable");return{nodeId:e,port:i,target:v,...y===void 0?{}:{value:y}}}function H(a,e){return e.type==="id"?a.customerId===e.value:a.externalUserId===e.value}function O(a,e){if(a===e)return!0;if(Array.isArray(a)||Array.isArray(e))return Array.isArray(a)&&Array.isArray(e)&&a.length===e.length&&a.every((r,s)=>O(r,e[s]));if(!a||!e||typeof a!="object"||typeof e!="object")return!1;let u=Object.entries(a),l=Object.entries(e);return u.length===l.length&&u.every(([r,s])=>Object.hasOwn(e,r)&&O(s,Reflect.get(e,r)))}function ne(a){let e=/^gg_ct_[A-Za-z0-9_-]{32,128}$/.test(a.apiKey);if(typeof window<"u"&&!e)throw new c("SERVER_ONLY","Funnel starts are issued by your backend");if(!e&&!/^gg_sk_[A-Za-z0-9_-]{32,128}$/.test(a.apiKey))throw new c("INVALID_TOKEN","A customer credential or server API key is required");let u=x({...a,timeoutMs:a.timeoutMs??35e3});return u.identify(a.apiKey),{async start(l){let r=U.safeParse({...l,operation:"start"});if(!r.success||r.data.operation!=="start"||(e?r.data.customer!==void 0:r.data.customer===void 0))throw new c("INVALID_REQUEST","Invalid current Funnel start");let s=r.data,n=T.safeParse(await u.request("funnels",s));if(!n.success||!n.data.runToken)throw new c("INVALID_RESPONSE","Funnel start credentials are missing");let i=n.data;if(i.run.source.id!==s.funnelId||i.run.locale!==(s.locale??"en")||!O(i.run.parameters,s.parameters??{})||(s.customer?!i.customerId||s.customer.type==="id"&&i.customerId!==s.customer.value:i.customerId!==void 0))throw new c("INVALID_RESPONSE","Funnel start contract changed");return{...i,runToken:i.runToken}}}}export{j as a,H as b,O as c,M as d,X as e,ne as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as V}from"./chunk-6X42DWOM.js";import{a}from"./chunk-LFNFVYC2.js";import{Bg as se,hf as oe}from"./chunk-PVJKOUNE.js";import"./chunk-TZ6REIUE.js";function le(b){let n=b.view;if(!n?.paywall)throw new a("INVALID_REQUEST","The current node is not a Paywall");let A=n.paywall.receiptId,z=n.nodeId,m=n.visit,P=n.paywall.resolution,s=n.paywall.quote,f=n.paywall.operation,F=!1,O=n.paywall.purchaseRequestId,g=null,D=new Map,_=new Map;function R(t){let u=t.run.paywall;if(u?.receiptId===A){if(u.resolution.id!==P.id||u.resolution.offering.id!==P.offering.id)throw new a("INVALID_RESPONSE","The pinned Paywall binding changed");P=u.resolution}if(t.purchase&&t.purchase.receiptId!==A)throw new a("INVALID_RESPONSE","Purchase receipt changed");let c=t.purchase??(u?.receiptId===A?u:null),p=c?.quote??s,o=c?.operation??(p?.operationId===s?.operationId?f:null);if(p&&o&&p.operationId!==o.operationId)throw new a("INVALID_RESPONSE","Purchase operation changed");s=p,(f?.operationId!==o?.operationId||f?.status==="pending"||o?.status==="complete")&&(f=o)}async function I(t,u){if(F)throw new a("IDENTITY_CHANGED","Paywall presentation has closed");let c=D.get(t);if(c){if(JSON.stringify(c.input)!==JSON.stringify(u))throw new a("CONFLICT","A purchase request cannot change its input")}else{let h=b.view;if(!h||h.nodeId!==z||h.visit!==m||h.paywall?.receiptId!==A)throw new a("PRECONDITION_FAILED","The Paywall visit has changed");c={operation:"submit",requestId:t,nodeId:z,visit:m,revision:h.revision,input:u},D.set(t,c)}let p=await b.submit(c),o=Date.now()+3e4;for(;p.run.pendingRequest?.requestId===t&&Date.now()<o&&!F;)await new Promise(h=>setTimeout(h,1e3)),p=await b.resume(t);if(p.run.pendingRequest?.requestId===t)throw new a("COMMAND_PENDING","The purchase command is still pending; retry the original request",202);R(p)}async function E(t){if(!s)throw new a("INVALID_REQUEST","A quoted purchase is required");let u=`${t}:${s.operationId}`,c=_.get(u);if(c||(c=crypto.randomUUID(),_.set(u,c)),await I(c,{type:t==="confirm"?"paywall_confirm":"paywall_cancel",operationId:s.operationId}),!f)throw new a("INVALID_RESPONSE","The accepted purchase result is missing");return structuredClone(f)}return{get view(){return structuredClone(P)},get quote(){return s?structuredClone(s):null},get operation(){return f?structuredClone(f):null},get webViewUrl(){return b.webViewUrl},async refresh(){return R(await b.get()),structuredClone(P)},preview(t){if(O&&O!==t.requestId&&(!f||f.status==="pending"))return Promise.reject(new a("COMMAND_PENDING","Retry the original purchase before starting another"));if(O===t.requestId&&g)return g;let u=P.document.buttons[t.actionId],c=u?.type==="checkout"?oe(u.product,t.selection,P.capabilities):null;if(!c)return Promise.reject(new a("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));O=t.requestId;let p=(async()=>{if(await I(t.requestId,{type:"paywall_quote",actionId:t.actionId,productVersionId:c,...t.offerId?{offerId:t.offerId}:{},...t.nativeOffer?{nativeOffer:t.nativeOffer}:{}}),!s)throw new a("INVALID_RESPONSE","The accepted quote is missing");return structuredClone(s)})();return g=p,p.then(()=>{g===p&&(g=null)},o=>{g===p&&(g=null),o instanceof a&&o.status!==void 0&&o.status<500&&![401,425].includes(o.status)&&(O=null)}),p},confirm:()=>E("confirm"),cancel:()=>E("cancel"),async read(){if(!s)throw new a("INVALID_REQUEST","A quoted purchase is required");if(R(await b.get(void 0,{receiptId:A,operationId:s.operationId})),!f)throw new a("INVALID_RESPONSE","The current purchase result is missing");return structuredClone(f)},destroy(){F=!0,D.clear(),_.clear()}}}async function Ee(b,n){let{mountScreenPreview:A}=await import("./popup.js"),{showPaywall:z}=await import("./paywall-M5CIDUIT.js"),m=b.ownerDocument,P=m.activeElement,s=m.createElement("section"),f=m.createElement("div"),F=m.createElement("div"),O=m.createElement("p"),g=m.createElement("p"),D=m.createElement("button"),_=m.createElement("button"),R=m.createElement("button"),I=m.createElement("dialog");s.dataset.indianaFunnel="",s.setAttribute("aria-busy","false"),s.style.cssText="box-sizing:border-box;width:100%;min-width:0;font:14px/1.5 system-ui,sans-serif;color:#172033;background:#fff",F.style.cssText="display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 20px",O.setAttribute("role","status"),g.setAttribute("role","alert"),g.hidden=!0,D.type=_.type=R.type="button",F.append(D,O,g,R,_),s.append(f,F),b.append(s);let E=null,t=null,u=null,c="",p="",o=!1,h=0,Y=!1,ne="",T=null,X=Promise.resolve(),L=null,$=null,Q={},Z=new Map,te=new Set,W=new Set,B=new Set,H=null,S={},U=(e,i=null)=>{o||($=i,g.textContent=e instanceof Error?e.message:"Request failed",g.hidden=!1,R.hidden=n.client.pendingCommand===null,V(n.onError,e))};function k(){let e=n.client.view;if(!e)throw new a("INVALID_REQUEST","No current Run is available");return{requestId:crypto.randomUUID(),nodeId:e.nodeId,visit:e.visit,revision:e.revision}}async function x(e,i=!1){if(!(h&&!i||o)){h++,s.setAttribute("aria-busy","true"),g.hidden=!0,$=null;try{if(!i&&H){let r=n.client.view;await H;let l=n.client.view;if(!r||!l||l.id!==r.id||l.nodeId!==r.nodeId||l.visit!==r.visit||l.stopped||!["running","waiting"].includes(l.status))throw new a("PRECONDITION_FAILED","The screen changed while its display was acknowledged")}if(o)return;let w=await e();o||await M(n.client.view??w.run)}catch(w){U(w,n.client.pendingCommand?.requestId??null)}finally{h=Math.max(0,h-1),s.setAttribute("aria-busy",String(h>0)),o||(R.hidden=n.client.pendingCommand===null,D.disabled=h>0||!!n.client.pendingCommand||!n.client.view?.canBack)}}}function ie(e){if(te.has(e)||W.has(e)||o)return;W.add(e);let i=async()=>{if(o||c!==e){W.delete(e);return}if(h||n.client.pendingCommand){setTimeout(()=>{i()},250);return}let w=(async()=>{await n.client.submit({operation:"shown",...k()}),te.add(e)})();H=w;let r=()=>{H===w&&(H=null),W.delete(e)};w.then(r,l=>{r(),h||U(l)})};i()}function K(){T&&clearTimeout(T),!(o||!u||!["running","waiting"].includes(u.status))&&(T=setTimeout(()=>{T=null,re().finally(K)},u.pendingRequest?1500:5e3))}async function re(){if(!(o||Y||h)){Y=!0;try{let e=await n.client.get();o||await M(n.client.view??e.run)}catch(e){U(e)}finally{Y=!1}}}async function ae(e){let i=n.client.view,w=i?.screen,r=w?.customerData.nodes[e.nodeId];if(!i||!w||!r)return;if(!["refresh","next","previous","filter","sources_next","sources_previous"].includes(e.action)){let C=E?.document,q=C?se(C,e.nodeId):null,ee=q?.type==="customer_data"?q.data.outputs?.[e.action]:void 0;ee&&w.outputs.includes(ee)?await x(()=>n.client.submit({operation:"submit",...k(),input:{type:"screen",output:ee,answers:S,selection:e.value?{[e.nodeId]:e.value}:{}}})):await n.onCustomerDataIntent?.(e,i);return}let d=e.action.startsWith("sources_")?r.resources.find(C=>C.key===e.value):null;if(e.action.startsWith("sources_")&&!d)throw new a("INVALID_REQUEST","Choose a current resource");let N=`${i.visit}:${e.nodeId}:${d?.key??""}`,y=Z.get(N)??[null],v=Q[e.nodeId]??{page:1,after:null,filter:"all",...d?{resourceKey:d.key}:{}};if(e.action==="filter"){let C=e.value;if(!C||!["all","purchase","refund","source","usage","debt","settlement"].includes(C))throw new a("INVALID_REQUEST","Unknown data filter");v={page:1,after:null,filter:C},y.splice(0,y.length,null)}else if(e.action==="next"||e.action==="sources_next"){let C=d?.sources.at(-1),q=d?C?{kind:"ledger",cursor:{at:C.detail[0],id:C.id,type:"source"}}:null:w.dataCursors[e.nodeId];if(!q||!d&&!r.hasNext)return;y[v.page]=q,v={...v,page:v.page+1,after:q}}else if(e.action==="previous"||e.action==="sources_previous"){if(v.page<=1)return;v={...v,page:v.page-1,after:y[v.page-2]??null}}Z.set(N,y),Q={...Q,[e.nodeId]:v},await x(()=>n.client.get({nodeId:i.nodeId,visit:i.visit,revision:i.revision,components:Q}))}function ue(e){let i=e.screen?.presentation;if(!i||i.type==="inline"){I.open&&I.close(),s.parentElement!==b&&b.append(s);return}s.parentElement!==I&&(I.append(s),b.append(I));let w={sm:420,md:640,lg:900};I.style.cssText=`padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;width:${"size"in i?w[i.size]+"px":"100vw"}`,I.setAttribute("aria-label",E?.document?.name??(e.screen?.content.type==="document"?e.screen.content.document.name:"Funnel")),I.open||I.showModal()}async function ce(e){if(o)return;u=e,$&&n.client.pendingCommand?.requestId!==$&&(g.hidden=!0,$=null);let i=e.locale.startsWith("zh");if(D.textContent=i?"\u8FD4\u56DE":"Back",_.textContent=i?"\u5173\u95ED":"Close",R.textContent=i?"\u91CD\u8BD5":"Retry",D.disabled=h>0||!!n.client.pendingCommand||!e.canBack,R.hidden=n.client.pendingCommand===null,O.textContent=e.pendingRequest?i?"\u6B63\u5728\u5904\u7406":"Processing":e.instruction?.type==="wait"?i?"\u7B49\u5F85\u4E2D":"Waiting":"",ne!==`${e.revision}:${e.visit}:${e.status}:${e.stopped}`&&(ne=`${e.revision}:${e.visit}:${e.status}:${e.stopped}`,V(n.onState,structuredClone(e))),e.stopped){E?.destroy(),E=null,t?.destroy(),t=null,f.replaceChildren(),c="",p="",I.open&&I.close(),s.hidden=!0,K();return}s.hidden=!1;let w=e.screen||e.paywall?`${e.id}:${e.nodeId}:${e.visit}`:"";if(w!==c&&(E?.destroy(),E=null,t?.destroy(),t=null,f.replaceChildren(),c=w,p="",S={...e.answers},Q={},Z.clear()),ue(e),e.screen){let l=e.screen.content;E||(E=A(f,{mode:"live",...l.type==="render"?{screenUrl:pe(l.url)}:{rendererUrl:n.client.webViewUrl,title:l.document.name},onAction(y,J={},v={}){S={...S,...v},x(()=>n.client.submit({operation:"submit",...k(),input:{type:"screen",output:y,answers:S,selection:J}}))},onAnswers:y=>{S={...S,...y}},onCustomerDataIntent:y=>{ae(y).catch(U)},onEscape:()=>{j()},onError:y=>U(new Error(y)),onRendered:()=>ie(w)}));let d={capabilities:e.screen.capabilities,customerData:e.screen.customerData,parameters:e.parameters,serverInput:{bindings:e.screen.inputs,answers:S}},N=JSON.stringify([l,e.locale,d.capabilities,d.customerData,d.parameters,e.screen.inputs]);N!==p&&(E.update(l.type==="document"?l.document:null,e.locale,d),p=N),await E.ready}else if(e.paywall&&!t){let l=await z(f,{start:async()=>le(n.client),onPurchase:n.onPurchase,onCheckoutUrl:n.onCheckoutUrl,resolveOfferId:n.resolveOfferId,onEvent:n.onEvent,onOpenUrl:d=>n.onOpenUrl?n.onOpenUrl({receiptId:e.paywall.receiptId,url:d,openIn:"same_window"}):m.defaultView?.location.assign(d),onAction:async d=>{let N=await n.client.submit({operation:"submit",requestId:crypto.randomUUID(),nodeId:e.nodeId,visit:e.visit,revision:e.revision,input:{type:"screen",output:d,answers:{}}});await M(n.client.view??N.run)},onError:U,onDismiss:()=>{!o&&n.client.view?.visit===e.visit&&j()}});o?l.host?.destroy():t=l.host,ie(w)}let r=e.instruction;if(r&&["open_url","event"].includes(r.type)&&!B.has(r.receiptId)){let l=m.createElement("button");l.type="button",l.textContent=r.type==="open_url"?`${i?"\u524D\u5F80":"Continue to"} ${new URL(r.url).host}`:i?"\u7EE7\u7EED":"Continue",l.onclick=()=>{let d=k(),N=r.type==="open_url"&&!n.onOpenUrl&&r.openIn==="new_window"?de(r.url):null;x(async()=>{let y="success";if(r.type==="open_url")if(n.onOpenUrl)try{y=await n.onOpenUrl({receiptId:r.receiptId,url:r.url,openIn:r.openIn})===!1?"failed":"opened"}catch(v){V(n.onError,v),y="failed"}else y=r.openIn==="new_window"&&!N?"failed":"opened";if(r.type==="event"){if(!n.onEvent)throw new a("EVENT_HANDLER_REQUIRED","Provide the event handler");await n.onEvent(r.event)}if(o||n.client.view?.nodeId!==d.nodeId||n.client.view.visit!==d.visit)throw new a("PRECONDITION_FAILED","The client action visit changed");let J=await n.client.submit({operation:"submit",...d,input:{type:"client_action",receiptId:r.receiptId,outcome:y}});return B.add(r.receiptId),r.type==="open_url"&&!n.onOpenUrl&&r.openIn==="same_window"&&m.defaultView?.location.assign(r.url),J})},f.replaceChildren(l)}!e.pendingRequest&&e.status==="completed"&&!B.has(`complete:${e.id}`)&&(B.add(`complete:${e.id}`),V(n.onComplete,structuredClone(e))),K()}function de(e){let i=m.defaultView?.open(e,"_blank")??null;return i&&(i.opener=null),i}function pe(e){return n.client.screenUrl?n.client.screenUrl(e):new URL(e,m.defaultView?.location.href).href}function M(e){return X=X.catch(()=>{}).then(()=>ce(e)),X}let fe=n.client.subscribe(e=>{M(e).catch(U)});function j(){return L||(o?Promise.resolve():n.client.view&&!["running","waiting"].includes(n.client.view.status)?(G(),Promise.resolve()):(L=x(()=>n.client.submit({operation:"close",...k()}),!0).then(()=>{n.client.view?.status==="closed"&&G()}).finally(()=>{L=null}),L))}function G(){o||(o=!0,T&&clearTimeout(T),fe(),E?.destroy(),t?.destroy(),I.close(),I.remove(),s.remove(),P instanceof HTMLElement&&P.isConnected&&P.focus(),V(n.onDismiss,u?structuredClone(u):null))}D.onclick=()=>{x(()=>n.client.submit({operation:"back",...k()}))},_.onclick=()=>{j()},R.onclick=()=>{x(()=>n.client.retry())},I.addEventListener("cancel",e=>{e.preventDefault(),j()});try{let e=await n.client.get();await M(n.client.view??e.run)}catch(e){throw G(),e}return{destroy:G,refresh:re}}export{Ee as showFunnelRun};
|
package/dist/src-XEDJAKEB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$,$a as hb,$b as hc,$c as hd,$d as he,$e as hf,$f as ig,$g as ih,$h as ii,$i as ij,$j as ik,$k as il,$l as im,A,Aa as Ia,Ab as Ib,Ac as Ic,Ad as Id,Ae as Ie,Af as Jf,Ag as Jg,Ah as Jh,Ai as Ji,Aj as Jj,Ak as Jk,Al as Jl,Am as Jm,B,Ba as Ja,Bb as Jb,Bc as Jc,Bd as Jd,Be as Je,Bf as Kf,Bg as Kg,Bh as Kh,Bi as Ki,Bj as Kj,Bk as Kk,Bl as Kl,Bm as Km,C,Ca as Ka,Cb as Kb,Cc as Kc,Cd as Kd,Ce as Ke,Cf as Lf,Cg as Lg,Ch as Lh,Ci as Li,Cj as Lj,Ck as Lk,Cl as Ll,Cm as Lm,D,Da as La,Db as Lb,Dc as Lc,Dd as Ld,De as Le,Df as Mf,Dg as Mg,Dh as Mh,Di as Mi,Dj as Mj,Dk as Mk,Dl as Ml,Dm as Mm,E,Ea as Ma,Eb as Mb,Ec as Mc,Ed as Md,Ee as Me,Ef as Nf,Eg as Ng,Eh as Nh,Ei as Ni,Ej as Nj,Ek as Nk,El as Nl,Em as Nm,F,Fa as Na,Fb as Nb,Fc as Nc,Fd as Nd,Fe as Ne,Ff as Of,Fg as Og,Fh as Oh,Fi as Oi,Fj as Oj,Fk as Ok,Fl as Ol,Fm as Om,G,Ga as Oa,Gb as Ob,Gc as Oc,Gd as Od,Ge as Oe,Gf as Pf,Gg as Pg,Gh as Ph,Gi as Pi,Gj as Pj,Gk as Pk,Gl as Pl,Gm as Pm,H,Ha as Pa,Hb as Pb,Hc as Pc,Hd as Pd,He as Pe,Hf as Qf,Hg as Qg,Hh as Qh,Hi as Qi,Hj as Qj,Hk as Qk,Hl as Ql,Hm as Qm,I,Ia as Qa,Ib as Qb,Ic as Qc,Id as Qd,Ie as Qe,If as Rf,Ig as Rg,Ih as Rh,Ii as Ri,Ij as Rj,Ik as Rk,Il as Rl,Im as Rm,J,Ja as Ra,Jb as Rb,Jc as Rc,Jd as Rd,Je as Re,Jf as Sf,Jg as Sg,Jh as Sh,Ji as Si,Jj as Sj,Jk as Sk,Jl as Sl,K,Ka as Sa,Kb as Sb,Kc as Sc,Kd as Sd,Ke as Se,Kf as Tf,Kg as Tg,Kh as Th,Ki as Ti,Kj as Tj,Kk as Tk,Kl as Tl,L,La as Ta,Lb as Tb,Lc as Tc,Ld as Td,Le as Te,Lf as Uf,Lg as Ug,Lh as Uh,Li as Ui,Lj as Uj,Lk as Uk,Ll as Ul,M,Ma as Ua,Mb as Ub,Mc as Uc,Md as Ud,Me as Ue,Mf as Vf,Mg as Vg,Mh as Vh,Mi as Vi,Mj as Vj,Mk as Vk,Ml as Vl,N,Na as Va,Nb as Vb,Nc as Vc,Nd as Vd,Ne as Ve,Nf as Wf,Ng as Wg,Nh as Wh,Ni as Wi,Nj as Wj,Nk as Wk,Nl as Wl,O,Oa as Wa,Ob as Wb,Oc as Wc,Od as Wd,Oe as We,Of as Xf,Og as Xg,Oh as Xh,Oi as Xi,Oj as Xj,Ok as Xk,Ol as Xl,P,Pa as Xa,Pb as Xb,Pc as Xc,Pd as Xd,Pe as Xe,Pf as Yf,Pg as Yg,Ph as Yh,Pi as Yi,Pj as Yj,Pk as Yk,Pl as Yl,Q,Qa as Ya,Qb as Yb,Qc as Yc,Qd as Yd,Qe as Ye,Qf as Zf,Qg as Zg,Qh as Zh,Qi as Zi,Qj as Zj,Qk as Zk,Ql as Zl,R,Ra as Za,Rb as Zb,Rc as Zc,Rd as Zd,Re as Ze,Rf as _f,Rg as _g,Rh as _h,Ri as _i,Rj as _j,Rk as _k,Rl as _l,S,Sa as _a,Sb as _b,Sc as _c,Sd as _d,Se as _e,Sf as $f,Sg as $g,Sh as $h,Si as $i,Sj as $j,Sk as $k,Sl as $l,T,Ta as $a,Tb as $b,Tc as $c,Td as $d,Te as $e,Tf as ag,Tg as ah,Th as ai,Ti as aj,Tj as ak,Tk as al,Tl as am,U,Ua as ab,Ub as ac,Uc as ad,Ud as ae,Ue as af,Uf as bg,Ug as bh,Uh as bi,Ui as bj,Uj as bk,Uk as bl,Ul as bm,V,Va as bb,Vb as bc,Vc as bd,Vd as be,Ve as bf,Vf as cg,Vg as ch,Vh as ci,Vi as cj,Vj as ck,Vk as cl,Vl as cm,W,Wa as cb,Wb as cc,Wc as cd,Wd as ce,We as cf,Wf as dg,Wg as dh,Wh as di,Wi as dj,Wj as dk,Wk as dl,Wl as dm,X,Xa as db,Xb as dc,Xc as dd,Xd as de,Xe as df,Xf as eg,Xg as eh,Xh as ei,Xi as ej,Xj as ek,Xk as el,Xl as em,Y,Ya as eb,Yb as ec,Yc as ed,Yd as ee,Ye as ef,Yf as fg,Yg as fh,Yh as fi,Yi as fj,Yj as fk,Yk as fl,Yl as fm,Z,Za as fb,Zb as fc,Zc as fd,Zd as fe,Ze as ff,Zf as gg,Zg as gh,Zh as gi,Zi as gj,Zj as gk,Zk as gl,Zl as gm,_,_a as gb,_b as gc,_c as gd,_d as ge,_e as gf,_f as hg,_g as hh,_h as hi,_i as hj,_j as hk,_k as hl,_l as hm,a,aa,ab as ib,ac as ic,ad as id,ae as ie,af as jf,ag as jg,ah as jh,ai as ji,aj as jj,ak as jk,al as jl,am as jm,b,ba,bb as jb,bc as jc,bd as jd,be as je,bf as kf,bg as kg,bh as kh,bi as ki,bj as kj,bk as kk,bl as kl,bm as km,c,ca,cb as kb,cc as kc,cd as kd,ce as ke,cf as lf,cg as lg,ch as lh,ci as li,cj as lj,ck as lk,cl as ll,cm as lm,d,da,db as lb,dc as lc,dd as ld,de as le,df as mf,dg as mg,dh as mh,di as mi,dj as mj,dk as mk,dl as ml,dm as mm,e,ea,eb as mb,ec as mc,ed as md,ee as me,ef as nf,eg as ng,eh as nh,ei as ni,ej as nj,ek as nk,el as nl,em as nm,f,fa,fb as nb,fc as nc,fd as nd,fe as ne,ff as of,fg as og,fh as oh,fi as oi,fj as oj,fk as ok,fl as ol,fm as om,g,ga,gb as ob,gc as oc,gd as od,ge as oe,gf as pf,gg as pg,gh as ph,gi as pi,gj as pj,gk as pk,gl as pl,gm as pm,h,ha,hb as pb,hc as pc,hd as pd,he as pe,hf as qf,hg as qg,hh as qh,hi as qi,hj as qj,hk as qk,hl as ql,hm as qm,i,ia,ib as qb,ic as qc,id as qd,ie as qe,if as rf,ig as rg,ih as rh,ii as ri,ij as rj,ik as rk,il as rl,im as rm,j,ja,jb as rb,jc as rc,jd as rd,je as re,jf as sf,jg as sg,jh as sh,ji as si,jj as sj,jk as sk,jl as sl,jm as sm,k,ka,kb as sb,kc as sc,kd as sd,ke as se,kf as tf,kg as tg,kh as th,ki as ti,kj as tj,kk as tk,kl as tl,km as tm,l,la as ta,lb as tb,lc as tc,ld as td,le as te,lf as uf,lg as ug,lh as uh,li as ui,lj as uj,lk as uk,ll as ul,lm as um,m,ma as ua,mb as ub,mc as uc,md as ud,me as ue,mf as vf,mg as vg,mh as vh,mi as vi,mj as vj,mk as vk,ml as vl,mm as vm,n,na as va,nb as vb,nc as vc,nd as vd,ne as ve,nf as wf,ng as wg,nh as wh,ni as wi,nj as wj,nk as wk,nl as wl,nm as wm,o,oa as wa,ob as wb,oc as wc,od as wd,oe as we,of as xf,og as xg,oh as xh,oi as xi,oj as xj,ok as xk,ol as xl,om as xm,p,pa as xa,pb as xb,pc as xc,pd as xd,pe as xe,pf as yf,pg as yg,ph as yh,pi as yi,pj as yj,pk as yk,pl as yl,pm as ym,q,qa as ya,qb as yb,qc as yc,qd as yd,qe as ye,qf as zf,qg as zg,qh as zh,qi as zi,qj as zj,qk as zk,ql as zl,qm as zm,r,ra as za,rb as zb,rc as zc,rd as zd,re as ze,rf as Af,rg as Ag,rh as Ah,ri as Ai,rj as Aj,rk as Ak,rl as Al,rm as Am,s,sa as Aa,sb as Ab,sc as Ac,sd as Ad,se as Ae,sf as Bf,sg as Bg,sh as Bh,si as Bi,sj as Bj,sk as Bk,sl as Bl,sm as Bm,t,ta as Ba,tb as Bb,tc as Bc,td as Bd,te as Be,tf as Cf,tg as Cg,th as Ch,ti as Ci,tj as Cj,tk as Ck,tl as Cl,tm as Cm,u,ua as Ca,ub as Cb,uc as Cc,ud as Cd,ue as Ce,uf as Df,ug as Dg,uh as Dh,ui as Di,uj as Dj,uk as Dk,ul as Dl,um as Dm,v,va as Da,vb as Db,vc as Dc,vd as Dd,ve as De,vf as Ef,vg as Eg,vh as Eh,vi as Ei,vj as Ej,vk as Ek,vl as El,vm as Em,w,wa as Ea,wb as Eb,wc as Ec,wd as Ed,we as Ee,wf as Ff,wg as Fg,wh as Fh,wi as Fi,wj as Fj,wk as Fk,wl as Fl,wm as Fm,x,xa as Fa,xb as Fb,xc as Fc,xd as Fd,xe as Fe,xf as Gf,xg as Gg,xh as Gh,xi as Gi,xj as Gj,xk as Gk,xl as Gl,xm as Gm,y,ya as Ga,yb as Gb,yc as Gc,yd as Gd,ye as Ge,yf as Hf,yg as Hg,yh as Hh,yi as Hi,yj as Hj,yk as Hk,yl as Hl,ym as Hm,z,za as Ha,zb as Hb,zc as Hc,zd as Hd,ze as He,zf as If,zg as Ig,zh as Ih,zi as Ii,zj as Ij,zk as Ik,zl as Il,zm as Im}from"./chunk-PVJKOUNE.js";import{a as la,b as ma,c as na,d as oa,e as pa,f as qa,g as ra,h as sa}from"./chunk-TZ6REIUE.js";export{Pa as COMMON_LOCALES,Ra as COUPON_TERM_LOCALES,Cf as CUSTOMER_DATA_SOURCES,Cl as DEFAULT_AUDIENCE_GROUP,Ij as DEFAULT_FUNNEL_EXECUTION_POLICY,ak as FUNNEL_API_CAPABILITIES,Li as FUNNEL_LIMITS,Xk as FUNNEL_PREVIEW_LIMITS,Ue as OFFERING_MAX_DEPTH,We as OFFERING_MAX_ITEMS,Ve as OFFERING_MAX_PRODUCTS,wg as POPUP_WIDTHS,Nf as SCREEN_LIMITS,Fi as SCREEN_RENDER_PATH,Mf as SCREEN_SCHEMA_VERSION,Oi as SCREEN_TEMPLATES,vc as SDK_PROTOCOL_HEADER,xc as SDK_SUPPORT_HEADER,yc as SDK_SUPPORT_POLICY,wc as SDK_VERSION_HEADER,ug as SURFACE_PATHS,uf as SURFACE_VARIABLES,Ec as SdkProtocolError,Mi as UNBOUND_PRODUCT_VERSION_ID,Qm as VISUAL_EDITOR_PARAM,Cc as addSupportMonths,j as aiCreditSystemConfigSchema,gh as aiMarkupSchema,fh as aiModelIdSchema,hh as aiModelRatesSchema,ih as aiPricingConfigurationSchema,eh as aiTokenPools,w as amountToMinor,hi as analyticsConfigSchema,ji as analyticsEventEnabled,lc as apiErrorCatalog,mc as apiErrorCodeForStatus,gc as apiErrorCodeSchema,Di as apiOperations,wi as apiPermissionSchema,Wl as appResultsSchema,Vl as appRevenueSchema,dm as appendScreenTemplate,Bm as applyGrowthReleasePlan,nj as archiveSurfaceTemplateSchema,Fl as audienceCustomerSchema,Ol as audienceFunnelUsageSchema,Pl as audienceFunnelUsagesSchema,Gl as audienceMembersSchema,Hc as audienceSchema,El as audienceWriteSchema,xl as auditFieldSchema,Al as auditHistoryCursorSchema,Bl as auditHistorySchema,wl as auditResourceSchema,qb as autoTopupPurchaseLimitSchema,Cb as autoTopupStateSchema,Im as autumnAmountToMinor,ll as autumnCustomerAutoTopupSchema,ql as autumnCustomerControlsSchema,sl as autumnCustomerMetadataSchema,pl as autumnCustomerOverageAllowedSchema,ul as autumnCustomerProductSummarySchema,tl as autumnCustomerProfileRecordSchema,ml as autumnCustomerSpendLimitSchema,ol as autumnCustomerUsageAlertSchema,nl as autumnCustomerUsageLimitSchema,rl as autumnEntityControlsSchema,Jm as autumnMinorToAmount,Km as autumnUsageUnitAmountDecimal,$g as balanceAdjustmentCommandSchema,ah as balanceAdjustmentStateSchema,Yc as balanceAllocationSchema,Vc as balanceCommandSchema,bd as balanceGrantCommandSchema,ad as balanceGrantCreateSchema,ed as balanceGrantPageSchema,dd as balanceGrantReadSchema,cd as balanceGrantSchema,$c as balanceOperationSchema,Wc as balancePricingSegmentSchema,_c as balanceQuoteSchema,Xc as balanceReceiptUnitsSchema,Zc as balanceRejectionReasonSchema,jm as balanceSourceReasonSchema,bh as balanceSourceStateSchema,km as balanceSourceStatusSchema,mm as balanceSourcesPageSchema,lm as balanceSourcesQuerySchema,jb as billingAccruedMinorSchema,ib as billingAmountMinorSchema,tb as billingAuthorizationSchema,sb as billingAuthorizationTermsSchema,kb as billingBudgetMinorSchema,Db as billingControlInputSchema,Eb as billingControlsSchema,Mb as billingCouponsSchema,z as billingCurrencies,Fb as billingInvoiceLineSchema,Gb as billingInvoiceSchema,Jb as billingInvoicesSchema,xb as billingLimitSchema,jj as billingPortalInputSchema,kj as billingPortalSchema,D as billingSettingsMutationSchema,B as billingSettingsSchema,C as billingSettingsScopeSchema,Bb as billingUsageWindowSchema,$f as borderSchema,fg as buttonNodeSchema,Kc as campaignInputSchema,Ic as campaignOfferSchema,Lc as campaignSchema,Na as canonicalLocale,vf as capabilityBindingSchema,ob as cashPriceSchema,mb as cashPricingSchema,lb as cashPricingTiersSchema,hb as cashUnitAmountMinorSchema,Jh as claimRewardProductRequestSchema,Gd as commerceAccessSchema,Le as commerceContextSchema,ye as commerceCursorSchema,ze as commerceListQuerySchema,Hd as commerceMoneySchema,fm as commerceProductKind,Fd as commerceProductKindSchema,Ed as commerceProviderSchema,Ea as compileGrowthFeatures,Hb as confirmBillingAdjustmentInputSchema,vb as confirmBillingAuthorizationInputSchema,ic as consoleErrorCodeSchema,tc as consoleErrorResponseSchema,Fm as consoleHasPermission,ie as consoleRefundRequestSchema,Dm as consoleResources,Em as consoleRolePermissions,Cm as consoleRoleSchema,mg as countdownNodeSchema,Ya as couponAppliesToSchema,bb as couponChangeErrors,lg as couponCodeNodeSchema,Wa as couponDiscountSchema,Hl as couponDisplaySchema,Ti as couponDistributionBatchSchema,Vi as couponDistributionDetailSchema,Si as couponDistributionPreviewSchema,Ui as couponDistributionRecipientSchema,Wi as couponDistributionWriteSchema,Xa as couponDurationSchema,Za as couponEligibilitySchema,_a as couponInputSchema,Va as couponStatusSchema,kl as couponTemplateExample,il as couponTemplateKey,eb as couponWindow,Kl as createAccountOverviewPage,Jl as createCreditCenterPage,Ml as createCustomerPageTemplates,zi as createCustomerRequestSchema,Ai as createCustomerResponseSchema,Ll as createMembershipPage,Lh as createReferralCodeRequestSchema,F as creditAmountSchema,lh as creditAnalyticsFilterSchema,nh as creditAnalyticsPageSchema,mh as creditAnalyticsQuerySchema,jh as creditAnalyticsRangeSchema,kh as creditAnalyticsTimezoneSchema,L as creditDimensionSchema,M as creditMultiplierSchema,H as creditPriceAdjustmentSchema,N as creditPricingSchema,J as creditPropertiesSchema,G as creditQuantitySchema,O as creditRateSchema,Ob as creditResetCountSchema,Nb as creditResetSchema,I as creditResourceKeySchema,Pb as creditRolloverSchema,c as creditSchemaItemSchema,id as creditStatementInputSchema,jd as creditStatementSchema,i as creditSystemConfigSchema,K as creditTiersSchema,t as currencies,A as currencyAmountOptionsSchema,v as currencyDecimals,u as currencySchema,Ei as currentApiOperations,kd as currentNotificationEventTypeSchema,jg as customHtmlNodeSchema,ka as customerActivitySchema,Uh as customerAttributesSchema,Dl as customerAudienceSchema,Ef as customerDataConfigSchema,Hf as customerDataIntentSchema,hg as customerDataNodeSchema,_h as customerDataReferenceMessage,Zh as customerDataReferenced,Yh as customerDataSchema,Df as customerDataSourceSchema,Ci as customerEntitlementsSchema,fi as customerFiltersSchema,Vh as customerFingerprintSchema,Xl as customerFunnelDecisionsSchema,di as customerGetSchema,sd as customerHoldingsSchema,Wh as customerInputSchema,wd as customerLedgerEntrySchema,xd as customerLedgerPageSchema,vd as customerLedgerQuerySchema,bi as customerLookupSchema,ai as customerMutationSchema,Gf as customerPageDataSchema,Ff as customerPageNodeStateSchema,vl as customerPageSampleData,gi as customerPageSchema,ci as customerPatchSchema,ec as customerPlanCreateSchema,fc as customerPlanCreatedSchema,ja as customerPlanSchema,$h as customerProfileSchema,Xh as customerReferenceSchema,ij as customerScheduledChangeCancelSchema,gj as customerScheduledChangeSchema,hj as customerScheduledChangesSchema,Mc as customerSchema,Th as customerTagsSchema,ei as customerUpdateRequestSchema,Ni as defaultScreenTheme,cb as describeCoupon,_b as diffProductVariant,gg as dividerNodeSchema,If as emptyCustomerPageNode,Ne as entitlementCheckInputSchema,Oe as entitlementCheckReasonSchema,Qe as entitlementCheckResultSchema,Me as entitlementRequirementSchema,ga as entitlementSnapshotSchema,Bi as entitlementStatusSchema,X as environmentSchema,Cd as environmentSettingsSchema,oc as errorCodeMatchesStatus,uc as errorMetadata,qc as errorMetadataSchema,nc as errorPolicy,kc as errorReasonSchema,jc as errorRecoverySchema,rc as errorResponseSchema,Kf as escapeHtmlText,pa as evalCondition,sa as evalFeature,ri as evaluateFeaturesRequestSchema,ti as evaluateFeaturesResultSchema,Mk as executionSourceSchema,Da as experimentConfigurationSchema,Ca as experimentPhaseSchema,Ha as experimentSnapshotSchema,n as featureCollectionSchema,g as featureConfigOverrideSchema,k as featureDefinitionSchema,qi as featureDeliveryPayloadSchema,a as featureIdSchema,$ as featureInputSchema,f as featureMarkupsOverrideSchema,o as featureOptionsSchema,pi as featurePayloadSchema,m as featureRecordSchema,aa as featureSchema,Gm as featureTypes,Hm as featureUpdateBlockers,l as featureUpdateRulesSchema,od as featureUsageReadSchema,pd as featureUsageSetSchema,qd as featureUsageStateSchema,b as featureUsageTypeSchema,p as featureWriteSchema,Cg as fieldValue,Zf as fillSchema,rd as financialAmountSchema,ud as financialCursorSchema,td as financialEntryTypeSchema,Kg as findDocumentNode,Jg as findNode,hl as formatCouponConditions,Ta as formatCouponDiscount,Sa as formatCouponMoney,Ua as formatCouponTerms,y as formatCurrencyMinor,im as formatProductBillingPeriod,db as formatUsd,bk as funnelApiBindingSchema,_j as funnelApiProjectionSchema,Wj as funnelBundleDefinitionSchema,Xj as funnelBundleResultSchema,Rk as funnelCampaignCommandSchema,Sk as funnelCampaignStartResponseSchema,ck as funnelCapabilitySchema,Hk as funnelCollectionSchema,Dk as funnelCommandSchema,Uk as funnelConfigurationSchema,nk as funnelConsumedVariables,Pk as funnelCredentialCommandSchema,Qk as funnelCredentialResponseSchema,Ck as funnelDataQueriesSchema,Sj as funnelDecideShape,Tj as funnelDecisionCommandSchema,Qj as funnelDecisionOutputSchema,Uj as funnelDecisionResponseSchema,Rj as funnelDecisionSchema,Vj as funnelDecisionUsedResponseSchema,xk as funnelDocumentDraftSchema,zk as funnelDocumentSchema,pj as funnelEvaluationAttributes,Fk as funnelEvaluationModeSchema,Hj as funnelExecutionPolicySchema,tk as funnelExecutionStateSchema,ek as funnelExternalPageUrlSchema,Gj as funnelExternalTaskSchema,hk as funnelGraphDraftSchema,gk as funnelGraphNodeSchema,ik as funnelGraphSchema,jk as funnelGraphTargets,Nl as funnelGroupReferenceSchema,Lk as funnelInstructionSchema,rk as funnelNodeInputSchema,pk as funnelNodeKindSchema,sk as funnelNodeResultSchema,fk as funnelOpenInSchema,Mj as funnelOrchestrationCommandSchema,vj as funnelParametersFromUrl,Bk as funnelPresentationSubmissionSchema,Yk as funnelPreviewCommandSchema,$k as funnelPreviewDependencySchema,al as funnelPreviewJournalSchema,Zk as funnelPreviewOutcomeSchema,cl as funnelPreviewRequestSchema,dl as funnelPreviewResponseSchema,_k as funnelPreviewScenarioSchema,fl as funnelPreviewShareWriteSchema,el as funnelPreviewSnapshotSchema,bl as funnelPreviewSourceSchema,Yj as funnelProjectionFilterValueSchema,Zj as funnelProjectionWhereSchema,yk as funnelPublishableDraftSchema,Gk as funnelRecordSchema,qk as funnelResourceReferenceSchema,Ql as funnelResultsCursorSchema,Rl as funnelResultsQuerySchema,Pj as funnelResultsResponseSchema,Sl as funnelResultsSchema,Nk as funnelRunViewSchema,Ok as funnelRuntimeResponseSchema,Kk as funnelRuntimeStatusSchema,Nj as funnelSignalResponseSchema,gl as funnelStatisticsSchema,Fj as funnelTaskBindingSchema,Dj as funnelTaskDataSchema,Ej as funnelTaskOutputsSchema,Jj as funnelTaskResponseSchema,Oj as funnelTaskResultsSchema,cm as funnelTemplateDraft,am as funnelTemplateSchema,Vk as funnelTopology,Tk as funnelTopologySchema,uk as funnelTraceEventSchema,zj as funnelValueBindingSchema,wk as funnelValueDeclarationSchema,Ak as funnelValueMatches,yj as funnelValuePathSchema,oj as funnelValueSchema,ok as funnelWaitKindSchema,Ik as funnelWriteSchema,li as gbRuntimeExperimentResultSchema,ki as gbRuntimeExperimentSchema,mi as gbRuntimeFeatureRuleSchema,ni as gbRuntimeFeatureSchema,oi as gbRuntimeSavedGroupsSchema,la as getQueryStringOverride,Am as getRecommendedRolloutData,qa as getStickyBucketAttributes,sm as growthAttributeSchema,ua as growthAttributesSchema,um as growthCatalogSchema,xa as growthConditionGroupIds,rj as growthConditionPaths,va as growthConditionSchema,wm as growthDryRunSchema,xm as growthExperimentInspectionSchema,Fa as growthExperimentStop,Ga as growthFeatureExpiry,za as growthFeatureRuleSchema,Aa as growthFeatureSchema,Ba as growthFeaturesSchema,ym as growthGroupReferenceCursorSchema,zm as growthGroupReferencesSchema,wa as growthGroupSchema,tm as growthNamespaceSchema,vm as growthResourceWriteSchema,Ka as growthRuleContextSchema,ya as growthSavedGroupsSchema,Ia as growthSnapshotSchema,La as growthSplitResultSchema,Jf as htmlVariableErrors,Pf as identifierSchema,eg as imageNodeSchema,Yf as imagePositionSchema,Wf as insetsSchema,fd as invoiceDetailInputSchema,hd as invoiceDetailSchema,gd as invoiceProductItemSchema,he as invoiceRefundsSchema,pb as isInvoiceCreditPrice,rf as isProductGroup,em as isRecurringMembership,Lg as isRtlLocale,Bc as isStableSdkProtocol,na as isURLTargeted,nb as itemBillingCycleSchema,ta as jsonValueSchema,E as licenseOfferSchema,Ib as listBillingInvoicesInputSchema,Qa as localeLabel,Ma as localeSchema,Dg as localeStatuses,Ig as localizeScreen,zb as manageBillingLimitsInputSchema,yb as manageOveragePolicyInputSchema,hc as managementErrorCodeSchema,sc as managementErrorResponseSchema,Xf as marginSchema,Oa as matchLocale,qj as matchesGrowthCondition,T as membershipActionSchema,gm as membershipBillingCount,U as membershipChangeSchema,V as membershipHoldingSchema,R as membershipRulesSchema,W as membershipStateSchema,S as membershipTimingSchema,yl as mergeAuditSchema,_ as metadataSchema,h as meteredConfigSchema,x as minorToAmount,e as modelMarkupsSchema,Zl as nativeCompletionSchema,Id as nativeCouponStoreOfferLinkWriteSchema,Jd as nativeCouponStoreOfferLinksSchema,Rc as nativeProductBindingSchema,Tc as nativeProductBindingWriteSchema,Sc as nativeProductBindingsPageSchema,Yl as nativeProofSchema,Od as nativePurchaseInstructionSchema,_l as nativeReceiptCommandSchema,$l as nativeReceiptResponseSchema,Je as nativeRestoreCommandSchema,Ke as nativeRestoreResultSchema,Md as nativeStoreOfferForProduct,Kd as nativeStoreOfferSelectionSchema,Ld as nativeStoreOfferSelectionsSchema,Nd as nativeStoreSelectionMatches,$d as nativeSubscriptionUpdatePreviewSchema,ae as nativeSubscriptionUpdateResultSchema,Ri as newBlankSurface,ab as newCouponInput,ii as newEnvironmentAnalyticsConfig,Jk as newFunnelDocument,Pi as newScreenFromTemplate,Qi as newSurfaceFromTemplate,Of as nodeIdSchema,zl as objectAuditSchema,Tl as offerFlowInputSchema,Ul as offerFlowResultSchema,fb as offerSchema,gb as offerUnavailableReasonSchema,af as offeringAuthorSchema,ef as offeringCollectionSchema,$e as offeringDocumentSchema,Xe as offeringItemSchema,Ye as offeringItemsSchema,Te as offeringMetadataSchema,bf as offeringProductEvidenceSchema,Se as offeringProductIdSchema,Ze as offeringProductIds,jf as offeringProductOptionSchema,_e as offeringProductPaths,lf as offeringPublicationIssues,cf as offeringRecordSchema,hf as offeringSelectorSchema,mf as offeringValueSchema,df as offeringVersionSchema,kf as offeringWorkspaceSchema,gf as offeringWriteResultSchema,ff as offeringWriteSchema,Uc as overageBehaviorSchema,Ab as overagePolicySchema,vk as ownedFunnelScreenSchema,pm as pageExperimentEventSchema,qm as pageExperimentEventsRequestSchema,rm as pageExperimentEventsResponseSchema,om as pageExperimentPayloadSchema,nm as pageExperimentSchema,Uf as paintColorSchema,pc as parseRetryAfter,Ji as parseScreenRenderPath,se as paymentSetupCommandSchema,te as paymentSetupReadSchema,ve as paymentSetupSchema,Pe as paywallCandidateSchema,Pg as paywallClientActionSchema,Vg as paywallCollectionSchema,Qg as paywallDocumentDraftSchema,Rg as paywallDocumentSchema,Tg as paywallFlowIssues,Yg as paywallLibrarySchema,Sg as paywallProductIssues,pf as paywallProductsSchema,Ug as paywallRecordSchema,Re as paywallRequestSchema,_g as paywallResolutionSchema,Zg as paywallResolveInputSchema,Wg as paywallSummarySchema,Xg as paywallWriteSchema,da as planConfigSchema,ea as planInputSchema,ca as planItemSchema,ng as planPickerNodeSchema,fa as planSchema,ha as planVersionSchema,Jc as popupSchema,dc as prepaidAllowanceAmount,r as prepaidPriceAmount,s as prepaidQuantityAmount,Nc as prepaidQuantitySchema,q as prepaidTierPricingSchema,rb as prepareBillingAuthorizationInputSchema,jl as prepareCouponTemplate,oa as prepareSavedGroups,ub as preparedBillingAuthorizationSchema,vg as presentationSchema,kg as priceNodeSchema,ba as priceSchema,Sb as productAllowanceSchema,Oc as productBindingSchema,Qc as productBindingWriteSchema,Pc as productBindingsPageSchema,bc as productCollectionSchema,Vb as productConfigurationSchema,Yb as productDefinitionSchema,cc as productEditorOptionsSchema,of as productGroupingMatches,nf as productGroupingSchema,Ub as productLicenseSchema,Xi as productMigrationBlockReasonSchema,cj as productMigrationDetailSchema,Yi as productMigrationErrorCodeSchema,bj as productMigrationItemSchema,$i as productMigrationItemStatusSchema,dj as productMigrationListSchema,Zi as productMigrationPreviewSchema,fj as productMigrationQuerySchema,_i as productMigrationRunStatusSchema,aj as productMigrationSchema,ej as productMigrationWriteSchema,$b as productOptionsSchema,Rb as productPrepaidPriceSchema,Qb as productPricesSchema,ac as productRecordSchema,Ng as productSelectionSchema,Tb as productTrialSchema,Wb as productVariantOverridesSchema,Xb as productVariantSchema,$j as projectFunnelApiOutputs,Wk as projectFunnelConfiguration,Bd as projectSettingsSchema,$a as promotionCodeInputSchema,Ac as protocolForSdkVersion,d as providerMarkupsSchema,Eg as publishChecks,Be as purchaseListItemSchema,He as purchaseListPageSchema,Rf as radiusSchema,Aj as readFunnelValuePath,Ih as redeemRewardRequestSchema,Mh as referralCodeSchema,Oh as referralProgramCollectionSchema,Bh as referralProgramInputSchema,Dh as referralProgramRecordSchema,Gh as referralProgramWriteSchema,si as remoteFeatureResultSchema,yg as replaceFirstPageRoot,Il as resolveCouponDisplay,dk as resolveFunnelCapabilityInputs,Lj as resolveFunnelTaskInputs,Bj as resolveFunnelValueBinding,Cj as resolveFunnelValueBindings,Zb as resolveProductVariant,Hg as resolveScreenLocale,Fc as resolveSdkProtocol,yi as responseMetaSchema,wb as revokeBillingAuthorizationInputSchema,Qh as rewardActivityRedemptionSchema,Rh as rewardActivitySchema,Ah as rewardCodeInputSchema,Ph as rewardCodeSchema,Sh as rewardCodeWriteSchema,Nh as rewardCollectionSchema,xh as rewardConfigurationSchema,vh as rewardGrantExpirySchema,wh as rewardGrantSchema,zh as rewardInputSchema,yh as rewardKeySchema,Eh as rewardOptionSchema,Kh as rewardProductCheckoutSchema,Ch as rewardRecordSchema,Hh as rewardRedemptionSchema,uh as rewardStatusSchema,th as rewardTypeSchema,Fh as rewardWriteSchema,ra as runExperiment,hm as sameMembershipBillingCycle,mj as saveSurfaceTemplateSchema,Y as scopeSchema,rg as screenActionSchema,tj as screenAnswersSchema,sj as screenDataCursorSchema,zg as screenDocumentSchema,Sf as screenImageSourceSchema,wj as screenInputBindingsSchema,qg as screenNodeSchema,uj as screenParametersSchema,Og as screenPresentationSchema,sf as screenProductScopes,tf as screenProductSelections,Ii as screenRenderPath,Gi as screenRenderPathSchema,Ki as screenRenderTags,Hi as screenRenderUrlSchema,xj as screenRendererInputSchema,Mg as screenSelections,sg as screenStringsSchema,zc as sdkProtocolRegistry,Gc as sdkProtocolResponseHeaders,zd as seatCommandSchema,yd as seatReadSchema,Ad as seatsStateSchema,lk as selectFunnelCondition,qf as selectedPaywallProduct,Bf as selectedSurfaceValue,Gg as servableLocales,Lb as setBillingCouponsInputSchema,ag as shadowSchema,_f as shapeSchema,Vf as sizeSchema,Qf as spaceSchema,ig as spacerNodeSchema,Z as stableKeySchema,og as stackInteractionSchema,pg as stackNodeSchema,Ja as stickyAssignmentDocumentSchema,Sd as stripeAppendContextSchema,Rd as stripeCouponTermsSchema,Td as stripePurchaseExecutionSchema,ee as stripeRefundExecutionSchema,ue as stripeSetupExecutionSchema,Yd as stripeSubscriptionUpdateExecutionSchema,Zd as stripeSubscriptionUpdatePreviewSchema,_d as stripeSubscriptionUpdateResultSchema,pe as stripeTrialExecutionSchema,cg as styleSchema,Pd as subscriptionAttachCommandSchema,Ud as subscriptionAttachQuoteSchema,je as subscriptionBatchCommandSchema,le as subscriptionBatchGroupSchema,ke as subscriptionBatchReadSchema,me as subscriptionBatchSchema,Wd as subscriptionCarryOptionsSchema,Ie as subscriptionConflictPageSchema,De as subscriptionConflictQuerySchema,Fe as subscriptionConflictRetryResultSchema,Ee as subscriptionConflictRetrySchema,Ce as subscriptionConflictSchema,Kb as subscriptionCouponExecutionSchema,Ae as subscriptionListItemSchema,Ge as subscriptionListPageSchema,Qd as subscriptionOperationInputSchema,Vd as subscriptionOperationSchema,de as subscriptionRefundCommandSchema,fe as subscriptionRefundPreviewSchema,ge as subscriptionRefundResultSchema,ne as subscriptionTrialCommandSchema,re as subscriptionTrialPolicySchema,oe as subscriptionTrialReadSchema,qe as subscriptionTrialResultSchema,Xd as subscriptionUpdateCommandSchema,be as subscriptionUpdatePreviewSchema,ce as subscriptionUpdateResultSchema,we as subscriptionVerificationInputSchema,xe as subscriptionVerificationSchema,Lf as substituteHtmlVariables,Af as substituteSurfaceVariables,xf as surfaceDataSchema,tg as surfaceSchema,lj as surfaceTemplateSchema,wf as surfaceValueSchema,yf as surfaceVariableNames,Fg as templateChecks,bm as templateScreen,dg as textNodeSchema,bg as textStyleSchema,Tf as themeSchema,ma as toAttributeString,ui as trackEventsRequestSchema,vi as trackEventsResultSchema,mk as transitionFunnelGraph,Bg as translatableFields,P as trialPolicySchema,Q as trialRecordSchema,zf as unknownSurfaceVariables,md as usageAlertNotificationDataSchema,nd as usageAllowanceNotificationDataSchema,ph as usageAnalyticsPageSchema,oh as usageAnalyticsQuerySchema,sh as usageBatchPageSchema,rh as usageBatchReadSchema,qh as usageBatchSubmitSchema,ch as usageEntityCommandSchema,dh as usageEntitySchema,ld as usageLimitNotificationDataSchema,kk as validateFunnelGraph,Kj as validateFunnelTaskData,Ek as validateScreenAnswers,Dc as validateSdkProtocolRegistry,ia as validitySchema,xi as verifiedPrincipalSchema,Mm as visualChangeSchema,Pm as visualExperimentPayloadSchema,Om as visualExperimentSchema,Lm as visualMutationSchema,Rm as visualSelectedElementSchema,Nm as visualVariationSchema,xg as walkDocument,Ag as walkScreen,Dd as workspaceSettingsSchema};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as y,c as w}from"./chunk-ZT523F45.js";function f(r){return CSS.escape(r)}function b(r){for(let t of["id","data-indiana-id","data-testid"]){let s=r.getAttribute(t);if(!s)continue;let a=t==="id"?`#${f(s)}`:`[${t}="${f(s)}"]`;if(document.querySelectorAll(a).length===1)return a}let c=[];for(let t=r;t&&t!==document.documentElement;t=t.parentElement){let s=t.tagName.toLowerCase(),a=[...t.classList].filter(o=>o.length<80).slice(0,3);a.length&&(s+=a.map(o=>`.${f(o)}`).join(""));let m=t.parentElement?[...t.parentElement.children].filter(o=>o.tagName===t.tagName):[];m.length>1&&(s+=`:nth-of-type(${m.indexOf(t)+1})`),c.unshift(s);let d=c.join(" > ");if(document.querySelectorAll(d).length===1)return d}return c.join(" > ")}function k(r,c={}){let t=window.opener;if(!t||r.expiresAt<=Date.now())return()=>{};let s=!1,a=!1,m=!1,d,o=document.createElement("div");o.setAttribute("data-indiana-editor-highlight",""),o.style.cssText="position:fixed;pointer-events:none;z-index:2147483647;outline:2px solid #6655ee;background:rgba(102,85,238,.1);display:none",document.body.append(o);function l(n,e={}){t.postMessage({channel:"indiana-visual",nonce:r.nonce,type:n,...e},r.origin)}let g=n=>n.composedPath().find(e=>e instanceof Element&&e!==o),h=n=>{if(!a)return;let e=g(n);if(!e)return;let i=e.getBoundingClientRect();Object.assign(o.style,{display:"block",left:`${i.left}px`,top:`${i.top}px`,width:`${i.width}px`,height:`${i.height}px`})},v=n=>{if(!a)return;let e=g(n);if(!e)return;n.preventDefault(),n.stopImmediatePropagation(),a=!1,o.style.display="none";let i=b(e),u={selector:i,tag:e.tagName.toLowerCase(),text:(e.textContent??"").slice(0,1e3),href:e.getAttribute("href")??"",src:e.getAttribute("src")??"",matches:document.querySelectorAll(i).length};l("selected",{element:u})};function p(){m||(m=!0,d?.revert(),o.remove(),clearInterval(x),removeEventListener("message",E),removeEventListener("mousemove",h,!0),removeEventListener("click",v,!0),removeEventListener("pagehide",p))}function E(n){if(n.source!==t||n.origin!==r.origin||!n.data||n.data.channel!=="indiana-visual"||n.data.nonce!==r.nonce||r.expiresAt<=Date.now())return;let e=n.data;if(e.type==="connect"&&(s=!0,l("connected")),!!s){if(e.type==="disconnect"){p();return}if(e.type==="pick"&&(a=!0),e.type==="preview")try{let i=y(e.value);d?.revert(),d=w(i,{allowJs:c.allowJs===!0&&e.allowJs,nonce:c.nonce,onError:u=>l("error",{message:String(u)})}),l("previewed",{matches:i.domMutations.map(u=>({selector:u.selector,count:document.querySelectorAll(u.selector).length}))})}catch(i){l("error",{message:String(i)})}}}addEventListener("message",E),addEventListener("mousemove",h,!0),addEventListener("click",v,!0),addEventListener("pagehide",p);let x=setInterval(()=>{if(t.closed||r.expiresAt<=Date.now()){p();return}s||l("ready")},500);return l("ready"),p}export{k as startVisualEditorAgent,b as visualElementSelector};
|