@walkeros/web-destination-pinterest 4.9.0-next-1793116456867 → 4.9.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 +14 -3
- package/README.md +4 -0
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.js +10 -10
- package/dist/examples/index.mjs +10 -10
- package/dist/index.browser.js +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/walkerOS.json +13 -13
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @walkeros/web-destination-pinterest
|
|
2
2
|
|
|
3
|
-
## 4.9.0
|
|
3
|
+
## 4.9.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
`data.term` and `data.results`, and gross fields such as Matomo `grandTotal`
|
|
14
14
|
read `data.total` first, then `data.value`. The CLI ships default event
|
|
15
15
|
contracts for common site types in `examples/contracts/`.
|
|
16
|
+
- 1306d8a: Step examples carry event timestamps in milliseconds, as the walkerOS
|
|
17
|
+
event model defines them, instead of seconds that read as a date in
|
|
18
|
+
January 1970. Where an example's output repeats the timestamp, such as
|
|
19
|
+
`event_timestamp` in the gtag include example or the event a transformer
|
|
20
|
+
example returns, the output shows the same value.
|
|
16
21
|
- 9316f2a: The `identify` description matches the destination: init calls
|
|
17
22
|
`pintrk('load', tagId)` without an identity, which is sent with
|
|
18
23
|
`pintrk('set', ...)` when it changes, and the tag takes a plain or hashed
|
|
@@ -23,18 +28,24 @@
|
|
|
23
28
|
needs to deliver. The docs page renders the install line, the integrated code
|
|
24
29
|
and the flow from it, and the package test runs the same settings, so the
|
|
25
30
|
setup a reader copies is the one that was tested.
|
|
31
|
+
- Updated dependencies [a67546d]
|
|
26
32
|
- Updated dependencies [29d2218]
|
|
33
|
+
- Updated dependencies [1306d8a]
|
|
27
34
|
- Updated dependencies [34fd225]
|
|
28
35
|
- Updated dependencies [5313635]
|
|
36
|
+
- Updated dependencies [1306d8a]
|
|
37
|
+
- Updated dependencies [fa46337]
|
|
29
38
|
- Updated dependencies [5313635]
|
|
30
39
|
- Updated dependencies [5313635]
|
|
31
40
|
- Updated dependencies [5313635]
|
|
32
41
|
- Updated dependencies [5313635]
|
|
33
42
|
- Updated dependencies [34fd225]
|
|
43
|
+
- Updated dependencies [fa46337]
|
|
44
|
+
- Updated dependencies [1306d8a]
|
|
34
45
|
- Updated dependencies [5313635]
|
|
35
46
|
- Updated dependencies [5313635]
|
|
36
|
-
- @walkeros/
|
|
37
|
-
- @walkeros/core@4.9.0
|
|
47
|
+
- @walkeros/core@4.9.0
|
|
48
|
+
- @walkeros/web-core@4.9.0
|
|
38
49
|
|
|
39
50
|
## 4.8.2
|
|
40
51
|
|
package/README.md
CHANGED
|
@@ -41,6 +41,10 @@ npm install @walkeros/web-destination-pinterest
|
|
|
41
41
|
}
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
This quick start sets no consent, so the Pinterest Tag loads and receives every
|
|
45
|
+
event without consent, and a revocation changes nothing: add
|
|
46
|
+
`consent: { marketing: true }` to `config` before you go live, see the docs.
|
|
47
|
+
|
|
44
48
|
## Documentation
|
|
45
49
|
|
|
46
50
|
Full configuration, mapping, and examples live in the docs:
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,r=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},d={};r(d,{examples:()=>g,schemas:()=>o}),module.exports=(e=d,((e,r,d,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of i(r))n.call(e,c)||c===d||t(e,c,{get:()=>r[c],enumerable:!(o=a(r,c))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};r(o,{MappingSchema:()=>l,SettingsSchema:()=>p,mapping:()=>v,settings:()=>m});var c=require("@walkeros/core/dev"),s=require("@walkeros/core/dev"),p=s.z.object({apiKey:s.z.string().regex(/^\d+$/,"Must be a numeric Pinterest Tag ID").min(6).describe('Your Pinterest Tag ID (numeric string, e.g. "2612345678901"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk("load", tagId).'),pageview:s.z.boolean().describe('Call pintrk("page") once in init, as Pinterest\'s base code does. Default true. Set false to leave the call out.').optional(),identify:s.z.unknown().describe('walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk("set", data) when it changes; init calls pintrk("load", tagId) without it.').optional()}).strict(),u=require("@walkeros/core/dev"),l=u.z.object({identify:u.z.unknown().describe('Per-event identity override. Resolves to { em?, external_id? } and fires pintrk("set", data) when the resolved value differs from the current state.').optional()}),m=(0,c.zodToSchema)(p),v=(0,c.zodToSchema)(l),g={};r(g,{env:()=>h,minimal:()=>I,step:()=>f});var h={};r(h,{init:()=>_,push:()=>y,simulation:()=>w});var k=Object.assign(()=>{},{queue:[],version:"3.0"}),_={window:{pintrk:void 0}},y={window:{pintrk:k}},w=["call:window.pintrk"],f={};r(f,{consentGrant:()=>z,consentRevoke:()=>C,defaultForward:()=>E,identifyOnlySilent:()=>O,identifyOnlySilentWithoutData:()=>D,orderCompleteCheckout:()=>R,pageViewRename:()=>q,productAddToCart:()=>A,productViewContent:()=>j,silentRule:()=>T,siteSearch:()=>S,userLoginLead:()=>x,wildcardIgnored:()=>P});var b=require("@walkeros/core"),E={title:"Default forward",description:"Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.",in:(0,b.getEvent)("page view",{timestamp:
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,r=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},d={};r(d,{examples:()=>g,schemas:()=>o}),module.exports=(e=d,((e,r,d,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of i(r))n.call(e,c)||c===d||t(e,c,{get:()=>r[c],enumerable:!(o=a(r,c))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};r(o,{MappingSchema:()=>l,SettingsSchema:()=>p,mapping:()=>v,settings:()=>m});var c=require("@walkeros/core/dev"),s=require("@walkeros/core/dev"),p=s.z.object({apiKey:s.z.string().regex(/^\d+$/,"Must be a numeric Pinterest Tag ID").min(6).describe('Your Pinterest Tag ID (numeric string, e.g. "2612345678901"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk("load", tagId).'),pageview:s.z.boolean().describe('Call pintrk("page") once in init, as Pinterest\'s base code does. Default true. Set false to leave the call out.').optional(),identify:s.z.unknown().describe('walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk("set", data) when it changes; init calls pintrk("load", tagId) without it.').optional()}).strict(),u=require("@walkeros/core/dev"),l=u.z.object({identify:u.z.unknown().describe('Per-event identity override. Resolves to { em?, external_id? } and fires pintrk("set", data) when the resolved value differs from the current state.').optional()}),m=(0,c.zodToSchema)(p),v=(0,c.zodToSchema)(l),g={};r(g,{env:()=>h,minimal:()=>I,step:()=>f});var h={};r(h,{init:()=>_,push:()=>y,simulation:()=>w});var k=Object.assign(()=>{},{queue:[],version:"3.0"}),_={window:{pintrk:void 0}},y={window:{pintrk:k}},w=["call:window.pintrk"],f={};r(f,{consentGrant:()=>z,consentRevoke:()=>C,defaultForward:()=>E,identifyOnlySilent:()=>O,identifyOnlySilentWithoutData:()=>D,orderCompleteCheckout:()=>R,pageViewRename:()=>q,productAddToCart:()=>A,productViewContent:()=>j,silentRule:()=>T,siteSearch:()=>S,userLoginLead:()=>x,wildcardIgnored:()=>P});var b=require("@walkeros/core"),E={title:"Default forward",description:"Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.",in:(0,b.getEvent)("page view",{timestamp:17000001e5,id:"ev-1700000100"}),mapping:void 0,out:[["pintrk","track","page view",{event_id:"ev-1700000100"}]]},P={public:!1,in:(0,b.createEvent)({name:"debug noise",timestamp:1700000101e3}),mapping:{ignore:!0},out:[]},q={title:"Page visit",description:"A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.",in:(0,b.getEvent)("page view",{timestamp:1700000102e3,id:"ev-1700000102"}),mapping:{name:"pagevisit"},out:[["pintrk","track","pagevisit",{event_id:"ev-1700000102"}]]},S={title:"Search",description:"A search submit fires Pinterest search with the search_query field resolved from event data.",in:(0,b.createEvent)({name:"search submit",timestamp:1700000103e3,id:"ev-1700000103",data:{term:"leather jacket"}}),mapping:{name:"search",data:{map:{search_query:"data.term"}}},out:[["pintrk","track","search",{search_query:"leather jacket",event_id:"ev-1700000103"}]]},j={title:"View content",description:"A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.",in:(0,b.getEvent)("product view",{timestamp:1700000104e3,id:"ev-1700000104"}),mapping:{name:"viewcontent",data:{map:{value:"data.price",currency:{key:"data.currency",value:"EUR"},line_items:{set:[{map:{product_id:"data.id",product_name:"data.name",product_price:"data.price"}}]}}}},out:[["pintrk","track","viewcontent",{value:420,currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420}],event_id:"ev-1700000104"}]]},A={title:"Add to cart",description:"A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.",in:(0,b.getEvent)("product add",{timestamp:1700000105e3,id:"ev-1700000105"}),mapping:{name:"addtocart",data:{map:{value:"data.price",order_quantity:{value:1},currency:{key:"data.currency",value:"EUR"},line_items:{set:[{map:{product_id:"data.id",product_name:"data.name",product_price:"data.price",product_quantity:{value:1}}}]}}}},out:[["pintrk","track","addtocart",{value:420,order_quantity:1,currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420,product_quantity:1}],event_id:"ev-1700000105"}]]},R={title:"Checkout",description:"A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.",in:(0,b.getEvent)("order complete",{timestamp:1700000106e3,id:"ev-1700000106"}),mapping:{name:"checkout",data:{map:{value:"data.value",order_id:"data.id",currency:{key:"data.currency",value:"EUR"},line_items:{loop:["nested",{condition:e=>"object"==typeof e&&null!==e&&"data"in e&&"object"==typeof e.data&&null!==e.data&&"price"in e.data&&"number"==typeof e.data.price,map:{product_id:"data.id",product_name:"data.name",product_price:"data.price",product_quantity:{value:1}}}]}}}},out:[["pintrk","track","checkout",{value:462,order_id:"0rd3r1d",currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420,product_quantity:1},{product_id:"cc",product_name:"Cool Cap",product_price:42,product_quantity:1}],event_id:"ev-1700000106"}]]},x={title:"Lead with matching",description:"A user login fires pintrk set for enhanced matching and then a lead conversion track call.",in:(0,b.createEvent)({name:"user login",timestamp:1700000107e3,id:"ev-1700000107",data:{id:"usr_123",email:"jane@example.com"}}),mapping:{name:"lead",settings:{identify:{map:{em:"data.email",external_id:"data.id"}}},data:{map:{lead_type:{value:"login"}}}},out:[["pintrk","set",{em:"jane@example.com",external_id:"usr_123"}],["pintrk","track","lead",{lead_type:"login",event_id:"ev-1700000107"}]]},O={title:"Identify only",description:"A user update fires pintrk set for enhanced matching without a track call via mapping silent.",in:(0,b.createEvent)({name:"user update",timestamp:1700000108e3,id:"ev-1700000108",data:{id:"usr_456",email:"new@example.com"}}),mapping:{silent:!0,settings:{identify:{map:{em:"data.email",external_id:"data.id"}}}},out:[["pintrk","set",{em:"new@example.com",external_id:"usr_456"}]]},C={public:!1,description:"For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.",command:"consent",in:{marketing:!1},out:[]},z={public:!1,description:"A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.",command:"consent",in:{marketing:!0},out:[]},T={public:!1,description:"A rule with silent: true sends no pintrk track call.",in:(0,b.createEvent)({name:"page view",timestamp:1700000109e3}),mapping:{silent:!0},out:[]},D={public:!1,description:"A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.",in:{name:"user update",entity:"user",action:"update"},mapping:O.mapping,out:[]},I={settings:{apiKey:"2612345678901"}};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/minimal.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n apiKey: z\n .string()\n .regex(/^\\d+$/, 'Must be a numeric Pinterest Tag ID')\n .min(6)\n .describe(\n 'Your Pinterest Tag ID (numeric string, e.g. \"2612345678901\"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk(\"load\", tagId).',\n ),\n pageview: z\n .boolean()\n .describe(\n 'Call pintrk(\"page\") once in init, as Pinterest\\'s base code does. Default true. Set false to leave the call out.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk(\"set\", data) when it changes; init calls pintrk(\"load\", tagId) without it.',\n )\n .optional(),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity override. Resolves to { em?, external_id? } and fires pintrk(\"set\", data) when the resolved value differs from the current state.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\nexport { minimal } from './minimal';\n","import type { Env, Pintrk } from '../types';\n\n/**\n * Example environment configurations for the Pinterest destination.\n *\n * These mock window.pintrk, allowing tests to run in a pure\n * Node environment without jsdom and without touching the real Pinterest\n * CDN. Tests replace env.window.pintrk with a jest.fn() spy.\n */\n\nconst noop = () => {};\n\nconst noopPintrk: Pintrk = Object.assign(noop, {\n queue: [],\n version: '3.0',\n});\n\n/**\n * Pre-init environment: pintrk is not yet on the window.\n * Used to validate the init path that creates the queue function.\n */\nexport const init: Env = {\n window: {\n pintrk: undefined,\n },\n};\n\n/**\n * Post-init environment: pintrk is available as a spy-able function.\n * Tests clone this and replace `pintrk` with a jest.fn() to record calls.\n */\nexport const push: Env = {\n window: {\n pintrk: noopPintrk,\n },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = ['call:window.pintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { createEvent, getEvent } from '@walkeros/core';\n\n/**\n * Output convention:\n * - Single SDK call: out = [['pintrk', 'track', 'checkout', { ... }]]\n * - Multiple SDK calls: out = [['pintrk', ...], ['pintrk', ...]]\n * - Zero SDK calls: out = []\n */\n\n/**\n * Default event forwarding - no rule. Without a mapping.name, the walkerOS\n * event name is forwarded as-is. Pinterest accepts it but won't match a\n * standard conversion event. event_id is auto-attached for deduplication.\n */\nexport const defaultForward: Flow.StepExample = {\n title: 'Default forward',\n description:\n 'Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.',\n in: getEvent('page view', { timestamp: 1700000100, id: 'ev-1700000100' }),\n mapping: undefined,\n out: [['pintrk', 'track', 'page view', { event_id: 'ev-1700000100' }]],\n};\n\n/**\n * Wildcard ignore pattern - the standard walkerOS way to suppress noisy\n * events. `mapping.ignore: true` at rule level produces zero SDK calls.\n */\nexport const wildcardIgnored: Flow.StepExample = {\n public: false,\n in: createEvent({ name: 'debug noise', timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Standard Pinterest event rename via mapping.name. walkerOS \"page view\"\n * → Pinterest \"pagevisit\". The ONLY way to get Pinterest to recognize\n * a conversion event - the destination never auto-maps.\n */\nexport const pageViewRename: Flow.StepExample = {\n title: 'Page visit',\n description:\n 'A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.',\n in: getEvent('page view', { timestamp: 1700000102, id: 'ev-1700000102' }),\n mapping: { name: 'pagevisit' },\n out: [['pintrk', 'track', 'pagevisit', { event_id: 'ev-1700000102' }]],\n};\n\n/**\n * Search - walkerOS search submit → Pinterest \"search\" with search_query.\n * Illustrates single-field mapping.data resolution.\n */\nexport const siteSearch: Flow.StepExample = {\n title: 'Search',\n description:\n 'A search submit fires Pinterest search with the search_query field resolved from event data.',\n in: createEvent({\n name: 'search submit',\n timestamp: 1700000103,\n id: 'ev-1700000103',\n data: { term: 'leather jacket' },\n }),\n mapping: {\n name: 'search',\n data: {\n map: {\n search_query: 'data.term',\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'search',\n {\n search_query: 'leather jacket',\n event_id: 'ev-1700000103',\n },\n ],\n ],\n};\n\n/**\n * Single-product viewcontent.\n */\nexport const productViewContent: Flow.StepExample = {\n title: 'View content',\n description:\n 'A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.',\n in: getEvent('product view', {\n timestamp: 1700000104,\n id: 'ev-1700000104',\n }),\n mapping: {\n name: 'viewcontent',\n data: {\n map: {\n value: 'data.price',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'viewcontent',\n {\n value: 420,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n },\n ],\n event_id: 'ev-1700000104',\n },\n ],\n ],\n};\n\n/**\n * Add-to-cart with an inline line_items array.\n */\nexport const productAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.',\n in: getEvent('product add', {\n timestamp: 1700000105,\n id: 'ev-1700000105',\n }),\n mapping: {\n name: 'addtocart',\n data: {\n map: {\n value: 'data.price',\n order_quantity: { value: 1 },\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'addtocart',\n {\n value: 420,\n order_quantity: 1,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000105',\n },\n ],\n ],\n};\n\n/**\n * Multi-product checkout - the canonical Pinterest ecommerce pattern.\n */\nexport const orderCompleteCheckout: Flow.StepExample = {\n title: 'Checkout',\n description:\n 'A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.',\n in: getEvent('order complete', {\n timestamp: 1700000106,\n id: 'ev-1700000106',\n }),\n mapping: {\n name: 'checkout',\n data: {\n map: {\n value: 'data.value',\n order_id: 'data.id',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n loop: [\n 'nested',\n {\n condition: (value: unknown) =>\n typeof value === 'object' &&\n value !== null &&\n 'data' in value &&\n typeof value.data === 'object' &&\n value.data !== null &&\n 'price' in value.data &&\n typeof value.data.price === 'number',\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'checkout',\n {\n value: 462,\n order_id: '0rd3r1d',\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n {\n product_id: 'cc',\n product_name: 'Cool Cap',\n product_price: 42,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000106',\n },\n ],\n ],\n};\n\n/**\n * Lead conversion with per-event enhanced matching update.\n */\nexport const userLoginLead: Flow.StepExample = {\n title: 'Lead with matching',\n description:\n 'A user login fires pintrk set for enhanced matching and then a lead conversion track call.',\n in: createEvent({\n name: 'user login',\n timestamp: 1700000107,\n id: 'ev-1700000107',\n data: {\n id: 'usr_123',\n email: 'jane@example.com',\n },\n }),\n mapping: {\n name: 'lead',\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n data: {\n map: {\n lead_type: { value: 'login' },\n },\n },\n },\n out: [\n ['pintrk', 'set', { em: 'jane@example.com', external_id: 'usr_123' }],\n [\n 'pintrk',\n 'track',\n 'lead',\n {\n lead_type: 'login',\n event_id: 'ev-1700000107',\n },\n ],\n ],\n};\n\n/**\n * mapping.silent - processes side effects (identify set) but suppresses\n * the default pintrk('track', ...) call.\n */\nexport const identifyOnlySilent: Flow.StepExample = {\n title: 'Identify only',\n description:\n 'A user update fires pintrk set for enhanced matching without a track call via mapping silent.',\n in: createEvent({\n name: 'user update',\n timestamp: 1700000108,\n id: 'ev-1700000108',\n data: {\n id: 'usr_456',\n email: 'new@example.com',\n },\n }),\n mapping: {\n silent: true,\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n },\n out: [['pintrk', 'set', { em: 'new@example.com', external_id: 'usr_456' }]],\n};\n\n/**\n * Consent revocation - walkerOS walker consent { marketing: false }.\n * The destination's on('consent') handler flips the runtime state flag\n * and stops calling pintrk('track', ...) for subsequent events.\n */\nexport const consentRevoke: Flow.StepExample = {\n public: false,\n description:\n 'For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.',\n command: 'consent',\n in: { marketing: false },\n out: [],\n};\n\n/**\n * Consent grant - explicit opt-in.\n */\nexport const consentGrant: Flow.StepExample = {\n public: false,\n description:\n 'A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.',\n command: 'consent',\n in: { marketing: true },\n out: [],\n};\n\n/** A silent rule sends no track call and no identity. */\nexport const silentRule: Flow.StepExample = {\n public: false,\n description: 'A rule with silent: true sends no pintrk track call.',\n in: createEvent({ name: 'page view', timestamp: 1700000109 }),\n mapping: { silent: true },\n out: [],\n};\n\n/**\n * The silent identify rule of identifyOnlySilent on an update without data:\n * no identity resolves and the rule suppresses the track, so nothing is\n * sent. A declared skip: an unmet mapping, not a failure.\n */\nexport const identifyOnlySilentWithoutData: Flow.StepExample = {\n public: false,\n description:\n 'A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: { name: 'user update', entity: 'user', action: 'update' },\n mapping: identifyOnlySilent.mapping,\n out: [],\n};\n","import type { Flow } from '@walkeros/core';\n\n/** The settings the Pinterest Tag needs to deliver: the Tag ID. */\nexport const minimal: Flow.MinimalExample = {\n settings: { apiKey: '2612345678901' },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAC3B,OAAO;AAAA,EACN,QAAQ,aACL,OAAO,EACP,MAAM,SAAS,oCAAoC,EACnD,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR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ACE;AAAA,EACF,IAAI,EAAE,MAAM,eAAe,QAAQ,QAAQ,QAAQ,SAAS;AAAA,EAC5D,SAAS,mBAAmB;AAAA,EAC5B,KAAK,CAAC;AACR;;;AChYO,IAAM,UAA+B;AAAA,EAC1C,UAAU,EAAE,QAAQ,gBAAgB;AACtC;","names":["import_dev","import_dev"]}
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/minimal.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n apiKey: z\n .string()\n .regex(/^\\d+$/, 'Must be a numeric Pinterest Tag ID')\n .min(6)\n .describe(\n 'Your Pinterest Tag ID (numeric string, e.g. \"2612345678901\"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk(\"load\", tagId).',\n ),\n pageview: z\n .boolean()\n .describe(\n 'Call pintrk(\"page\") once in init, as Pinterest\\'s base code does. Default true. Set false to leave the call out.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk(\"set\", data) when it changes; init calls pintrk(\"load\", tagId) without it.',\n )\n .optional(),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity override. Resolves to { em?, external_id? } and fires pintrk(\"set\", data) when the resolved value differs from the current state.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\nexport { minimal } from './minimal';\n","import type { Env, Pintrk } from '../types';\n\n/**\n * Example environment configurations for the Pinterest destination.\n *\n * These mock window.pintrk, allowing tests to run in a pure\n * Node environment without jsdom and without touching the real Pinterest\n * CDN. Tests replace env.window.pintrk with a jest.fn() spy.\n */\n\nconst noop = () => {};\n\nconst noopPintrk: Pintrk = Object.assign(noop, {\n queue: [],\n version: '3.0',\n});\n\n/**\n * Pre-init environment: pintrk is not yet on the window.\n * Used to validate the init path that creates the queue function.\n */\nexport const init: Env = {\n window: {\n pintrk: undefined,\n },\n};\n\n/**\n * Post-init environment: pintrk is available as a spy-able function.\n * Tests clone this and replace `pintrk` with a jest.fn() to record calls.\n */\nexport const push: Env = {\n window: {\n pintrk: noopPintrk,\n },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = ['call:window.pintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { createEvent, getEvent } from '@walkeros/core';\n\n/**\n * Output convention:\n * - Single SDK call: out = [['pintrk', 'track', 'checkout', { ... }]]\n * - Multiple SDK calls: out = [['pintrk', ...], ['pintrk', ...]]\n * - Zero SDK calls: out = []\n */\n\n/**\n * Default event forwarding - no rule. Without a mapping.name, the walkerOS\n * event name is forwarded as-is. Pinterest accepts it but won't match a\n * standard conversion event. event_id is auto-attached for deduplication.\n */\nexport const defaultForward: Flow.StepExample = {\n title: 'Default forward',\n description:\n 'Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.',\n in: getEvent('page view', { timestamp: 1700000100000, id: 'ev-1700000100' }),\n mapping: undefined,\n out: [['pintrk', 'track', 'page view', { event_id: 'ev-1700000100' }]],\n};\n\n/**\n * Wildcard ignore pattern - the standard walkerOS way to suppress noisy\n * events. `mapping.ignore: true` at rule level produces zero SDK calls.\n */\nexport const wildcardIgnored: Flow.StepExample = {\n public: false,\n in: createEvent({ name: 'debug noise', timestamp: 1700000101000 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Standard Pinterest event rename via mapping.name. walkerOS \"page view\"\n * → Pinterest \"pagevisit\". The ONLY way to get Pinterest to recognize\n * a conversion event - the destination never auto-maps.\n */\nexport const pageViewRename: Flow.StepExample = {\n title: 'Page visit',\n description:\n 'A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.',\n in: getEvent('page view', { timestamp: 1700000102000, id: 'ev-1700000102' }),\n mapping: { name: 'pagevisit' },\n out: [['pintrk', 'track', 'pagevisit', { event_id: 'ev-1700000102' }]],\n};\n\n/**\n * Search - walkerOS search submit → Pinterest \"search\" with search_query.\n * Illustrates single-field mapping.data resolution.\n */\nexport const siteSearch: Flow.StepExample = {\n title: 'Search',\n description:\n 'A search submit fires Pinterest search with the search_query field resolved from event data.',\n in: createEvent({\n name: 'search submit',\n timestamp: 1700000103000,\n id: 'ev-1700000103',\n data: { term: 'leather jacket' },\n }),\n mapping: {\n name: 'search',\n data: {\n map: {\n search_query: 'data.term',\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'search',\n {\n search_query: 'leather jacket',\n event_id: 'ev-1700000103',\n },\n ],\n ],\n};\n\n/**\n * Single-product viewcontent.\n */\nexport const productViewContent: Flow.StepExample = {\n title: 'View content',\n description:\n 'A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.',\n in: getEvent('product view', {\n timestamp: 1700000104000,\n id: 'ev-1700000104',\n }),\n mapping: {\n name: 'viewcontent',\n data: {\n map: {\n value: 'data.price',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'viewcontent',\n {\n value: 420,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n },\n ],\n event_id: 'ev-1700000104',\n },\n ],\n ],\n};\n\n/**\n * Add-to-cart with an inline line_items array.\n */\nexport const productAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.',\n in: getEvent('product add', {\n timestamp: 1700000105000,\n id: 'ev-1700000105',\n }),\n mapping: {\n name: 'addtocart',\n data: {\n map: {\n value: 'data.price',\n order_quantity: { value: 1 },\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'addtocart',\n {\n value: 420,\n order_quantity: 1,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000105',\n },\n ],\n ],\n};\n\n/**\n * Multi-product checkout - the canonical Pinterest ecommerce pattern.\n */\nexport const orderCompleteCheckout: Flow.StepExample = {\n title: 'Checkout',\n description:\n 'A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.',\n in: getEvent('order complete', {\n timestamp: 1700000106000,\n id: 'ev-1700000106',\n }),\n mapping: {\n name: 'checkout',\n data: {\n map: {\n value: 'data.value',\n order_id: 'data.id',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n loop: [\n 'nested',\n {\n condition: (value: unknown) =>\n typeof value === 'object' &&\n value !== null &&\n 'data' in value &&\n typeof value.data === 'object' &&\n value.data !== null &&\n 'price' in value.data &&\n typeof value.data.price === 'number',\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'checkout',\n {\n value: 462,\n order_id: '0rd3r1d',\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n {\n product_id: 'cc',\n product_name: 'Cool Cap',\n product_price: 42,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000106',\n },\n ],\n ],\n};\n\n/**\n * Lead conversion with per-event enhanced matching update.\n */\nexport const userLoginLead: Flow.StepExample = {\n title: 'Lead with matching',\n description:\n 'A user login fires pintrk set for enhanced matching and then a lead conversion track call.',\n in: createEvent({\n name: 'user login',\n timestamp: 1700000107000,\n id: 'ev-1700000107',\n data: {\n id: 'usr_123',\n email: 'jane@example.com',\n },\n }),\n mapping: {\n name: 'lead',\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n data: {\n map: {\n lead_type: { value: 'login' },\n },\n },\n },\n out: [\n ['pintrk', 'set', { em: 'jane@example.com', external_id: 'usr_123' }],\n [\n 'pintrk',\n 'track',\n 'lead',\n {\n lead_type: 'login',\n event_id: 'ev-1700000107',\n },\n ],\n ],\n};\n\n/**\n * mapping.silent - processes side effects (identify set) but suppresses\n * the default pintrk('track', ...) call.\n */\nexport const identifyOnlySilent: Flow.StepExample = {\n title: 'Identify only',\n description:\n 'A user update fires pintrk set for enhanced matching without a track call via mapping silent.',\n in: createEvent({\n name: 'user update',\n timestamp: 1700000108000,\n id: 'ev-1700000108',\n data: {\n id: 'usr_456',\n email: 'new@example.com',\n },\n }),\n mapping: {\n silent: true,\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n },\n out: [['pintrk', 'set', { em: 'new@example.com', external_id: 'usr_456' }]],\n};\n\n/**\n * Consent revocation - walkerOS walker consent { marketing: false }.\n * The destination's on('consent') handler flips the runtime state flag\n * and stops calling pintrk('track', ...) for subsequent events.\n */\nexport const consentRevoke: Flow.StepExample = {\n public: false,\n description:\n 'For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.',\n command: 'consent',\n in: { marketing: false },\n out: [],\n};\n\n/**\n * Consent grant - explicit opt-in.\n */\nexport const consentGrant: Flow.StepExample = {\n public: false,\n description:\n 'A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.',\n command: 'consent',\n in: { marketing: true },\n out: [],\n};\n\n/** A silent rule sends no track call and no identity. */\nexport const silentRule: Flow.StepExample = {\n public: false,\n description: 'A rule with silent: true sends no pintrk track call.',\n in: createEvent({ name: 'page view', timestamp: 1700000109000 }),\n mapping: { silent: true },\n out: [],\n};\n\n/**\n * The silent identify rule of identifyOnlySilent on an update without data:\n * no identity resolves and the rule suppresses the track, so nothing is\n * sent. A declared skip: an unmet mapping, not a failure.\n */\nexport const identifyOnlySilentWithoutData: Flow.StepExample = {\n public: false,\n description:\n 'A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: { name: 'user update', entity: 'user', action: 'update' },\n mapping: identifyOnlySilent.mapping,\n out: [],\n};\n","import type { Flow } from '@walkeros/core';\n\n/** The settings the Pinterest Tag needs to deliver: the Tag ID. */\nexport const minimal: Flow.MinimalExample = {\n settings: { apiKey: '2612345678901' },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAC3B,OAAO;AAAA,EACN,QAAQ,aACL,OAAO,EACP,MAAM,SAAS,oCAAoC,EACnD,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC,EACA,OAAO;;;ACxBV,IAAAC,cAAkB;AAEX,IAAM,gBAAgB,cAA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C5B,KAAK,CAAC;AACR;;;AChYO,IAAM,UAA+B;AAAA,EAC1C,UAAU,EAAE,QAAQ,gBAAgB;AACtC;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,a)=>{for(var i in a)e(t,i,{get:a[i],enumerable:!0})},a={};t(a,{MappingSchema:()=>o,SettingsSchema:()=>r,mapping:()=>s,settings:()=>c});import{zodToSchema as i}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var r=n.object({apiKey:n.string().regex(/^\d+$/,"Must be a numeric Pinterest Tag ID").min(6).describe('Your Pinterest Tag ID (numeric string, e.g. "2612345678901"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk("load", tagId).'),pageview:n.boolean().describe('Call pintrk("page") once in init, as Pinterest\'s base code does. Default true. Set false to leave the call out.').optional(),identify:n.unknown().describe('walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk("set", data) when it changes; init calls pintrk("load", tagId) without it.').optional()}).strict();import{z as d}from"@walkeros/core/dev";var o=d.object({identify:d.unknown().describe('Per-event identity override. Resolves to { em?, external_id? } and fires pintrk("set", data) when the resolved value differs from the current state.').optional()}),c=i(r),s=i(o),p={};t(p,{env:()=>u,minimal:()=>I,step:()=>k});var u={};t(u,{init:()=>m,push:()=>v,simulation:()=>g});var l=Object.assign(()=>{},{queue:[],version:"3.0"}),m={window:{pintrk:void 0}},v={window:{pintrk:l}},g=["call:window.pintrk"],k={};t(k,{consentGrant:()=>j,consentRevoke:()=>q,defaultForward:()=>y,identifyOnlySilent:()=>S,identifyOnlySilentWithoutData:()=>E,orderCompleteCheckout:()=>R,pageViewRename:()=>f,productAddToCart:()=>A,productViewContent:()=>P,silentRule:()=>C,siteSearch:()=>b,userLoginLead:()=>x,wildcardIgnored:()=>w});import{createEvent as h,getEvent as _}from"@walkeros/core";var y={title:"Default forward",description:"Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.",in:_("page view",{timestamp:
|
|
1
|
+
var e=Object.defineProperty,t=(t,a)=>{for(var i in a)e(t,i,{get:a[i],enumerable:!0})},a={};t(a,{MappingSchema:()=>o,SettingsSchema:()=>r,mapping:()=>s,settings:()=>c});import{zodToSchema as i}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var r=n.object({apiKey:n.string().regex(/^\d+$/,"Must be a numeric Pinterest Tag ID").min(6).describe('Your Pinterest Tag ID (numeric string, e.g. "2612345678901"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk("load", tagId).'),pageview:n.boolean().describe('Call pintrk("page") once in init, as Pinterest\'s base code does. Default true. Set false to leave the call out.').optional(),identify:n.unknown().describe('walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk("set", data) when it changes; init calls pintrk("load", tagId) without it.').optional()}).strict();import{z as d}from"@walkeros/core/dev";var o=d.object({identify:d.unknown().describe('Per-event identity override. Resolves to { em?, external_id? } and fires pintrk("set", data) when the resolved value differs from the current state.').optional()}),c=i(r),s=i(o),p={};t(p,{env:()=>u,minimal:()=>I,step:()=>k});var u={};t(u,{init:()=>m,push:()=>v,simulation:()=>g});var l=Object.assign(()=>{},{queue:[],version:"3.0"}),m={window:{pintrk:void 0}},v={window:{pintrk:l}},g=["call:window.pintrk"],k={};t(k,{consentGrant:()=>j,consentRevoke:()=>q,defaultForward:()=>y,identifyOnlySilent:()=>S,identifyOnlySilentWithoutData:()=>E,orderCompleteCheckout:()=>R,pageViewRename:()=>f,productAddToCart:()=>A,productViewContent:()=>P,silentRule:()=>C,siteSearch:()=>b,userLoginLead:()=>x,wildcardIgnored:()=>w});import{createEvent as h,getEvent as _}from"@walkeros/core";var y={title:"Default forward",description:"Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.",in:_("page view",{timestamp:17000001e5,id:"ev-1700000100"}),mapping:void 0,out:[["pintrk","track","page view",{event_id:"ev-1700000100"}]]},w={public:!1,in:h({name:"debug noise",timestamp:1700000101e3}),mapping:{ignore:!0},out:[]},f={title:"Page visit",description:"A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.",in:_("page view",{timestamp:1700000102e3,id:"ev-1700000102"}),mapping:{name:"pagevisit"},out:[["pintrk","track","pagevisit",{event_id:"ev-1700000102"}]]},b={title:"Search",description:"A search submit fires Pinterest search with the search_query field resolved from event data.",in:h({name:"search submit",timestamp:1700000103e3,id:"ev-1700000103",data:{term:"leather jacket"}}),mapping:{name:"search",data:{map:{search_query:"data.term"}}},out:[["pintrk","track","search",{search_query:"leather jacket",event_id:"ev-1700000103"}]]},P={title:"View content",description:"A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.",in:_("product view",{timestamp:1700000104e3,id:"ev-1700000104"}),mapping:{name:"viewcontent",data:{map:{value:"data.price",currency:{key:"data.currency",value:"EUR"},line_items:{set:[{map:{product_id:"data.id",product_name:"data.name",product_price:"data.price"}}]}}}},out:[["pintrk","track","viewcontent",{value:420,currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420}],event_id:"ev-1700000104"}]]},A={title:"Add to cart",description:"A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.",in:_("product add",{timestamp:1700000105e3,id:"ev-1700000105"}),mapping:{name:"addtocart",data:{map:{value:"data.price",order_quantity:{value:1},currency:{key:"data.currency",value:"EUR"},line_items:{set:[{map:{product_id:"data.id",product_name:"data.name",product_price:"data.price",product_quantity:{value:1}}}]}}}},out:[["pintrk","track","addtocart",{value:420,order_quantity:1,currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420,product_quantity:1}],event_id:"ev-1700000105"}]]},R={title:"Checkout",description:"A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.",in:_("order complete",{timestamp:1700000106e3,id:"ev-1700000106"}),mapping:{name:"checkout",data:{map:{value:"data.value",order_id:"data.id",currency:{key:"data.currency",value:"EUR"},line_items:{loop:["nested",{condition:e=>"object"==typeof e&&null!==e&&"data"in e&&"object"==typeof e.data&&null!==e.data&&"price"in e.data&&"number"==typeof e.data.price,map:{product_id:"data.id",product_name:"data.name",product_price:"data.price",product_quantity:{value:1}}}]}}}},out:[["pintrk","track","checkout",{value:462,order_id:"0rd3r1d",currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420,product_quantity:1},{product_id:"cc",product_name:"Cool Cap",product_price:42,product_quantity:1}],event_id:"ev-1700000106"}]]},x={title:"Lead with matching",description:"A user login fires pintrk set for enhanced matching and then a lead conversion track call.",in:h({name:"user login",timestamp:1700000107e3,id:"ev-1700000107",data:{id:"usr_123",email:"jane@example.com"}}),mapping:{name:"lead",settings:{identify:{map:{em:"data.email",external_id:"data.id"}}},data:{map:{lead_type:{value:"login"}}}},out:[["pintrk","set",{em:"jane@example.com",external_id:"usr_123"}],["pintrk","track","lead",{lead_type:"login",event_id:"ev-1700000107"}]]},S={title:"Identify only",description:"A user update fires pintrk set for enhanced matching without a track call via mapping silent.",in:h({name:"user update",timestamp:1700000108e3,id:"ev-1700000108",data:{id:"usr_456",email:"new@example.com"}}),mapping:{silent:!0,settings:{identify:{map:{em:"data.email",external_id:"data.id"}}}},out:[["pintrk","set",{em:"new@example.com",external_id:"usr_456"}]]},q={public:!1,description:"For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.",command:"consent",in:{marketing:!1},out:[]},j={public:!1,description:"A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.",command:"consent",in:{marketing:!0},out:[]},C={public:!1,description:"A rule with silent: true sends no pintrk track call.",in:h({name:"page view",timestamp:1700000109e3}),mapping:{silent:!0},out:[]},E={public:!1,description:"A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.",in:{name:"user update",entity:"user",action:"update"},mapping:S.mapping,out:[]},I={settings:{apiKey:"2612345678901"}};export{p as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/minimal.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n apiKey: z\n .string()\n .regex(/^\\d+$/, 'Must be a numeric Pinterest Tag ID')\n .min(6)\n .describe(\n 'Your Pinterest Tag ID (numeric string, e.g. \"2612345678901\"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk(\"load\", tagId).',\n ),\n pageview: z\n .boolean()\n .describe(\n 'Call pintrk(\"page\") once in init, as Pinterest\\'s base code does. Default true. Set false to leave the call out.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk(\"set\", data) when it changes; init calls pintrk(\"load\", tagId) without it.',\n )\n .optional(),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity override. Resolves to { em?, external_id? } and fires pintrk(\"set\", data) when the resolved value differs from the current state.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\nexport { minimal } from './minimal';\n","import type { Env, Pintrk } from '../types';\n\n/**\n * Example environment configurations for the Pinterest destination.\n *\n * These mock window.pintrk, allowing tests to run in a pure\n * Node environment without jsdom and without touching the real Pinterest\n * CDN. Tests replace env.window.pintrk with a jest.fn() spy.\n */\n\nconst noop = () => {};\n\nconst noopPintrk: Pintrk = Object.assign(noop, {\n queue: [],\n version: '3.0',\n});\n\n/**\n * Pre-init environment: pintrk is not yet on the window.\n * Used to validate the init path that creates the queue function.\n */\nexport const init: Env = {\n window: {\n pintrk: undefined,\n },\n};\n\n/**\n * Post-init environment: pintrk is available as a spy-able function.\n * Tests clone this and replace `pintrk` with a jest.fn() to record calls.\n */\nexport const push: Env = {\n window: {\n pintrk: noopPintrk,\n },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = ['call:window.pintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { createEvent, getEvent } from '@walkeros/core';\n\n/**\n * Output convention:\n * - Single SDK call: out = [['pintrk', 'track', 'checkout', { ... }]]\n * - Multiple SDK calls: out = [['pintrk', ...], ['pintrk', ...]]\n * - Zero SDK calls: out = []\n */\n\n/**\n * Default event forwarding - no rule. Without a mapping.name, the walkerOS\n * event name is forwarded as-is. Pinterest accepts it but won't match a\n * standard conversion event. event_id is auto-attached for deduplication.\n */\nexport const defaultForward: Flow.StepExample = {\n title: 'Default forward',\n description:\n 'Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.',\n in: getEvent('page view', { timestamp: 1700000100, id: 'ev-1700000100' }),\n mapping: undefined,\n out: [['pintrk', 'track', 'page view', { event_id: 'ev-1700000100' }]],\n};\n\n/**\n * Wildcard ignore pattern - the standard walkerOS way to suppress noisy\n * events. `mapping.ignore: true` at rule level produces zero SDK calls.\n */\nexport const wildcardIgnored: Flow.StepExample = {\n public: false,\n in: createEvent({ name: 'debug noise', timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Standard Pinterest event rename via mapping.name. walkerOS \"page view\"\n * → Pinterest \"pagevisit\". The ONLY way to get Pinterest to recognize\n * a conversion event - the destination never auto-maps.\n */\nexport const pageViewRename: Flow.StepExample = {\n title: 'Page visit',\n description:\n 'A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.',\n in: getEvent('page view', { timestamp: 1700000102, id: 'ev-1700000102' }),\n mapping: { name: 'pagevisit' },\n out: [['pintrk', 'track', 'pagevisit', { event_id: 'ev-1700000102' }]],\n};\n\n/**\n * Search - walkerOS search submit → Pinterest \"search\" with search_query.\n * Illustrates single-field mapping.data resolution.\n */\nexport const siteSearch: Flow.StepExample = {\n title: 'Search',\n description:\n 'A search submit fires Pinterest search with the search_query field resolved from event data.',\n in: createEvent({\n name: 'search submit',\n timestamp: 1700000103,\n id: 'ev-1700000103',\n data: { term: 'leather jacket' },\n }),\n mapping: {\n name: 'search',\n data: {\n map: {\n search_query: 'data.term',\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'search',\n {\n search_query: 'leather jacket',\n event_id: 'ev-1700000103',\n },\n ],\n ],\n};\n\n/**\n * Single-product viewcontent.\n */\nexport const productViewContent: Flow.StepExample = {\n title: 'View content',\n description:\n 'A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.',\n in: getEvent('product view', {\n timestamp: 1700000104,\n id: 'ev-1700000104',\n }),\n mapping: {\n name: 'viewcontent',\n data: {\n map: {\n value: 'data.price',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'viewcontent',\n {\n value: 420,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n },\n ],\n event_id: 'ev-1700000104',\n },\n ],\n ],\n};\n\n/**\n * Add-to-cart with an inline line_items array.\n */\nexport const productAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.',\n in: getEvent('product add', {\n timestamp: 1700000105,\n id: 'ev-1700000105',\n }),\n mapping: {\n name: 'addtocart',\n data: {\n map: {\n value: 'data.price',\n order_quantity: { value: 1 },\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'addtocart',\n {\n value: 420,\n order_quantity: 1,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000105',\n },\n ],\n ],\n};\n\n/**\n * Multi-product checkout - the canonical Pinterest ecommerce pattern.\n */\nexport const orderCompleteCheckout: Flow.StepExample = {\n title: 'Checkout',\n description:\n 'A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.',\n in: getEvent('order complete', {\n timestamp: 1700000106,\n id: 'ev-1700000106',\n }),\n mapping: {\n name: 'checkout',\n data: {\n map: {\n value: 'data.value',\n order_id: 'data.id',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n loop: [\n 'nested',\n {\n condition: (value: unknown) =>\n typeof value === 'object' &&\n value !== null &&\n 'data' in value &&\n typeof value.data === 'object' &&\n value.data !== null &&\n 'price' in value.data &&\n typeof value.data.price === 'number',\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'checkout',\n {\n value: 462,\n order_id: '0rd3r1d',\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n {\n product_id: 'cc',\n product_name: 'Cool Cap',\n product_price: 42,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000106',\n },\n ],\n ],\n};\n\n/**\n * Lead conversion with per-event enhanced matching update.\n */\nexport const userLoginLead: Flow.StepExample = {\n title: 'Lead with matching',\n description:\n 'A user login fires pintrk set for enhanced matching and then a lead conversion track call.',\n in: createEvent({\n name: 'user login',\n timestamp: 1700000107,\n id: 'ev-1700000107',\n data: {\n id: 'usr_123',\n email: 'jane@example.com',\n },\n }),\n mapping: {\n name: 'lead',\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n data: {\n map: {\n lead_type: { value: 'login' },\n },\n },\n },\n out: [\n ['pintrk', 'set', { em: 'jane@example.com', external_id: 'usr_123' }],\n [\n 'pintrk',\n 'track',\n 'lead',\n {\n lead_type: 'login',\n event_id: 'ev-1700000107',\n },\n ],\n ],\n};\n\n/**\n * mapping.silent - processes side effects (identify set) but suppresses\n * the default pintrk('track', ...) call.\n */\nexport const identifyOnlySilent: Flow.StepExample = {\n title: 'Identify only',\n description:\n 'A user update fires pintrk set for enhanced matching without a track call via mapping silent.',\n in: createEvent({\n name: 'user update',\n timestamp: 1700000108,\n id: 'ev-1700000108',\n data: {\n id: 'usr_456',\n email: 'new@example.com',\n },\n }),\n mapping: {\n silent: true,\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n },\n out: [['pintrk', 'set', { em: 'new@example.com', external_id: 'usr_456' }]],\n};\n\n/**\n * Consent revocation - walkerOS walker consent { marketing: false }.\n * The destination's on('consent') handler flips the runtime state flag\n * and stops calling pintrk('track', ...) for subsequent events.\n */\nexport const consentRevoke: Flow.StepExample = {\n public: false,\n description:\n 'For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.',\n command: 'consent',\n in: { marketing: false },\n out: [],\n};\n\n/**\n * Consent grant - explicit opt-in.\n */\nexport const consentGrant: Flow.StepExample = {\n public: false,\n description:\n 'A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.',\n command: 'consent',\n in: { marketing: true },\n out: [],\n};\n\n/** A silent rule sends no track call and no identity. */\nexport const silentRule: Flow.StepExample = {\n public: false,\n description: 'A rule with silent: true sends no pintrk track call.',\n in: createEvent({ name: 'page view', timestamp: 1700000109 }),\n mapping: { silent: true },\n out: [],\n};\n\n/**\n * The silent identify rule of identifyOnlySilent on an update without data:\n * no identity resolves and the rule suppresses the track, so nothing is\n * sent. A declared skip: an unmet mapping, not a failure.\n */\nexport const identifyOnlySilentWithoutData: Flow.StepExample = {\n public: false,\n description:\n 'A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: { name: 'user update', entity: 'user', action: 'update' },\n mapping: identifyOnlySilent.mapping,\n out: [],\n};\n","import type { Flow } from '@walkeros/core';\n\n/** The settings the Pinterest Tag needs to deliver: the Tag ID. */\nexport const minimal: Flow.MinimalExample = {\n settings: { apiKey: '2612345678901' },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN,QAAQ,EACL,OAAO,EACP,MAAM,SAAS,oCAAoC,EACnD,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC,EACA,OAAO;;;ACxBV,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,UAAUA,GACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFDM,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM,UAAU,YAAY,aAAa;;;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../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/minimal.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n apiKey: z\n .string()\n .regex(/^\\d+$/, 'Must be a numeric Pinterest Tag ID')\n .min(6)\n .describe(\n 'Your Pinterest Tag ID (numeric string, e.g. \"2612345678901\"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk(\"load\", tagId).',\n ),\n pageview: z\n .boolean()\n .describe(\n 'Call pintrk(\"page\") once in init, as Pinterest\\'s base code does. Default true. Set false to leave the call out.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk(\"set\", data) when it changes; init calls pintrk(\"load\", tagId) without it.',\n )\n .optional(),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity override. Resolves to { em?, external_id? } and fires pintrk(\"set\", data) when the resolved value differs from the current state.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\nexport { minimal } from './minimal';\n","import type { Env, Pintrk } from '../types';\n\n/**\n * Example environment configurations for the Pinterest destination.\n *\n * These mock window.pintrk, allowing tests to run in a pure\n * Node environment without jsdom and without touching the real Pinterest\n * CDN. Tests replace env.window.pintrk with a jest.fn() spy.\n */\n\nconst noop = () => {};\n\nconst noopPintrk: Pintrk = Object.assign(noop, {\n queue: [],\n version: '3.0',\n});\n\n/**\n * Pre-init environment: pintrk is not yet on the window.\n * Used to validate the init path that creates the queue function.\n */\nexport const init: Env = {\n window: {\n pintrk: undefined,\n },\n};\n\n/**\n * Post-init environment: pintrk is available as a spy-able function.\n * Tests clone this and replace `pintrk` with a jest.fn() to record calls.\n */\nexport const push: Env = {\n window: {\n pintrk: noopPintrk,\n },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = ['call:window.pintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { createEvent, getEvent } from '@walkeros/core';\n\n/**\n * Output convention:\n * - Single SDK call: out = [['pintrk', 'track', 'checkout', { ... }]]\n * - Multiple SDK calls: out = [['pintrk', ...], ['pintrk', ...]]\n * - Zero SDK calls: out = []\n */\n\n/**\n * Default event forwarding - no rule. Without a mapping.name, the walkerOS\n * event name is forwarded as-is. Pinterest accepts it but won't match a\n * standard conversion event. event_id is auto-attached for deduplication.\n */\nexport const defaultForward: Flow.StepExample = {\n title: 'Default forward',\n description:\n 'Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.',\n in: getEvent('page view', { timestamp: 1700000100000, id: 'ev-1700000100' }),\n mapping: undefined,\n out: [['pintrk', 'track', 'page view', { event_id: 'ev-1700000100' }]],\n};\n\n/**\n * Wildcard ignore pattern - the standard walkerOS way to suppress noisy\n * events. `mapping.ignore: true` at rule level produces zero SDK calls.\n */\nexport const wildcardIgnored: Flow.StepExample = {\n public: false,\n in: createEvent({ name: 'debug noise', timestamp: 1700000101000 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Standard Pinterest event rename via mapping.name. walkerOS \"page view\"\n * → Pinterest \"pagevisit\". The ONLY way to get Pinterest to recognize\n * a conversion event - the destination never auto-maps.\n */\nexport const pageViewRename: Flow.StepExample = {\n title: 'Page visit',\n description:\n 'A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.',\n in: getEvent('page view', { timestamp: 1700000102000, id: 'ev-1700000102' }),\n mapping: { name: 'pagevisit' },\n out: [['pintrk', 'track', 'pagevisit', { event_id: 'ev-1700000102' }]],\n};\n\n/**\n * Search - walkerOS search submit → Pinterest \"search\" with search_query.\n * Illustrates single-field mapping.data resolution.\n */\nexport const siteSearch: Flow.StepExample = {\n title: 'Search',\n description:\n 'A search submit fires Pinterest search with the search_query field resolved from event data.',\n in: createEvent({\n name: 'search submit',\n timestamp: 1700000103000,\n id: 'ev-1700000103',\n data: { term: 'leather jacket' },\n }),\n mapping: {\n name: 'search',\n data: {\n map: {\n search_query: 'data.term',\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'search',\n {\n search_query: 'leather jacket',\n event_id: 'ev-1700000103',\n },\n ],\n ],\n};\n\n/**\n * Single-product viewcontent.\n */\nexport const productViewContent: Flow.StepExample = {\n title: 'View content',\n description:\n 'A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.',\n in: getEvent('product view', {\n timestamp: 1700000104000,\n id: 'ev-1700000104',\n }),\n mapping: {\n name: 'viewcontent',\n data: {\n map: {\n value: 'data.price',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'viewcontent',\n {\n value: 420,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n },\n ],\n event_id: 'ev-1700000104',\n },\n ],\n ],\n};\n\n/**\n * Add-to-cart with an inline line_items array.\n */\nexport const productAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.',\n in: getEvent('product add', {\n timestamp: 1700000105000,\n id: 'ev-1700000105',\n }),\n mapping: {\n name: 'addtocart',\n data: {\n map: {\n value: 'data.price',\n order_quantity: { value: 1 },\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'addtocart',\n {\n value: 420,\n order_quantity: 1,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000105',\n },\n ],\n ],\n};\n\n/**\n * Multi-product checkout - the canonical Pinterest ecommerce pattern.\n */\nexport const orderCompleteCheckout: Flow.StepExample = {\n title: 'Checkout',\n description:\n 'A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.',\n in: getEvent('order complete', {\n timestamp: 1700000106000,\n id: 'ev-1700000106',\n }),\n mapping: {\n name: 'checkout',\n data: {\n map: {\n value: 'data.value',\n order_id: 'data.id',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n loop: [\n 'nested',\n {\n condition: (value: unknown) =>\n typeof value === 'object' &&\n value !== null &&\n 'data' in value &&\n typeof value.data === 'object' &&\n value.data !== null &&\n 'price' in value.data &&\n typeof value.data.price === 'number',\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'checkout',\n {\n value: 462,\n order_id: '0rd3r1d',\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n {\n product_id: 'cc',\n product_name: 'Cool Cap',\n product_price: 42,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000106',\n },\n ],\n ],\n};\n\n/**\n * Lead conversion with per-event enhanced matching update.\n */\nexport const userLoginLead: Flow.StepExample = {\n title: 'Lead with matching',\n description:\n 'A user login fires pintrk set for enhanced matching and then a lead conversion track call.',\n in: createEvent({\n name: 'user login',\n timestamp: 1700000107000,\n id: 'ev-1700000107',\n data: {\n id: 'usr_123',\n email: 'jane@example.com',\n },\n }),\n mapping: {\n name: 'lead',\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n data: {\n map: {\n lead_type: { value: 'login' },\n },\n },\n },\n out: [\n ['pintrk', 'set', { em: 'jane@example.com', external_id: 'usr_123' }],\n [\n 'pintrk',\n 'track',\n 'lead',\n {\n lead_type: 'login',\n event_id: 'ev-1700000107',\n },\n ],\n ],\n};\n\n/**\n * mapping.silent - processes side effects (identify set) but suppresses\n * the default pintrk('track', ...) call.\n */\nexport const identifyOnlySilent: Flow.StepExample = {\n title: 'Identify only',\n description:\n 'A user update fires pintrk set for enhanced matching without a track call via mapping silent.',\n in: createEvent({\n name: 'user update',\n timestamp: 1700000108000,\n id: 'ev-1700000108',\n data: {\n id: 'usr_456',\n email: 'new@example.com',\n },\n }),\n mapping: {\n silent: true,\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n },\n out: [['pintrk', 'set', { em: 'new@example.com', external_id: 'usr_456' }]],\n};\n\n/**\n * Consent revocation - walkerOS walker consent { marketing: false }.\n * The destination's on('consent') handler flips the runtime state flag\n * and stops calling pintrk('track', ...) for subsequent events.\n */\nexport const consentRevoke: Flow.StepExample = {\n public: false,\n description:\n 'For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.',\n command: 'consent',\n in: { marketing: false },\n out: [],\n};\n\n/**\n * Consent grant - explicit opt-in.\n */\nexport const consentGrant: Flow.StepExample = {\n public: false,\n description:\n 'A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.',\n command: 'consent',\n in: { marketing: true },\n out: [],\n};\n\n/** A silent rule sends no track call and no identity. */\nexport const silentRule: Flow.StepExample = {\n public: false,\n description: 'A rule with silent: true sends no pintrk track call.',\n in: createEvent({ name: 'page view', timestamp: 1700000109000 }),\n mapping: { silent: true },\n out: [],\n};\n\n/**\n * The silent identify rule of identifyOnlySilent on an update without data:\n * no identity resolves and the rule suppresses the track, so nothing is\n * sent. A declared skip: an unmet mapping, not a failure.\n */\nexport const identifyOnlySilentWithoutData: Flow.StepExample = {\n public: false,\n description:\n 'A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: { name: 'user update', entity: 'user', action: 'update' },\n mapping: identifyOnlySilent.mapping,\n out: [],\n};\n","import type { Flow } from '@walkeros/core';\n\n/** The settings the Pinterest Tag needs to deliver: the Tag ID. */\nexport const minimal: Flow.MinimalExample = {\n settings: { apiKey: '2612345678901' },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN,QAAQ,EACL,OAAO,EACP,MAAM,SAAS,oCAAoC,EACnD,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC,EACA,OAAO;;;ACxBV,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,UAAUA,GACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFDM,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM,UAAU,YAAY,aAAa;;;AGThD;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,IAAM,OAAO,MAAM;AAAC;AAEpB,IAAM,aAAqB,OAAO,OAAO,MAAM;AAAA,EAC7C,OAAO,CAAC;AAAA,EACR,SAAS;AACX,CAAC;AAMM,I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CAAC;AAAA,EACD,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,MACR,UAAU;AAAA,QACR,KAAK;AAAA,UACH,IAAI;AAAA,UACJ,aAAa;AAAA,QACf;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,CAAC,CAAC,UAAU,OAAO,EAAE,IAAI,mBAAmB,aAAa,UAAU,CAAC,CAAC;AAC5E;AAOO,IAAM,gBAAkC;AAAA,EAC7C,QAAQ;AAAA,EACR,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,KAAK,CAAC;AACR;AAKO,IAAM,eAAiC;AAAA,EAC5C,QAAQ;AAAA,EACR,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,KAAK,CAAC;AACR;AAGO,IAAM,aAA+B;AAAA,EAC1C,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,IAAI,YAAY,EAAE,MAAM,aAAa,WAAW,aAAc,CAAC;AAAA,EAC/D,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;AAOO,IAAM,gCAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI,EAAE,MAAM,eAAe,QAAQ,QAAQ,QAAQ,SAAS;AAAA,EAC5D,SAAS,mBAAmB;AAAA,EAC5B,KAAK,CAAC;AACR;;;AChYO,IAAM,UAA+B;AAAA,EAC1C,UAAU,EAAE,QAAQ,gBAAgB;AACtC;","names":["z"]}
|
package/dist/examples/index.js
CHANGED
|
@@ -72,20 +72,20 @@ var import_core = require("@walkeros/core");
|
|
|
72
72
|
var defaultForward = {
|
|
73
73
|
title: "Default forward",
|
|
74
74
|
description: "Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.",
|
|
75
|
-
in: (0, import_core.getEvent)("page view", { timestamp:
|
|
75
|
+
in: (0, import_core.getEvent)("page view", { timestamp: 17000001e5, id: "ev-1700000100" }),
|
|
76
76
|
mapping: void 0,
|
|
77
77
|
out: [["pintrk", "track", "page view", { event_id: "ev-1700000100" }]]
|
|
78
78
|
};
|
|
79
79
|
var wildcardIgnored = {
|
|
80
80
|
public: false,
|
|
81
|
-
in: (0, import_core.createEvent)({ name: "debug noise", timestamp:
|
|
81
|
+
in: (0, import_core.createEvent)({ name: "debug noise", timestamp: 1700000101e3 }),
|
|
82
82
|
mapping: { ignore: true },
|
|
83
83
|
out: []
|
|
84
84
|
};
|
|
85
85
|
var pageViewRename = {
|
|
86
86
|
title: "Page visit",
|
|
87
87
|
description: "A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.",
|
|
88
|
-
in: (0, import_core.getEvent)("page view", { timestamp:
|
|
88
|
+
in: (0, import_core.getEvent)("page view", { timestamp: 1700000102e3, id: "ev-1700000102" }),
|
|
89
89
|
mapping: { name: "pagevisit" },
|
|
90
90
|
out: [["pintrk", "track", "pagevisit", { event_id: "ev-1700000102" }]]
|
|
91
91
|
};
|
|
@@ -94,7 +94,7 @@ var siteSearch = {
|
|
|
94
94
|
description: "A search submit fires Pinterest search with the search_query field resolved from event data.",
|
|
95
95
|
in: (0, import_core.createEvent)({
|
|
96
96
|
name: "search submit",
|
|
97
|
-
timestamp:
|
|
97
|
+
timestamp: 1700000103e3,
|
|
98
98
|
id: "ev-1700000103",
|
|
99
99
|
data: { term: "leather jacket" }
|
|
100
100
|
}),
|
|
@@ -122,7 +122,7 @@ var productViewContent = {
|
|
|
122
122
|
title: "View content",
|
|
123
123
|
description: "A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.",
|
|
124
124
|
in: (0, import_core.getEvent)("product view", {
|
|
125
|
-
timestamp:
|
|
125
|
+
timestamp: 1700000104e3,
|
|
126
126
|
id: "ev-1700000104"
|
|
127
127
|
}),
|
|
128
128
|
mapping: {
|
|
@@ -169,7 +169,7 @@ var productAddToCart = {
|
|
|
169
169
|
title: "Add to cart",
|
|
170
170
|
description: "A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.",
|
|
171
171
|
in: (0, import_core.getEvent)("product add", {
|
|
172
|
-
timestamp:
|
|
172
|
+
timestamp: 1700000105e3,
|
|
173
173
|
id: "ev-1700000105"
|
|
174
174
|
}),
|
|
175
175
|
mapping: {
|
|
@@ -220,7 +220,7 @@ var orderCompleteCheckout = {
|
|
|
220
220
|
title: "Checkout",
|
|
221
221
|
description: "A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.",
|
|
222
222
|
in: (0, import_core.getEvent)("order complete", {
|
|
223
|
-
timestamp:
|
|
223
|
+
timestamp: 1700000106e3,
|
|
224
224
|
id: "ev-1700000106"
|
|
225
225
|
}),
|
|
226
226
|
mapping: {
|
|
@@ -280,7 +280,7 @@ var userLoginLead = {
|
|
|
280
280
|
description: "A user login fires pintrk set for enhanced matching and then a lead conversion track call.",
|
|
281
281
|
in: (0, import_core.createEvent)({
|
|
282
282
|
name: "user login",
|
|
283
|
-
timestamp:
|
|
283
|
+
timestamp: 1700000107e3,
|
|
284
284
|
id: "ev-1700000107",
|
|
285
285
|
data: {
|
|
286
286
|
id: "usr_123",
|
|
@@ -321,7 +321,7 @@ var identifyOnlySilent = {
|
|
|
321
321
|
description: "A user update fires pintrk set for enhanced matching without a track call via mapping silent.",
|
|
322
322
|
in: (0, import_core.createEvent)({
|
|
323
323
|
name: "user update",
|
|
324
|
-
timestamp:
|
|
324
|
+
timestamp: 1700000108e3,
|
|
325
325
|
id: "ev-1700000108",
|
|
326
326
|
data: {
|
|
327
327
|
id: "usr_456",
|
|
@@ -358,7 +358,7 @@ var consentGrant = {
|
|
|
358
358
|
var silentRule = {
|
|
359
359
|
public: false,
|
|
360
360
|
description: "A rule with silent: true sends no pintrk track call.",
|
|
361
|
-
in: (0, import_core.createEvent)({ name: "page view", timestamp:
|
|
361
|
+
in: (0, import_core.createEvent)({ name: "page view", timestamp: 1700000109e3 }),
|
|
362
362
|
mapping: { silent: true },
|
|
363
363
|
out: []
|
|
364
364
|
};
|
package/dist/examples/index.mjs
CHANGED
|
@@ -50,20 +50,20 @@ import { createEvent, getEvent } from "@walkeros/core";
|
|
|
50
50
|
var defaultForward = {
|
|
51
51
|
title: "Default forward",
|
|
52
52
|
description: "Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.",
|
|
53
|
-
in: getEvent("page view", { timestamp:
|
|
53
|
+
in: getEvent("page view", { timestamp: 17000001e5, id: "ev-1700000100" }),
|
|
54
54
|
mapping: void 0,
|
|
55
55
|
out: [["pintrk", "track", "page view", { event_id: "ev-1700000100" }]]
|
|
56
56
|
};
|
|
57
57
|
var wildcardIgnored = {
|
|
58
58
|
public: false,
|
|
59
|
-
in: createEvent({ name: "debug noise", timestamp:
|
|
59
|
+
in: createEvent({ name: "debug noise", timestamp: 1700000101e3 }),
|
|
60
60
|
mapping: { ignore: true },
|
|
61
61
|
out: []
|
|
62
62
|
};
|
|
63
63
|
var pageViewRename = {
|
|
64
64
|
title: "Page visit",
|
|
65
65
|
description: "A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.",
|
|
66
|
-
in: getEvent("page view", { timestamp:
|
|
66
|
+
in: getEvent("page view", { timestamp: 1700000102e3, id: "ev-1700000102" }),
|
|
67
67
|
mapping: { name: "pagevisit" },
|
|
68
68
|
out: [["pintrk", "track", "pagevisit", { event_id: "ev-1700000102" }]]
|
|
69
69
|
};
|
|
@@ -72,7 +72,7 @@ var siteSearch = {
|
|
|
72
72
|
description: "A search submit fires Pinterest search with the search_query field resolved from event data.",
|
|
73
73
|
in: createEvent({
|
|
74
74
|
name: "search submit",
|
|
75
|
-
timestamp:
|
|
75
|
+
timestamp: 1700000103e3,
|
|
76
76
|
id: "ev-1700000103",
|
|
77
77
|
data: { term: "leather jacket" }
|
|
78
78
|
}),
|
|
@@ -100,7 +100,7 @@ var productViewContent = {
|
|
|
100
100
|
title: "View content",
|
|
101
101
|
description: "A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.",
|
|
102
102
|
in: getEvent("product view", {
|
|
103
|
-
timestamp:
|
|
103
|
+
timestamp: 1700000104e3,
|
|
104
104
|
id: "ev-1700000104"
|
|
105
105
|
}),
|
|
106
106
|
mapping: {
|
|
@@ -147,7 +147,7 @@ var productAddToCart = {
|
|
|
147
147
|
title: "Add to cart",
|
|
148
148
|
description: "A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.",
|
|
149
149
|
in: getEvent("product add", {
|
|
150
|
-
timestamp:
|
|
150
|
+
timestamp: 1700000105e3,
|
|
151
151
|
id: "ev-1700000105"
|
|
152
152
|
}),
|
|
153
153
|
mapping: {
|
|
@@ -198,7 +198,7 @@ var orderCompleteCheckout = {
|
|
|
198
198
|
title: "Checkout",
|
|
199
199
|
description: "A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.",
|
|
200
200
|
in: getEvent("order complete", {
|
|
201
|
-
timestamp:
|
|
201
|
+
timestamp: 1700000106e3,
|
|
202
202
|
id: "ev-1700000106"
|
|
203
203
|
}),
|
|
204
204
|
mapping: {
|
|
@@ -258,7 +258,7 @@ var userLoginLead = {
|
|
|
258
258
|
description: "A user login fires pintrk set for enhanced matching and then a lead conversion track call.",
|
|
259
259
|
in: createEvent({
|
|
260
260
|
name: "user login",
|
|
261
|
-
timestamp:
|
|
261
|
+
timestamp: 1700000107e3,
|
|
262
262
|
id: "ev-1700000107",
|
|
263
263
|
data: {
|
|
264
264
|
id: "usr_123",
|
|
@@ -299,7 +299,7 @@ var identifyOnlySilent = {
|
|
|
299
299
|
description: "A user update fires pintrk set for enhanced matching without a track call via mapping silent.",
|
|
300
300
|
in: createEvent({
|
|
301
301
|
name: "user update",
|
|
302
|
-
timestamp:
|
|
302
|
+
timestamp: 1700000108e3,
|
|
303
303
|
id: "ev-1700000108",
|
|
304
304
|
data: {
|
|
305
305
|
id: "usr_456",
|
|
@@ -336,7 +336,7 @@ var consentGrant = {
|
|
|
336
336
|
var silentRule = {
|
|
337
337
|
public: false,
|
|
338
338
|
description: "A rule with silent: true sends no pintrk track call.",
|
|
339
|
-
in: createEvent({ name: "page view", timestamp:
|
|
339
|
+
in: createEvent({ name: "page view", timestamp: 1700000109e3 }),
|
|
340
340
|
mapping: { silent: true },
|
|
341
341
|
out: []
|
|
342
342
|
};
|
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Destination=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o=(t,n,r)=>((t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r)(t,"symbol"!=typeof n?n+"":n,r),i={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(i,{DestinationPinterest:()=>ee,default:()=>ie,destinationPinterest:()=>oe});var s=Object.defineProperty,c=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})};function a(e,t){if("collector"===e)return"collector";if(!t)throw new Error(`stepId(${e}) requires an id`);return`${e}.${t}`}c({},{stepId:()=>a});function u(e,t){const n=e.destinations[t];if(!n)throw new Error(`Destination not found: ${t}`);return n}c({},{getDestination:()=>u});c({},{Level:()=>l});var f,l=((f=l||{})[f.ERROR=0]="ERROR",f[f.WARN=1]="WARN",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f);function d(e,t){const n=e.transformers[t];if(!n)throw new Error(`Transformer not found: ${t}`);return n}c({},{getTransformer:()=>d});function p(e,t){const n=e.sources[t];if(!n)throw new Error(`Source not found: ${t}`);return n}c({},{getSource:()=>p});function y(e,t){const n=e.stores[t];if(!n)throw new Error(`Store not found: ${t}`);return n}async function g(e,t){return await e.get(t)}c({},{getStore:()=>y,getStoreValue:()=>g});var v="\\$flow\\.([a-zA-Z_][a-zA-Z0-9_-]*)(?:\\.([a-zA-Z0-9_.]+))?";new RegExp(`^${v}$`),new RegExp(v,"g");function w(e){return Array.isArray(e)}function m(e){return void 0!==e}function h(e){return"object"==typeof e&&null!==e&&"then"in e&&"function"==typeof e.then}function b(e){return"object"==typeof e&&null!==e&&!w(e)&&"[object Object]"===Object.prototype.toString.call(e)}function O(e){return"string"==typeof e}function j(e,t="",n){const r=t.split(".");let o=e;for(let e=0;e<r.length;e++){const t=r[e];if("*"===t&&w(o)){const t=r.slice(e+1).join("."),i=[];for(const e of o){const r=j(e,t,n);i.push(r)}return i}if(o=b(o)||w(o)?o[t]:void 0,void 0===o)break}return m(o)?o:n}function P(e,t={},n={}){const r={...t,...n},o={};let i=!e||0===Object.keys(e).length;return Object.keys(r).forEach(t=>{r[t]&&(o[t]=!0,e&&e[t]&&(i=!0))}),!!i&&o}function R(e){return function(e){return"boolean"==typeof e}(e)||O(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!m(e)||w(e)&&e.every(R)||b(e)&&Object.values(e).every(R)}function E(e){return R(e)?e:void 0}function k(e,t,n){return async function(...r){try{return await e(...r)}catch(e){if(!t)return;return await t(e)}finally{await(null==n?void 0:n())}}}function _(e,t){Object.defineProperty(e,"cause",{value:t,writable:!0,configurable:!0})}var x=class e extends Error{constructor(t,n){super(t),this.name="FatalError",n&&"cause"in n&&_(this,n.cause),Object.setPrototypeOf(this,e.prototype)}},A=["transport","timeout","breaker-open","blocked","queue-full","vendor-not-ready","vendor-timeout"],$=class extends Error{constructor(e,t){super(e),o(this,"code"),o(this,"status"),o(this,"retryable"),o(this,"body"),void 0!==t.cause&&_(this,t.cause),this.name="StepError",this.code=t.code,void 0!==t.status&&(this.status=t.status),this.retryable=function(e){if(void 0!==e.retryable)return e.retryable;const{status:t}=e;if(void 0!==t){if(429===t||t>=500&&t<600)return!0;if(t>=400&&t<500)return!1}return A.includes(e.code)}(t),void 0!==t.body&&(this.body=t.body),Object.setPrototypeOf(this,new.target.prototype)}};async function S(e,t,n){try{return await e()}catch(e){if(e instanceof $)throw e;throw new $(n,{code:t,cause:e})}}function K(e){return e.length>300?e.slice(0,300):e}var D=["type","mappingKey"],N=["count","suppressed"];function T(e,t,n,r,o,i="error"){if(null==e?void 0:e.causeLog)return void e.causeLog.report(n,r,o,i);const s=function(e,t){const n={step:e.step,code:e.code};void 0!==e.status&&(n.status=e.status);for(const e of D)"string"==typeof t[e]&&(n[e]=t[e]);for(const e of N)"number"==typeof t[e]&&(n[e]=t[e]);"boolean"==typeof t.retryable&&(n.retryable=t.retryable);const r="string"==typeof(o=t.event)?o:b(o)&&"string"==typeof o.name?o.name:void 0;var o;void 0!==r&&(n.event=r);const i=function(e){if(void 0!==e)return"string"==typeof e?K(e):e instanceof Error||b(e)&&"string"==typeof e.message?K(e.message):K(String(e))}(t.error);return void 0!==i&&(n.error=i),n}(n,o);"warn"===i?t.warn(r,s):t.error(r,s)}var V=["condition","consent","fn","key","loop","map","set","validate","value"];function W(e,t,n,r){const o=e.event.name,i=(null==t?void 0:t.mappingKey)?`mapping.${t.mappingKey}`:"mapping";T(e.collector,e.logger,{step:i,code:"mapping"},n,{..."string"==typeof o?{event:o}:{},...(null==t?void 0:t.mappingKey)?{mappingKey:t.mappingKey}:{},...void 0!==r?{error:r}:{}})}async function G(e,t={},n,r){var o;if(!n.collector)throw new Error("getMappingValue: context.collector is required");const i=n.consent||n.collector.consent,s={event:null!=(o=n.event)?o:{},mapping:t,collector:n.collector,logger:n.collector.logger,consent:i},c=w(t)?t:[t];for(const t of c){const n=await k(I,e=>{if(e instanceof x)throw e;W(s,r,"mapping value failed",e)})(e,t,{...s,mapping:t},r);if(m(n))return n}}async function I(e,t,n,r){return(w(t)?t:[t]).reduce(async(t,o)=>{const i=await t;if(i)return i;const s=O(o)?{key:o}:o;if(!Object.keys(s).length)return;if(!V.some(e=>e in s))return void W({...n,mapping:o},r,`mapping value has no operator (${Object.keys(s).join(", ")}): wrap the fields in map, or use key, value, fn, loop or set`);const{condition:c,consent:a,fn:u,key:f,loop:l,map:d,set:p,validate:y,value:g}=s,v={...n,mapping:o};if(c&&!await k(c,e=>{if(e instanceof x)throw e;return W(v,r,"mapping condition failed",e),!1})(e,v))return;if(a&&!P(a,v.consent))return g;let h=m(g)?g:e;if(l){const[t,n]=l,o="this"===t?[e]:await G(e,t,v,r);h=w(o)?(await Promise.all(o.map(e=>m(e)?G(e,n,v,r):void 0))).filter(m):void 0}else d?h=await Object.entries(d).reduce(async(t,[n,o])=>{const i=await t,s=await G(e,o,v,r);return m(s)&&(i[n]=s),i},Promise.resolve({})):p?h=await Promise.all(p.map(t=>I(e,t,v,r))):f?h=j(e,f,g):u&&(h=await k(u,e=>{if(e instanceof x)throw e;W(v,r,"mapping fn failed",e)})(e,v));y&&!await k(y,e=>{if(e instanceof x)throw e;return W(v,r,"mapping validate failed",e),!1})(h,v)&&(h=void 0);const b=E(h);return m(b)?b:E(g)},Promise.resolve(void 0))}async function L(e,t={},n){return async function(e,t,n,r){var o,i;if(!m(e))return;const s=b(e)&&e.consent||(null==n?void 0:n.consent)||(null==(o=null==n?void 0:n.collector)?void 0:o.consent),c=null!=(i=null==n?void 0:n.event)?i:b(e)?e:{};return G(e,t,{...n,consent:s,event:c},r)}(e,t,n)}var M="observe";function q(e){const t=(e.startsWith("call:")?e.slice(5):e).split(".");return t.some(e=>""===e)?[]:t}function B(e){return"function"==typeof e}function z(e){return"object"==typeof e&&null!==e}var F=["name","length","prototype","arguments","caller"];function Z(e,t){if(-1!==F.indexOf(t))return!1;let n=e;for(;B(n);){if(Object.prototype.hasOwnProperty.call(n,t))return!0;const e=Object.getPrototypeOf(n);if(!B(e)||!B(Object.getPrototypeOf(e)))return!1;n=e}return!1}function U(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!(n&&!n.configurable)||"value"in n&&!0===n.writable}function C(e,t){let n=e;for(const e of t){if(B(n)){if(!Z(n,e))return!0;if(!U(n,e))return!1}else if(h(n)){if(!(e in n))return!0}else if(!z(n)||!(e in n))return!1;n=Reflect.get(n,e)}return B(n)}function H(e){const t={window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document,...e},n=e&&e[M];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(e){if("object"!=typeof e||null===e)return!1;if(!("paths"in e)||!("record"in e))return!1;const{paths:t,record:n}=e;return Array.isArray(t)&&t.every(e=>"string"==typeof e)&&"function"==typeof n}(n)){delete t[M];const e=function(e,t,n){const r=[],o=[],i=[];for(const n of t){const t=q(n);if(0===t.length)continue;const r=t.join(".");i.push({rest:t,fn:r}),C(e,t)||o.push(r)}const s=new WeakMap,c=new WeakSet;function a(e,t){for(const o of e)if(n)try{n(o,t)}catch(e){}else r.push({fn:o,args:t,ts:Date.now()})}function u(e,t){return 0===t.length||f(e)?e:h(e)&&!t.some(t=>t.rest[0]in e)?Promise.resolve(e).then(e=>u(e,t)):B(e)?v(e,[],t):z(e)?d(e,t):e}function f(e){return(z(e)||B(e))&&c.has(e)}function l(e,t){const n=[],r=[];for(const o of e)o.rest[0]===t&&(1===o.rest.length?n.includes(o.fn)||n.push(o.fn):r.push({rest:o.rest.slice(1),fn:o.fn}));return{leafs:n,deeper:r}}function d(e,t){var n;const r=t.map(e=>`${e.fn}:${e.rest.join(".")}`).join("|"),o=null!=(n=s.get(e))?n:new Map;s.set(e,o);const i=o.get(r);if(i)return i;const c=p(e,t);return o.set(r,c),c}function p(e,t){return B(e)?y(e,t):t.some(t=>!U(e,t.rest[0]))?function(e,t){const n=Object.create(Object.getPrototypeOf(e)),r=g(e,t,()=>o),o=new Proxy(n,{get:(e,t)=>r.get(t),set:(t,n,r)=>Reflect.set(e,n,r,e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),getOwnPropertyDescriptor(t,n){const r=Reflect.getOwnPropertyDescriptor(e,n);return r&&{...r,configurable:!0}},defineProperty:(t,n,r)=>Reflect.defineProperty(e,n,r),deleteProperty:(t,n)=>Reflect.deleteProperty(e,n)});return c.add(o),o}(e,t):y(e,t)}function y(e,t){const n=g(e,t,()=>r),r=new Proxy(e,{get:(e,t)=>"string"!=typeof t||U(e,t)?n.get(t):Reflect.get(e,t,e),set:(e,t,n)=>Reflect.set(e,t,n,e)});return c.add(r),r}function g(e,t,n){const r=new Map;return{get(o){const i=Reflect.get(e,o,e);if("string"!=typeof o)return i;if(!B(i)&&!z(i))return i;if(f(i))return i;const s=r.get(o);if(s&&s.value===i)return s.out;const{leafs:c,deeper:a}=l(t,o);if(!(c.length>0||a.length>0)&&(!B(i)||function(e){if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e)))return i;let u=i;return B(i)?u=v(i,c,a,{proxy:n(),target:e}):a.length>0&&(u=d(i,a)),r.set(o,{value:i,out:u}),u}}}function v(e,t,n,r){const o=()=>n.filter(t=>!Z(e,t.rest[0])),i=new Map,s=new Proxy(e,{get(e,t){const r=Reflect.get(e,t,e);if("string"!=typeof t||!U(e,t))return r;if(!Z(e,t))return r;const{leafs:o,deeper:c}=l(n,t);if(0===o.length&&0===c.length)return r;if(f(r))return r;const a=i.get(t);if(a&&a.value===r)return a.out;let u=r;return B(r)?u=v(r,o,c,{proxy:s,target:e}):z(r)&&c.length>0&&(u=d(r,c)),i.set(t,{value:r,out:u}),u},set:(e,t,n)=>Reflect.set(e,t,n,e),apply(e,n,i){a(t,i);const s=!r||n!==r.proxy&&void 0!==n?n:r.target;return u(Reflect.apply(e,s,i),o())},construct(e,n,r){a(t,n);const i=Reflect.construct(e,n,r===s?e:r),c=u(i,o());return z(c)||B(c)?c:i}});return c.add(s),s}return{env:p(e,i),calls:r,unresolved:o}}(t,n.paths,n.record).env,r=new Set;for(const e of n.paths){const n=q(e)[0];if(void 0===n)continue;const o=t[n];null!==o&&"object"==typeof o&&r.add(n)}const o=Array.from(r,t=>[t,e[t]]);for(const[e,n]of o)t[e]=n}return t}var J="data-walkeros-vendor",Q=new WeakMap;var X=()=>new $("Vendor script failed to load",{code:"vendor-not-loaded"});function Y(e,t,n={}){var r,o;const i=()=>null!=t();let s;if(e){const t=null!=(r=n.document)?r:"undefined"!=typeof document?document:void 0;if(!t)throw new $(`Vendor script ${e} has no document to go into`,{code:"vendor-not-ready"});s=function(e,t,n,r,o){const i=function(e,t){const n=e.querySelectorAll(`script[${J}]`);return Array.from(n).find(e=>e.getAttribute("src")===t)}(e,t),s=i&&Q.get(i);if(s)return s;const c={state:"loading",expired:!1,timeout:n,waiting:[]};if(i&&o())return c.state="loaded",Q.set(i,c),c;const a=null!=i?i:e.createElement("script"),u=e=>{const t=c.waiting;c.waiting=[],t.forEach(t=>t(e))},f=setTimeout(()=>{c.expired=!0,u("expired")},n);if(Q.set(a,c),a.addEventListener("load",()=>{clearTimeout(f),c.state="loaded",u("loaded")}),a.addEventListener("error",()=>{clearTimeout(f),c.state="failed",u("failed")}),!i){for(const[e,t]of Object.entries(r))a.setAttribute(e,t);a.src=t,a.async=!0,a.setAttribute(J,""),e.head.appendChild(a)}return c}(t,e,function(e){return"number"==typeof e&&e>0?e:1e4}(n.timeout),null!=(o=n.attributes)?o:{},i)}const c=()=>{const e=t();return null==e?Promise.reject(new $("Vendor not ready: its global is missing",{code:"vendor-not-ready"})):Promise.resolve(e)};return{ready:()=>s?"failed"===s.state?Promise.reject(X()):"loaded"===s.state||s.expired?c():new Promise((e,t)=>{s.waiting.push(n=>{var r;"failed"===n?t(X()):"expired"===n?t((r=s.timeout,new $(`Vendor script did not load within ${r}ms`,{code:"vendor-timeout"}))):c().then(e,t)})}):c(),check(){if("failed"===(null==s?void 0:s.state))throw X()}}}var ee={};function te(e){const{pintrk:t}=H(e).window;if(!t)throw new $("Pinterest Tag not ready: pintrk is missing",{code:"vendor-not-ready"});return t}function ne(e,t){return Y(!1!==e.loadScript?"https://s.pinimg.com/ct/core.js":void 0,()=>H(t).window.pintrk,{timeout:e.timeout,document:H(t).document})}var re,oe={type:"pinterest",config:{},async init({config:e,env:t}){const n={...e.settings};if(!n.apiKey)throw new $("Pinterest needs settings.apiKey",{code:"config"});const{apiKey:r}=n,o=!1!==n.pageview;!function(e){const{window:t}=H(e);if(t.pintrk)return;const n=Object.assign((...e)=>{var t;null==(t=n.queue)||t.push(e)},{queue:[],version:"3.0"});t.pintrk=n}(t),ne(e,t);const i=te(t);return await S(()=>i("load",r),"vendor-not-ready","Pinterest load call failed"),o&&await S(()=>i("page"),"vendor-not-ready","Pinterest page call failed"),{...e,settings:{...n,_state:{lastIdentify:void 0,consentGranted:!0}}}},async push(e,{config:t,rule:n,data:r,env:o,collector:i,logger:s}){var c,a;ne(t,o).check();const u=t.settings||{},f=u._state||(u._state={consentGranted:!0}),l=te(o);if(!1!==f.consentGranted){const t=null!=(a=null==(c=null==n?void 0:n.settings)?void 0:c.identify)?a:u.identify,o=await async function(e,t,n){if(null==t)return;const r=await L(e,t,{collector:n});if(!b(r))return;const o={},{em:i,external_id:s}=r;return O(i)&&i&&(o.em=i),O(s)&&s&&(o.external_id=s),Object.keys(o).length>0?o:void 0}(e,t,i);if(o?(d=o,p=f.lastIdentify,!d&&!p||d&&p&&d.em===p.em&&d.external_id===p.external_id||(await S(()=>l("set",o),"transport","Pinterest set call failed"),f.lastIdentify=o)):void 0!==t&&function(e,t,n,r){e.debug(`Pinterest skipped ${n}: ${r} resolved to nothing`,{event:t.name})}(s,e,"set","identify"),!0!==(null==n?void 0:n.silent)){const t=O(null==n?void 0:n.name)?n.name:e.name,o=b(r)?r:{},i={...e.id?{event_id:e.id}:{},...o};await S(()=>l("track",t,i),"transport","Pinterest track call failed")}}var d,p},on(e,{config:t,data:n,collector:r}){const o=t.consent;if("consent"!==e||!o||!b(n))return;if(!Object.keys(o).some(e=>e in n))return;const i=t.settings;if(!b(i))return;(b(i._state)?i._state:i._state={consentGranted:!0}).consentGranted=!1!==P(o,r.consent)}},ie=oe;return re=i,((o,i,s,c)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let a of n(i))r.call(o,a)||a===s||e(o,a,{get:()=>i[a],enumerable:!(c=t(i,a))||c.enumerable});return o})(e({},"__esModule",{value:!0}),re)})();
|
|
1
|
+
"use strict";var Destination=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o=(t,n,r)=>((t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r)(t,"symbol"!=typeof n?n+"":n,r),i={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(i,{DestinationPinterest:()=>ee,default:()=>ie,destinationPinterest:()=>oe});var s=Object.defineProperty,c=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})};function a(e,t){if("collector"===e)return"collector";if(!t)throw new Error(`stepId(${e}) requires an id`);return`${e}.${t}`}c({},{stepId:()=>a});function u(e,t){const n=e.destinations[t];if(!n)throw new Error(`Destination not found: ${t}`);return n}c({},{getDestination:()=>u});c({},{Level:()=>l});var f,l=((f=l||{})[f.ERROR=0]="ERROR",f[f.WARN=1]="WARN",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f);function d(e,t){const n=e.transformers[t];if(!n)throw new Error(`Transformer not found: ${t}`);return n}c({},{getTransformer:()=>d});function p(e,t){const n=e.sources[t];if(!n)throw new Error(`Source not found: ${t}`);return n}c({},{getSource:()=>p});function y(e,t){const n=e.stores[t];if(!n)throw new Error(`Store not found: ${t}`);return n}async function g(e,t){return await e.get(t)}c({},{getStore:()=>y,getStoreValue:()=>g});var v="\\$flow\\.([a-zA-Z_][a-zA-Z0-9_-]*)(?:\\.([a-zA-Z0-9_.]+))?";new RegExp(`^${v}$`),new RegExp(v,"g");function w(e){return Array.isArray(e)}function m(e){return void 0!==e}function h(e){return"object"==typeof e&&null!==e&&"then"in e&&"function"==typeof e.then}function b(e){return"object"==typeof e&&null!==e&&!w(e)&&"[object Object]"===Object.prototype.toString.call(e)}function O(e){return"string"==typeof e}function j(e,t="",n){const r=t.split(".");let o=e;for(let e=0;e<r.length;e++){const t=r[e];if("*"===t&&w(o)){const t=r.slice(e+1).join("."),i=[];for(const e of o){const r=j(e,t,n);i.push(r)}return i}if(o=b(o)||w(o)?o[t]:void 0,void 0===o)break}return m(o)?o:n}function P(e,t={},n={}){const r=function(e={},t={}){const n={...e,...t},r={};return Object.keys(n).forEach(e=>{n[e]&&(r[e]=!0)}),r}(t,n);return e&&0!==Object.keys(e).length?!!Object.keys(e).some(t=>e[t]&&r[t])&&r:r}function R(e){return function(e){return"boolean"==typeof e}(e)||O(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!m(e)||w(e)&&e.every(R)||b(e)&&Object.values(e).every(R)}function k(e){return R(e)?e:void 0}function E(e,t,n){return async function(...r){try{return await e(...r)}catch(e){if(!t)return;return await t(e)}finally{await(null==n?void 0:n())}}}function _(e,t){Object.defineProperty(e,"cause",{value:t,writable:!0,configurable:!0})}var x=class e extends Error{constructor(t,n){super(t),this.name="FatalError",n&&"cause"in n&&_(this,n.cause),Object.setPrototypeOf(this,e.prototype)}},A=["transport","timeout","breaker-open","blocked","queue-full","vendor-not-ready","vendor-timeout"],$=class extends Error{constructor(e,t){super(e),o(this,"code"),o(this,"status"),o(this,"retryable"),o(this,"body"),void 0!==t.cause&&_(this,t.cause),this.name="StepError",this.code=t.code,void 0!==t.status&&(this.status=t.status),this.retryable=function(e){if(void 0!==e.retryable)return e.retryable;const{status:t}=e;if(void 0!==t){if(429===t||t>=500&&t<600)return!0;if(t>=400&&t<500)return!1}return A.includes(e.code)}(t),void 0!==t.body&&(this.body=t.body),Object.setPrototypeOf(this,new.target.prototype)}};async function S(e,t,n){try{return await e()}catch(e){if(e instanceof $)throw e;throw new $(n,{code:t,cause:e})}}function K(e){return e.length>300?e.slice(0,300):e}var D=["type","mappingKey"],N=["count","suppressed"];function T(e,t,n,r,o,i="error"){if(null==e?void 0:e.causeLog)return void e.causeLog.report(n,r,o,i);const s=function(e,t){const n={step:e.step,code:e.code};void 0!==e.status&&(n.status=e.status);for(const e of D)"string"==typeof t[e]&&(n[e]=t[e]);for(const e of N)"number"==typeof t[e]&&(n[e]=t[e]);"boolean"==typeof t.retryable&&(n.retryable=t.retryable);const r="string"==typeof(o=t.event)?o:b(o)&&"string"==typeof o.name?o.name:void 0;var o;void 0!==r&&(n.event=r);const i=function(e){if(void 0!==e)return"string"==typeof e?K(e):e instanceof Error||b(e)&&"string"==typeof e.message?K(e.message):K(String(e))}(t.error);return void 0!==i&&(n.error=i),n}(n,o);"warn"===i?t.warn(r,s):t.error(r,s)}var V=["condition","consent","fn","key","loop","map","set","validate","value"];function W(e,t,n,r){const o=e.event.name,i=(null==t?void 0:t.mappingKey)?`mapping.${t.mappingKey}`:"mapping";T(e.collector,e.logger,{step:i,code:"mapping"},n,{..."string"==typeof o?{event:o}:{},...(null==t?void 0:t.mappingKey)?{mappingKey:t.mappingKey}:{},...void 0!==r?{error:r}:{}})}async function G(e,t={},n,r){var o;if(!n.collector)throw new Error("getMappingValue: context.collector is required");const i=n.consent||n.collector.consent,s={event:null!=(o=n.event)?o:{},mapping:t,collector:n.collector,logger:n.collector.logger,consent:i},c=w(t)?t:[t];for(const t of c){const n=await E(I,e=>{if(e instanceof x)throw e;W(s,r,"mapping value failed",e)})(e,t,{...s,mapping:t},r);if(m(n))return n}}async function I(e,t,n,r){return(w(t)?t:[t]).reduce(async(t,o)=>{const i=await t;if(i)return i;const s=O(o)?{key:o}:o;if(!Object.keys(s).length)return;if(!V.some(e=>e in s))return void W({...n,mapping:o},r,`mapping value has no operator (${Object.keys(s).join(", ")}): wrap the fields in map, or use key, value, fn, loop or set`);const{condition:c,consent:a,fn:u,key:f,loop:l,map:d,set:p,validate:y,value:g}=s,v={...n,mapping:o};if(c&&!await E(c,e=>{if(e instanceof x)throw e;return W(v,r,"mapping condition failed",e),!1})(e,v))return;if(a&&!P(a,v.consent))return g;let h=m(g)?g:e;if(l){const[t,n]=l,o="this"===t?[e]:await G(e,t,v,r);h=w(o)?(await Promise.all(o.map(e=>m(e)?G(e,n,v,r):void 0))).filter(m):void 0}else d?h=await Object.entries(d).reduce(async(t,[n,o])=>{const i=await t,s=await G(e,o,v,r);return m(s)&&(i[n]=s),i},Promise.resolve({})):p?h=await Promise.all(p.map(t=>I(e,t,v,r))):f?h=j(e,f,g):u&&(h=await E(u,e=>{if(e instanceof x)throw e;W(v,r,"mapping fn failed",e)})(e,v));y&&!await E(y,e=>{if(e instanceof x)throw e;return W(v,r,"mapping validate failed",e),!1})(h,v)&&(h=void 0);const b=k(h);return m(b)?b:k(g)},Promise.resolve(void 0))}async function L(e,t={},n){return async function(e,t,n,r){var o,i;if(!m(e))return;const s=b(e)&&e.consent||(null==n?void 0:n.consent)||(null==(o=null==n?void 0:n.collector)?void 0:o.consent),c=null!=(i=null==n?void 0:n.event)?i:b(e)?e:{};return G(e,t,{...n,consent:s,event:c},r)}(e,t,n)}var M="observe";function q(e){const t=(e.startsWith("call:")?e.slice(5):e).split(".");return t.some(e=>""===e)?[]:t}function B(e){return"function"==typeof e}function z(e){return"object"==typeof e&&null!==e}var F=["name","length","prototype","arguments","caller"];function Z(e,t){if(-1!==F.indexOf(t))return!1;let n=e;for(;B(n);){if(Object.prototype.hasOwnProperty.call(n,t))return!0;const e=Object.getPrototypeOf(n);if(!B(e)||!B(Object.getPrototypeOf(e)))return!1;n=e}return!1}function U(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!(n&&!n.configurable)||"value"in n&&!0===n.writable}function C(e,t){let n=e;for(const e of t){if(B(n)){if(!Z(n,e))return!0;if(!U(n,e))return!1}else if(h(n)){if(!(e in n))return!0}else if(!z(n)||!(e in n))return!1;n=Reflect.get(n,e)}return B(n)}function H(e){const t={window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document,...e},n=e&&e[M];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(e){if("object"!=typeof e||null===e)return!1;if(!("paths"in e)||!("record"in e))return!1;const{paths:t,record:n}=e;return Array.isArray(t)&&t.every(e=>"string"==typeof e)&&"function"==typeof n}(n)){delete t[M];const e=function(e,t,n){const r=[],o=[],i=[];for(const n of t){const t=q(n);if(0===t.length)continue;const r=t.join(".");i.push({rest:t,fn:r}),C(e,t)||o.push(r)}const s=new WeakMap,c=new WeakSet;function a(e,t){for(const o of e)if(n)try{n(o,t)}catch(e){}else r.push({fn:o,args:t,ts:Date.now()})}function u(e,t){return 0===t.length||f(e)?e:h(e)&&!t.some(t=>t.rest[0]in e)?Promise.resolve(e).then(e=>u(e,t)):B(e)?v(e,[],t):z(e)?d(e,t):e}function f(e){return(z(e)||B(e))&&c.has(e)}function l(e,t){const n=[],r=[];for(const o of e)o.rest[0]===t&&(1===o.rest.length?n.includes(o.fn)||n.push(o.fn):r.push({rest:o.rest.slice(1),fn:o.fn}));return{leafs:n,deeper:r}}function d(e,t){var n;const r=t.map(e=>`${e.fn}:${e.rest.join(".")}`).join("|"),o=null!=(n=s.get(e))?n:new Map;s.set(e,o);const i=o.get(r);if(i)return i;const c=p(e,t);return o.set(r,c),c}function p(e,t){return B(e)?y(e,t):t.some(t=>!U(e,t.rest[0]))?function(e,t){const n=Object.create(Object.getPrototypeOf(e)),r=g(e,t,()=>o),o=new Proxy(n,{get:(e,t)=>r.get(t),set:(t,n,r)=>Reflect.set(e,n,r,e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),getOwnPropertyDescriptor(t,n){const r=Reflect.getOwnPropertyDescriptor(e,n);return r&&{...r,configurable:!0}},defineProperty:(t,n,r)=>Reflect.defineProperty(e,n,r),deleteProperty:(t,n)=>Reflect.deleteProperty(e,n)});return c.add(o),o}(e,t):y(e,t)}function y(e,t){const n=g(e,t,()=>r),r=new Proxy(e,{get:(e,t)=>"string"!=typeof t||U(e,t)?n.get(t):Reflect.get(e,t,e),set:(e,t,n)=>Reflect.set(e,t,n,e)});return c.add(r),r}function g(e,t,n){const r=new Map;return{get(o){const i=Reflect.get(e,o,e);if("string"!=typeof o)return i;if(!B(i)&&!z(i))return i;if(f(i))return i;const s=r.get(o);if(s&&s.value===i)return s.out;const{leafs:c,deeper:a}=l(t,o);if(!(c.length>0||a.length>0)&&(!B(i)||function(e){if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e)))return i;let u=i;return B(i)?u=v(i,c,a,{proxy:n(),target:e}):a.length>0&&(u=d(i,a)),r.set(o,{value:i,out:u}),u}}}function v(e,t,n,r){const o=()=>n.filter(t=>!Z(e,t.rest[0])),i=new Map,s=new Proxy(e,{get(e,t){const r=Reflect.get(e,t,e);if("string"!=typeof t||!U(e,t))return r;if(!Z(e,t))return r;const{leafs:o,deeper:c}=l(n,t);if(0===o.length&&0===c.length)return r;if(f(r))return r;const a=i.get(t);if(a&&a.value===r)return a.out;let u=r;return B(r)?u=v(r,o,c,{proxy:s,target:e}):z(r)&&c.length>0&&(u=d(r,c)),i.set(t,{value:r,out:u}),u},set:(e,t,n)=>Reflect.set(e,t,n,e),apply(e,n,i){a(t,i);const s=!r||n!==r.proxy&&void 0!==n?n:r.target;return u(Reflect.apply(e,s,i),o())},construct(e,n,r){a(t,n);const i=Reflect.construct(e,n,r===s?e:r),c=u(i,o());return z(c)||B(c)?c:i}});return c.add(s),s}return{env:p(e,i),calls:r,unresolved:o}}(t,n.paths,n.record).env,r=new Set;for(const e of n.paths){const n=q(e)[0];if(void 0===n)continue;const o=t[n];null!==o&&"object"==typeof o&&r.add(n)}const o=Array.from(r,t=>[t,e[t]]);for(const[e,n]of o)t[e]=n}return t}var J="data-walkeros-vendor",Q=new WeakMap;var X=()=>new $("Vendor script failed to load",{code:"vendor-not-loaded"});function Y(e,t,n={}){var r,o;const i=()=>null!=t();let s;if(e){const t=null!=(r=n.document)?r:"undefined"!=typeof document?document:void 0;if(!t)throw new $(`Vendor script ${e} has no document to go into`,{code:"vendor-not-ready"});s=function(e,t,n,r,o){const i=function(e,t){const n=e.querySelectorAll(`script[${J}]`);return Array.from(n).find(e=>e.getAttribute("src")===t)}(e,t),s=i&&Q.get(i);if(s)return s;const c={state:"loading",expired:!1,timeout:n,waiting:[]};if(i&&o())return c.state="loaded",Q.set(i,c),c;const a=null!=i?i:e.createElement("script"),u=e=>{const t=c.waiting;c.waiting=[],t.forEach(t=>t(e))},f=setTimeout(()=>{c.expired=!0,u("expired")},n);if(Q.set(a,c),a.addEventListener("load",()=>{clearTimeout(f),c.state="loaded",u("loaded")}),a.addEventListener("error",()=>{clearTimeout(f),c.state="failed",u("failed")}),!i){for(const[e,t]of Object.entries(r))a.setAttribute(e,t);a.src=t,a.async=!0,a.setAttribute(J,""),e.head.appendChild(a)}return c}(t,e,function(e){return"number"==typeof e&&e>0?e:1e4}(n.timeout),null!=(o=n.attributes)?o:{},i)}const c=()=>{const e=t();return null==e?Promise.reject(new $("Vendor not ready: its global is missing",{code:"vendor-not-ready"})):Promise.resolve(e)};return{ready:()=>s?"failed"===s.state?Promise.reject(X()):"loaded"===s.state||s.expired?c():new Promise((e,t)=>{s.waiting.push(n=>{var r;"failed"===n?t(X()):"expired"===n?t((r=s.timeout,new $(`Vendor script did not load within ${r}ms`,{code:"vendor-timeout"}))):c().then(e,t)})}):c(),check(){if("failed"===(null==s?void 0:s.state))throw X()}}}var ee={};function te(e){const{pintrk:t}=H(e).window;if(!t)throw new $("Pinterest Tag not ready: pintrk is missing",{code:"vendor-not-ready"});return t}function ne(e,t){return Y(!1!==e.loadScript?"https://s.pinimg.com/ct/core.js":void 0,()=>H(t).window.pintrk,{timeout:e.timeout,document:H(t).document})}var re,oe={type:"pinterest",config:{},async init({config:e,env:t}){const n={...e.settings};if(!n.apiKey)throw new $("Pinterest needs settings.apiKey",{code:"config"});const{apiKey:r}=n,o=!1!==n.pageview;!function(e){const{window:t}=H(e);if(t.pintrk)return;const n=Object.assign((...e)=>{var t;null==(t=n.queue)||t.push(e)},{queue:[],version:"3.0"});t.pintrk=n}(t),ne(e,t);const i=te(t);return await S(()=>i("load",r),"vendor-not-ready","Pinterest load call failed"),o&&await S(()=>i("page"),"vendor-not-ready","Pinterest page call failed"),{...e,settings:{...n,_state:{lastIdentify:void 0,consentGranted:!0}}}},async push(e,{config:t,rule:n,data:r,env:o,collector:i,logger:s}){var c,a;ne(t,o).check();const u=t.settings||{},f=u._state||(u._state={consentGranted:!0}),l=te(o);if(!1!==f.consentGranted){const t=null!=(a=null==(c=null==n?void 0:n.settings)?void 0:c.identify)?a:u.identify,o=await async function(e,t,n){if(null==t)return;const r=await L(e,t,{collector:n});if(!b(r))return;const o={},{em:i,external_id:s}=r;return O(i)&&i&&(o.em=i),O(s)&&s&&(o.external_id=s),Object.keys(o).length>0?o:void 0}(e,t,i);if(o?(d=o,p=f.lastIdentify,!d&&!p||d&&p&&d.em===p.em&&d.external_id===p.external_id||(await S(()=>l("set",o),"transport","Pinterest set call failed"),f.lastIdentify=o)):void 0!==t&&function(e,t,n,r){e.debug(`Pinterest skipped ${n}: ${r} resolved to nothing`,{event:t.name})}(s,e,"set","identify"),!0!==(null==n?void 0:n.silent)){const t=O(null==n?void 0:n.name)?n.name:e.name,o=b(r)?r:{},i={...e.id?{event_id:e.id}:{},...o};await S(()=>l("track",t,i),"transport","Pinterest track call failed")}}var d,p},on(e,{config:t,data:n,collector:r}){const o=t.consent;if("consent"!==e||!o||!b(n))return;if(!Object.keys(o).some(e=>e in n))return;const i=t.settings;if(!b(i))return;(b(i._state)?i._state:i._state={consentGranted:!0}).consentGranted=!1!==P(o,r.consent)}},ie=oe;return re=i,((o,i,s,c)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let a of n(i))r.call(o,a)||a===s||e(o,a,{get:()=>i[a],enumerable:!(c=t(i,a))||c.enumerable});return o})(e({},"__esModule",{value:!0}),re)})();
|
package/dist/index.es5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _assert_this_initialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function _async_to_generator(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep(i,n,o,a,u,"next",e)}function u(e){asyncGeneratorStep(i,n,o,a,u,"throw",e)}a(void 0)})}}function _call_super(e,t,r){return t=_get_prototype_of(t),_possible_constructor_return(e,_is_native_reflect_construct()?Reflect.construct(t,r||[],_get_prototype_of(e).constructor):t.apply(e,r))}function _class_call_check(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _construct(e,t,r){return _construct=_is_native_reflect_construct()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&_set_prototype_of(o,r.prototype),o},_construct.apply(null,arguments)}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _get_prototype_of(e){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_get_prototype_of(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_set_prototype_of(e,t)}function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _is_native_function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_define_property(e,t,r[t])})}return e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _object_spread_props(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function _possible_constructor_return(e,t){return!t||"object"!==_type_of(t)&&"function"!=typeof t?_assert_this_initialized(e):t}function _set_prototype_of(e,t){return _set_prototype_of=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_set_prototype_of(e,t)}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(e){if("string"==typeof e)return _array_like_to_array(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}}function _wrap_native_super(e){var t="function"==typeof Map?new Map:void 0;return _wrap_native_super=function(e){if(null===e||!_is_native_function(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_get_prototype_of(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(r,e)},_wrap_native_super(e)}function _is_native_reflect_construct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_is_native_reflect_construct=function(){return!!e})()}function _ts_generator(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}var Destination=function(){var e=function(e,t){if("collector"===e)return"collector";if(!t)throw new Error("stepId(".concat(e,") requires an id"));return"".concat(e,".").concat(t)},t=function(e,t){var r=e.destinations[t];if(!r)throw new Error("Destination not found: ".concat(t));return r},r=function(e,t){var r=e.transformers[t];if(!r)throw new Error("Transformer not found: ".concat(t));return r},n=function(e,t){var r=e.sources[t];if(!r)throw new Error("Source not found: ".concat(t));return r},o=function(e,t){var r=e.stores[t];if(!r)throw new Error("Store not found: ".concat(t));return r},i=function(e,t){return _async_to_generator(function(){return _ts_generator(this,function(r){switch(r.label){case 0:return[4,e.get(t)];case 1:return[2,r.sent()]}})})()},a=function(e){return Array.isArray(e)},u=function(e){return void 0!==e},c=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&"then"in e&&"function"==typeof e.then},l=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&!a(e)&&"[object Object]"===Object.prototype.toString.call(e)},s=function(e){return"string"==typeof e},f=function(e){var t=_object_spread({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),r={},n=!e||0===Object.keys(e).length;return Object.keys(t).forEach(function(o){t[o]&&(r[o]=!0,e&&e[o]&&(n=!0))}),!!n&&r},p=function(e){return C(e)?e:void 0},_=function(e,t,r){return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return _async_to_generator(function(){var n;return _ts_generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,4,6]),[4,e.apply(void 0,_to_consumable_array(o))];case 1:case 3:return[2,i.sent()];case 2:return n=i.sent(),t?[4,t(n)]:[2];case 4:return[4,null==r?void 0:r()];case 5:return i.sent(),[7];case 6:return[2]}})})()}},d=function(e,t){Object.defineProperty(e,"cause",{value:t,writable:!0,configurable:!0})},y=function(e,t,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return[2,o.sent()];case 2:if(_instanceof(n=o.sent(),$))throw n;throw new $(r,{code:t,cause:n});case 3:return[2]}})})()},v=function(e){return e.length>300?e.slice(0,300):e},b=function(e,t,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"error";if(null==e?void 0:e.causeLog)e.causeLog.report(r,n,o,i);else{var a=function(e,t){var r={step:e.step,code:e.code};void 0!==e.status&&(r.status=e.status);var n=!0,o=!1,i=void 0;try{for(var a,u=H[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c=a.value;"string"==typeof t[c]&&(r[c]=t[c])}}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}var s=!0,f=!1,p=void 0;try{for(var _,d=J[Symbol.iterator]();!(s=(_=d.next()).done);s=!0){var y=_.value;"number"==typeof t[y]&&(r[y]=t[y])}}catch(e){f=!0,p=e}finally{try{s||null==d.return||d.return()}finally{if(f)throw p}}"boolean"==typeof t.retryable&&(r.retryable=t.retryable);var b,g="string"==typeof(b=t.event)?b:l(b)&&"string"==typeof b.name?b.name:void 0;void 0!==g&&(r.event=g);var h=function(e){if(void 0!==e)return"string"==typeof e?v(e):_instanceof(e,Error)||l(e)&&"string"==typeof e.message?v(e.message):v(String(e))}(t.error);return void 0!==h&&(r.error=h),r}(r,o);"warn"===i?t.warn(n,a):t.error(n,a)}},g=function(e,t,r,n){var o=e.event.name,i=(null==t?void 0:t.mappingKey)?"mapping.".concat(t.mappingKey):"mapping";b(e.collector,e.logger,{step:i,code:"mapping"},r,_object_spread({},"string"==typeof o?{event:o}:{},(null==t?void 0:t.mappingKey)?{mappingKey:t.mappingKey}:{},void 0!==n?{error:n}:{}))},h=function(e,t,r){return _async_to_generator(function(e){var t,r,n,o,i,c,l,s,f,p,d,y,v,b,h,m=arguments;return _ts_generator(this,function(w){switch(w.label){case 0:if(t=m.length>1&&void 0!==m[1]?m[1]:{},n=m.length>3?m[3]:void 0,!(r=m.length>2?m[2]:void 0).collector)throw new Error("getMappingValue: context.collector is required");i=r.consent||r.collector.consent,c={event:null!==(o=r.event)&&void 0!==o?o:{},mapping:t,collector:r.collector,logger:r.collector.logger,consent:i},l=a(t)?t:[t],s=!0,f=!1,p=void 0,w.label=1;case 1:w.trys.push([1,6,7,8]),d=l[Symbol.iterator](),w.label=2;case 2:return(s=(y=d.next()).done)?[3,5]:(v=y.value,[4,_(X,function(e){if(_instanceof(e,U))throw e;g(c,n,"mapping value failed",e)})(e,v,_object_spread_props(_object_spread({},c),{mapping:v}),n)]);case 3:if(b=w.sent(),u(b))return[2,b];w.label=4;case 4:return s=!0,[3,2];case 5:return[3,8];case 6:return h=w.sent(),f=!0,p=h,[3,8];case 7:try{s||null==d.return||d.return()}finally{if(f)throw p}return[7];case 8:return[2]}})}).apply(this,arguments)},m=function(e,t){return _async_to_generator(function(e){var t=arguments;return _ts_generator(this,function(r){return[2,w(e,t.length>1&&void 0!==t[1]?t[1]:{},t.length>2?t[2]:void 0)]})}).apply(this,arguments)},w=function(e,t,r,n){return _async_to_generator(function(){var o,i,a,c;return _ts_generator(this,function(s){return u(e)?(a=l(e)&&e.consent||(null==r?void 0:r.consent)||(null==r||null===(i=r.collector)||void 0===i?void 0:i.consent),c=null!==(o=null==r?void 0:r.event)&&void 0!==o?o:l(e)?e:{},[2,h(e,t,_object_spread_props(_object_spread({},r),{consent:a,event:c}),n)]):[2]})})()},j=function(e){var t=(e.startsWith(te)?e.slice(5):e).split(".");return t.some(function(e){return""===e})?[]:t},O=function(e){return"function"==typeof e},P=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e},S=function(e,t){if(-1!==re.indexOf(t))return!1;for(var r=e;O(r);){if(Object.prototype.hasOwnProperty.call(r,t))return!0;var n=Object.getPrototypeOf(r);if(!O(n)||!O(Object.getPrototypeOf(n)))return!1;r=n}return!1},k=function(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);return!(r&&!r.configurable)||"value"in r&&!0===r.writable},x=function(e,t){var r=e,n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var l=a.value;if(O(r)){if(!S(r,l))return!0;if(!k(r,l))return!1}else if(c(r)){if(!(l in r))return!0}else if(!P(r)||!(l in r))return!1;r=Reflect.get(r,l)}}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return O(r)},E=function(e){var t=_object_spread({window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document},e),r=e&&e[ee];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(e){if("object"!=(void 0===e?"undefined":_type_of(e))||null===e)return!1;if(!("paths"in e)||!("record"in e))return!1;var t=e.paths,r=e.record;return Array.isArray(t)&&t.every(function(e){return"string"==typeof e})&&"function"==typeof r}(r)){delete t[ee];var n=function(e,t,r){var n=[],o=[],i=[],a=!0,u=!1,l=void 0;try{for(var s,f=t[Symbol.iterator]();!(a=(s=f.next()).done);a=!0){var p=s.value,_=j(p);if(0!==_.length){var d=_.join(".");i.push({rest:_,fn:d}),x(e,_)||o.push(d)}}}catch(e){u=!0,l=e}finally{try{a||null==f.return||f.return()}finally{if(u)throw l}}var y=new WeakMap,v=new WeakSet;function b(e,t){var o=!0,i=!1,a=void 0;try{for(var u,c=e[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var l=u.value;if(r)try{r(l,t)}catch(e){}else n.push({fn:l,args:t,ts:Date.now()})}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function g(e,t){return 0===t.length||h(e)?e:c(e)&&!t.some(function(t){return t.rest[0]in e})?Promise.resolve(e).then(function(e){return g(e,t)}):O(e)?D(e,[],t):P(e)?w(e,t):e}function h(e){return(P(e)||O(e))&&v.has(e)}function m(e,t){var r=[],n=[],o=!0,i=!1,a=void 0;try{for(var u,c=e[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var l=u.value;l.rest[0]===t&&(1===l.rest.length?r.includes(l.fn)||r.push(l.fn):n.push({rest:l.rest.slice(1),fn:l.fn}))}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}return{leafs:r,deeper:n}}function w(e,t){var r,n=t.map(function(e){return"".concat(e.fn,":").concat(e.rest.join("."))}).join("|"),o=null!==(r=y.get(e))&&void 0!==r?r:new Map;y.set(e,o);var i=o.get(n);if(i)return i;var a=E(e,t);return o.set(n,a),a}function E(e,t){return O(e)?R(e,t):t.some(function(t){return!k(e,t.rest[0])})?function(e,t){var r=Object.create(Object.getPrototypeOf(e)),n=A(e,t,function(){return o}),o=new Proxy(r,{get:function(e,t){return n.get(t)},set:function(t,r,n){return Reflect.set(e,r,n,e)},has:function(t,r){return Reflect.has(e,r)},ownKeys:function(){return Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(t,r){var n=Reflect.getOwnPropertyDescriptor(e,r);return n&&_object_spread_props(_object_spread({},n),{configurable:!0})},defineProperty:function(t,r,n){return Reflect.defineProperty(e,r,n)},deleteProperty:function(t,r){return Reflect.deleteProperty(e,r)}});return v.add(o),o}(e,t):R(e,t)}function R(e,t){var r=A(e,t,function(){return n}),n=new Proxy(e,{get:function(e,t){return"string"!=typeof t||k(e,t)?r.get(t):Reflect.get(e,t,e)},set:function(e,t,r){return Reflect.set(e,t,r,e)}});return v.add(n),n}function A(e,t,r){var n=new Map;return{get:function(o){var i=Reflect.get(e,o,e);if("string"!=typeof o)return i;if(!O(i)&&!P(i))return i;if(h(i))return i;var a=n.get(o);if(a&&a.value===i)return a.out;var u=m(t,o),c=u.leafs,l=u.deeper;if(!(c.length>0||l.length>0)&&(!O(i)||function(e){if(Array.isArray(e))return!0;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e)))return i;var s=i;return O(i)?s=D(i,c,l,{proxy:r(),target:e}):l.length>0&&(s=w(i,l)),n.set(o,{value:i,out:s}),s}}}function D(e,t,r,n){var o=function(){return r.filter(function(t){return!S(e,t.rest[0])})},i=new Map,a=new Proxy(e,{get:function(e,t){var n=Reflect.get(e,t,e);if("string"!=typeof t||!k(e,t))return n;if(!S(e,t))return n;var o=m(r,t),u=o.leafs,c=o.deeper;if(0===u.length&&0===c.length)return n;if(h(n))return n;var l=i.get(t);if(l&&l.value===n)return l.out;var s=n;return O(n)?s=D(n,u,c,{proxy:a,target:e}):P(n)&&c.length>0&&(s=w(n,c)),i.set(t,{value:n,out:s}),s},set:function(e,t,r){return Reflect.set(e,t,r,e)},apply:function(e,r,i){b(t,i);var a=!n||r!==n.proxy&&void 0!==r?r:n.target;return g(Reflect.apply(e,a,i),o())},construct:function(e,r,n){b(t,r);var i=Reflect.construct(e,r,n===a?e:n),u=g(i,o());return P(u)||O(u)?u:i}});return v.add(a),a}return{env:E(e,i),calls:n,unresolved:o}}(t,r.paths,r.record).env,o=new Set,i=!0,a=!1,u=void 0;try{for(var l,s=r.paths[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){var f=l.value,p=j(f)[0];if(void 0!==p){var _=t[p];null!==_&&"object"==(void 0===_?"undefined":_type_of(_))&&o.add(p)}}}catch(e){a=!0,u=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw u}}var d=Array.from(o,function(e){return[e,n[e]]}),y=!0,v=!1,b=void 0;try{for(var g,h=d[Symbol.iterator]();!(y=(g=h.next()).done);y=!0){var m=_sliced_to_array(g.value,2),w=m[0],E=m[1];t[w]=E}}catch(e){v=!0,b=e}finally{try{y||null==h.return||h.return()}finally{if(v)throw b}}}return t},R=function(e,t){var r,n,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var a=null!=(r=i.document)?r:"undefined"!=typeof document?document:void 0;if(!a)throw new $("Vendor script ".concat(e," has no document to go into"),{code:"vendor-not-ready"});o=function(e,t,r,n,o){var i=function(e,t){var r=e.querySelectorAll("script[".concat(ne,"]"));return Array.from(r).find(function(e){return e.getAttribute("src")===t})}(e,t),a=i&&oe.get(i);if(a)return a;var u={state:"loading",expired:!1,timeout:r,waiting:[]};if(i&&o())return u.state="loaded",oe.set(i,u),u;var c=null!=i?i:e.createElement("script"),l=function(e){var t=u.waiting;u.waiting=[],t.forEach(function(t){return t(e)})},s=setTimeout(function(){u.expired=!0,l("expired")},r);if(oe.set(c,u),c.addEventListener("load",function(){clearTimeout(s),u.state="loaded",l("loaded")}),c.addEventListener("error",function(){clearTimeout(s),u.state="failed",l("failed")}),!i){var f=!0,p=!1,_=void 0;try{for(var d,y=Object.entries(n)[Symbol.iterator]();!(f=(d=y.next()).done);f=!0){var v=_sliced_to_array(d.value,2),b=v[0],g=v[1];c.setAttribute(b,g)}}catch(e){p=!0,_=e}finally{try{f||null==y.return||y.return()}finally{if(p)throw _}}c.src=t,c.async=!0,c.setAttribute(ne,""),e.head.appendChild(c)}return u}(a,e,function(e){return"number"==typeof e&&e>0?e:1e4}(i.timeout),null!=(n=i.attributes)?n:{},function(){return null!=t()})}var u=function(){var e=t();return null==e?Promise.reject(new $("Vendor not ready: its global is missing",{code:"vendor-not-ready"})):Promise.resolve(e)};return{ready:function(){return o?"failed"===o.state?Promise.reject(ie()):"loaded"===o.state||o.expired?u():new Promise(function(e,t){o.waiting.push(function(r){var n;"failed"===r?t(ie()):"expired"===r?t((n=o.timeout,new $("Vendor script did not load within ".concat(n,"ms"),{code:"vendor-timeout"}))):u().then(e,t)})}):u()},check:function(){if("failed"===(null==o?void 0:o.state))throw ie()}}},A=function(e){var t=E(e).window.pintrk;if(!t)throw new $("Pinterest Tag not ready: pintrk is missing",{code:"vendor-not-ready"});return t},D=function(e,t){return R(!1!==e.loadScript?ue:void 0,function(){return E(t).window.pintrk},{timeout:e.timeout,document:E(t).document})},I=function(e,t,r){return _async_to_generator(function(){var n,o,i,a;return _ts_generator(this,function(u){switch(u.label){case 0:return null==t?[2,void 0]:[4,m(e,t,{collector:r})];case 1:return n=u.sent(),l(n)?(o={},i=n.em,a=n.external_id,s(i)&&i&&(o.em=i),s(a)&&a&&(o.external_id=a),[2,Object.keys(o).length>0?o:void 0]):[2,void 0]}})})()},K=Object.defineProperty,T=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyNames,M=Object.prototype.hasOwnProperty,N=function(e,t,r){return function(e,t,r){return t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r}(e,"symbol"!==(void 0===t?"undefined":_type_of(t))?t+"":t,r)},V={};!function(e,t){for(var r in t)K(e,r,{get:t[r],enumerable:!0})}(V,{DestinationPinterest:function(){return ae},default:function(){return le},destinationPinterest:function(){return ce}});var W=Object.defineProperty,L=function(e,t){for(var r in t)W(e,r,{get:t[r],enumerable:!0})};L({},{stepId:function(){return e}});L({},{getDestination:function(){return t}});L({},{Level:function(){return B}});var q,B=((q=B||{})[q.ERROR=0]="ERROR",q[q.WARN=1]="WARN",q[q.INFO=2]="INFO",q[q.DEBUG=3]="DEBUG",q);L({},{getTransformer:function(){return r}});L({},{getSource:function(){return n}});L({},{getStore:function(){return o},getStoreValue:function(){return i}});var z="\\$flow\\.(".concat("[a-zA-Z_][a-zA-Z0-9_-]*",")(?:\\.([a-zA-Z0-9_.]+))?");new RegExp("^".concat(z,"$")),new RegExp(z,"g");function F(e){for(var t=arguments.length>2?arguments[2]:void 0,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split("."),n=e,o=0;o<r.length;o++){var i=r[o];if("*"===i&&a(n)){var c=r.slice(o+1).join("."),s=[],f=!0,p=!1,_=void 0;try{for(var d,y=n[Symbol.iterator]();!(f=(d=y.next()).done);f=!0){var v=F(d.value,c,t);s.push(v)}}catch(e){p=!0,_=e}finally{try{f||null==y.return||y.return()}finally{if(p)throw _}}return s}if(void 0===(n=l(n)||a(n)?n[i]:void 0))break}return u(n)?n:t}function C(e){return function(e){return"boolean"==typeof e}(e)||s(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!u(e)||a(e)&&e.every(C)||l(e)&&Object.values(e).every(C)}var U=function(){function e(t,r){var n;return _class_call_check(this,e),(n=_call_super(this,e,[t])).name="FatalError",r&&"cause"in r&&d(n,r.cause),Object.setPrototypeOf(n,e.prototype),n}return _inherits(e,_wrap_native_super(Error)),e}(),Z=["transport","timeout","breaker-open","blocked","queue-full","vendor-not-ready","vendor-timeout"],$=function(e){function t(e,r){var n;return _class_call_check(this,t),n=_call_super(this,t,[e]),N(n,"code"),N(n,"status"),N(n,"retryable"),N(n,"body"),void 0!==r.cause&&d(n,r.cause),n.name="StepError",n.code=r.code,void 0!==r.status&&(n.status=r.status),n.retryable=function(e){if(void 0!==e.retryable)return e.retryable;var t=e.status;if(void 0!==t){if(429===t||t>=500&&t<600)return!0;if(t>=400&&t<500)return!1}return Z.includes(e.code)}(r),void 0!==r.body&&(n.body=r.body),Object.setPrototypeOf(n,(_instanceof(this,t)?this.constructor:void 0).prototype),n}return _inherits(t,e),t}(_wrap_native_super(Error)),H=["type","mappingKey"],J=["count","suppressed"],Q=["condition","consent","fn","key","loop","map","set","validate","value"];function X(e,t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(o){return[2,(a(t)?t:[t]).reduce(function(t,o){return _async_to_generator(function(){var i,c,l,d,y,v,b,m,w,j,O,P,S,k,x,E,R,A,D,I,K,T,G,M,N;return _ts_generator(this,function(V){switch(V.label){case 0:return[4,t];case 1:return(i=V.sent())?[2,i]:(c=s(o)?{key:o}:o,Object.keys(c).length?Q.some(function(e){return e in c})?(l=c.condition,d=c.consent,y=c.fn,v=c.key,b=c.loop,m=c.map,w=c.set,j=c.validate,O=c.value,P=_object_spread_props(_object_spread({},r),{mapping:o}),(S=l)?[4,_(l,function(e){if(_instanceof(e,U))throw e;return g(P,n,"mapping condition failed",e),!1})(e,P)]:[3,3]):[2,void g(_object_spread_props(_object_spread({},r),{mapping:o}),n,"mapping value has no operator (".concat(Object.keys(c).join(", "),"): wrap the fields in map, or use key, value, fn, loop or set"))]:[2]);case 2:S=!V.sent(),V.label=3;case 3:return S?[2]:d&&!f(d,P.consent)?[2,O]:(k=u(O)?O:e,b?(x=_sliced_to_array(b,2),E=x[0],R=x[1],"this"!==E?[3,4]:(D=[e],[3,6])):[3,10]);case 4:return[4,h(e,E,P,n)];case 5:D=V.sent(),V.label=6;case 6:return a(A=D)?[4,Promise.all(A.map(function(e){return u(e)?h(e,R,P,n):void 0}))]:[3,8];case 7:return I=V.sent().filter(u),[3,9];case 8:I=void 0,V.label=9;case 9:return k=I,[3,21];case 10:return m?[4,Object.entries(m).reduce(function(t,r){var o=_sliced_to_array(r,2),i=o[0],a=o[1];return _async_to_generator(function(){var r,o;return _ts_generator(this,function(c){switch(c.label){case 0:return[4,t];case 1:return r=c.sent(),[4,h(e,a,P,n)];case 2:return o=c.sent(),[2,(u(o)&&(r[i]=o),r)]}})})()},Promise.resolve({}))]:[3,12];case 11:return k=V.sent(),[3,20];case 12:return w?[4,Promise.all(w.map(function(t){return X(e,t,P,n)}))]:[3,14];case 13:return K=k=V.sent(),[3,19];case 14:return v?(T=k=F(e,v,O),[3,18]):[3,15];case 15:return(G=y)?[4,_(y,function(e){if(_instanceof(e,U))throw e;g(P,n,"mapping fn failed",e)})(e,P)]:[3,17];case 16:G=k=V.sent(),V.label=17;case 17:T=G,V.label=18;case 18:K=T,V.label=19;case 19:V.label=20;case 20:V.label=21;case 21:return(M=j)?[4,_(j,function(e){if(_instanceof(e,U))throw e;return g(P,n,"mapping validate failed",e),!1})(k,P)]:[3,23];case 22:M=!V.sent(),V.label=23;case 23:return M&&(k=void 0),N=p(k),[2,u(N)?N:p(O)]}})})()},Promise.resolve(void 0))]})})()}var Y,ee="observe",te="call:",re=["name","length","prototype","arguments","caller"],ne="data-walkeros-vendor",oe=new WeakMap,ie=function(){return new $("Vendor script failed to load",{code:"vendor-not-loaded"})},ae={},ue="https://s.pinimg.com/ct/core.js",ce={type:"pinterest",config:{},init:function(e){return _async_to_generator(function(e){var t,r,n,o,i,a;return _ts_generator(this,function(u){switch(u.label){case 0:if(t=e.config,r=e.env,!(n=_object_spread({},t.settings)).apiKey)throw new $("Pinterest needs settings.apiKey",{code:"config"});return o=n.apiKey,i=!1!==n.pageview,function(e){var t=E(e).window;if(!t.pintrk){var r=Object.assign(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o;null===(o=r.queue)||void 0===o||o.push(t)},{queue:[],version:"3.0"});t.pintrk=r}}(r),D(t,r),a=A(r),[4,y(function(){return a("load",o)},"vendor-not-ready","Pinterest load call failed")];case 1:return u.sent(),i?[4,y(function(){return a("page")},"vendor-not-ready","Pinterest page call failed")]:[3,3];case 2:u.sent(),u.label=3;case 3:return[2,_object_spread_props(_object_spread({},t),{settings:_object_spread_props(_object_spread({},n),{_state:{lastIdentify:void 0,consentGranted:!0}})})]}})}).apply(this,arguments)},push:function(e,t){return _async_to_generator(function(e,t){var r,n,o,i,a,u,c,f,p,_,d,v,b,g,h,m;return _ts_generator(this,function(w){switch(w.label){case 0:return r=t.config,n=t.rule,o=t.data,i=t.env,a=t.collector,u=t.logger,D(r,i).check(),c=r.settings||{},f=c._state||(c._state={consentGranted:!0}),p=A(i),!1===f.consentGranted?[3,6]:(v=null!==(_=null==n||null===(d=n.settings)||void 0===d?void 0:d.identify)&&void 0!==_?_:c.identify,[4,I(e,v,a)]);case 1:return(b=w.sent())?[3,2]:(void 0!==v&&function(e,t,r,n){e.debug("Pinterest skipped ".concat(r,": ").concat(n," resolved to nothing"),{event:t.name})}(u,e,"set","identify"),[3,4]);case 2:return j=b,O=f.lastIdentify,!j&&!O||j&&O&&j.em===O.em&&j.external_id===O.external_id?[3,4]:[4,y(function(){return p("set",b)},"transport","Pinterest set call failed")];case 3:w.sent(),f.lastIdentify=b,w.label=4;case 4:return!0===(null==n?void 0:n.silent)?[3,6]:(g=s(null==n?void 0:n.name)?n.name:e.name,h=l(o)?o:{},m=_object_spread({},e.id?{event_id:e.id}:{},h),[4,y(function(){return p("track",g,m)},"transport","Pinterest track call failed")]);case 5:w.sent(),w.label=6;case 6:return[2]}var j,O})}).apply(this,arguments)},on:function(e,t){var r=t.config,n=t.data,o=t.collector,i=r.consent;if("consent"===e&&i&&l(n)&&Object.keys(i).some(function(e){return e in n})){var a=r.settings;if(l(a))(l(a._state)?a._state:a._state={consentGranted:!0}).consentGranted=!1!==f(i,o.consent)}}},le=ce;return Y=V,function(e,t,r,n){if(t&&"object"===(void 0===t?"undefined":_type_of(t))||"function"==typeof t){var o=!0,i=!1,a=void 0;try{for(var u,c=function(){var o=u.value;M.call(e,o)||o===r||K(e,o,{get:function(){return t[o]},enumerable:!(n=T(t,o))||n.enumerable})},l=G(t)[Symbol.iterator]();!(o=(u=l.next()).done);o=!0)c()}catch(e){i=!0,a=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw a}}}return e}(K({},"__esModule",{value:!0}),Y)}();
|
|
1
|
+
"use strict";function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _assert_this_initialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function _async_to_generator(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep(i,n,o,a,u,"next",e)}function u(e){asyncGeneratorStep(i,n,o,a,u,"throw",e)}a(void 0)})}}function _call_super(e,t,r){return t=_get_prototype_of(t),_possible_constructor_return(e,_is_native_reflect_construct()?Reflect.construct(t,r||[],_get_prototype_of(e).constructor):t.apply(e,r))}function _class_call_check(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _construct(e,t,r){return _construct=_is_native_reflect_construct()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&_set_prototype_of(o,r.prototype),o},_construct.apply(null,arguments)}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _get_prototype_of(e){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_get_prototype_of(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_set_prototype_of(e,t)}function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _is_native_function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_define_property(e,t,r[t])})}return e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _object_spread_props(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function _possible_constructor_return(e,t){return!t||"object"!==_type_of(t)&&"function"!=typeof t?_assert_this_initialized(e):t}function _set_prototype_of(e,t){return _set_prototype_of=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_set_prototype_of(e,t)}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(e){if("string"==typeof e)return _array_like_to_array(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}}function _wrap_native_super(e){var t="function"==typeof Map?new Map:void 0;return _wrap_native_super=function(e){if(null===e||!_is_native_function(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_get_prototype_of(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(r,e)},_wrap_native_super(e)}function _is_native_reflect_construct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_is_native_reflect_construct=function(){return!!e})()}function _ts_generator(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}var Destination=function(){var e=function(e,t){if("collector"===e)return"collector";if(!t)throw new Error("stepId(".concat(e,") requires an id"));return"".concat(e,".").concat(t)},t=function(e,t){var r=e.destinations[t];if(!r)throw new Error("Destination not found: ".concat(t));return r},r=function(e,t){var r=e.transformers[t];if(!r)throw new Error("Transformer not found: ".concat(t));return r},n=function(e,t){var r=e.sources[t];if(!r)throw new Error("Source not found: ".concat(t));return r},o=function(e,t){var r=e.stores[t];if(!r)throw new Error("Store not found: ".concat(t));return r},i=function(e,t){return _async_to_generator(function(){return _ts_generator(this,function(r){switch(r.label){case 0:return[4,e.get(t)];case 1:return[2,r.sent()]}})})()},a=function(e){return Array.isArray(e)},u=function(e){return void 0!==e},c=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&"then"in e&&"function"==typeof e.then},l=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&!a(e)&&"[object Object]"===Object.prototype.toString.call(e)},s=function(e){return"string"==typeof e},f=function(e){var t=function(){var e=_object_spread({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),t={};return Object.keys(e).forEach(function(r){e[r]&&(t[r]=!0)}),t}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});return e&&0!==Object.keys(e).length?!!Object.keys(e).some(function(r){return e[r]&&t[r]})&&t:t},p=function(e){return C(e)?e:void 0},_=function(e,t,r){return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return _async_to_generator(function(){var n;return _ts_generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,4,6]),[4,e.apply(void 0,_to_consumable_array(o))];case 1:case 3:return[2,i.sent()];case 2:return n=i.sent(),t?[4,t(n)]:[2];case 4:return[4,null==r?void 0:r()];case 5:return i.sent(),[7];case 6:return[2]}})})()}},d=function(e,t){Object.defineProperty(e,"cause",{value:t,writable:!0,configurable:!0})},y=function(e,t,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return[2,o.sent()];case 2:if(_instanceof(n=o.sent(),$))throw n;throw new $(r,{code:t,cause:n});case 3:return[2]}})})()},v=function(e){return e.length>300?e.slice(0,300):e},b=function(e,t,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"error";if(null==e?void 0:e.causeLog)e.causeLog.report(r,n,o,i);else{var a=function(e,t){var r={step:e.step,code:e.code};void 0!==e.status&&(r.status=e.status);var n=!0,o=!1,i=void 0;try{for(var a,u=H[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c=a.value;"string"==typeof t[c]&&(r[c]=t[c])}}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}var s=!0,f=!1,p=void 0;try{for(var _,d=J[Symbol.iterator]();!(s=(_=d.next()).done);s=!0){var y=_.value;"number"==typeof t[y]&&(r[y]=t[y])}}catch(e){f=!0,p=e}finally{try{s||null==d.return||d.return()}finally{if(f)throw p}}"boolean"==typeof t.retryable&&(r.retryable=t.retryable);var b,g="string"==typeof(b=t.event)?b:l(b)&&"string"==typeof b.name?b.name:void 0;void 0!==g&&(r.event=g);var h=function(e){if(void 0!==e)return"string"==typeof e?v(e):_instanceof(e,Error)||l(e)&&"string"==typeof e.message?v(e.message):v(String(e))}(t.error);return void 0!==h&&(r.error=h),r}(r,o);"warn"===i?t.warn(n,a):t.error(n,a)}},g=function(e,t,r,n){var o=e.event.name,i=(null==t?void 0:t.mappingKey)?"mapping.".concat(t.mappingKey):"mapping";b(e.collector,e.logger,{step:i,code:"mapping"},r,_object_spread({},"string"==typeof o?{event:o}:{},(null==t?void 0:t.mappingKey)?{mappingKey:t.mappingKey}:{},void 0!==n?{error:n}:{}))},h=function(e,t,r){return _async_to_generator(function(e){var t,r,n,o,i,c,l,s,f,p,d,y,v,b,h,m=arguments;return _ts_generator(this,function(w){switch(w.label){case 0:if(t=m.length>1&&void 0!==m[1]?m[1]:{},n=m.length>3?m[3]:void 0,!(r=m.length>2?m[2]:void 0).collector)throw new Error("getMappingValue: context.collector is required");i=r.consent||r.collector.consent,c={event:null!==(o=r.event)&&void 0!==o?o:{},mapping:t,collector:r.collector,logger:r.collector.logger,consent:i},l=a(t)?t:[t],s=!0,f=!1,p=void 0,w.label=1;case 1:w.trys.push([1,6,7,8]),d=l[Symbol.iterator](),w.label=2;case 2:return(s=(y=d.next()).done)?[3,5]:(v=y.value,[4,_(X,function(e){if(_instanceof(e,U))throw e;g(c,n,"mapping value failed",e)})(e,v,_object_spread_props(_object_spread({},c),{mapping:v}),n)]);case 3:if(b=w.sent(),u(b))return[2,b];w.label=4;case 4:return s=!0,[3,2];case 5:return[3,8];case 6:return h=w.sent(),f=!0,p=h,[3,8];case 7:try{s||null==d.return||d.return()}finally{if(f)throw p}return[7];case 8:return[2]}})}).apply(this,arguments)},m=function(e,t){return _async_to_generator(function(e){var t=arguments;return _ts_generator(this,function(r){return[2,w(e,t.length>1&&void 0!==t[1]?t[1]:{},t.length>2?t[2]:void 0)]})}).apply(this,arguments)},w=function(e,t,r,n){return _async_to_generator(function(){var o,i,a,c;return _ts_generator(this,function(s){return u(e)?(a=l(e)&&e.consent||(null==r?void 0:r.consent)||(null==r||null===(i=r.collector)||void 0===i?void 0:i.consent),c=null!==(o=null==r?void 0:r.event)&&void 0!==o?o:l(e)?e:{},[2,h(e,t,_object_spread_props(_object_spread({},r),{consent:a,event:c}),n)]):[2]})})()},j=function(e){var t=(e.startsWith(te)?e.slice(5):e).split(".");return t.some(function(e){return""===e})?[]:t},O=function(e){return"function"==typeof e},P=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e},S=function(e,t){if(-1!==re.indexOf(t))return!1;for(var r=e;O(r);){if(Object.prototype.hasOwnProperty.call(r,t))return!0;var n=Object.getPrototypeOf(r);if(!O(n)||!O(Object.getPrototypeOf(n)))return!1;r=n}return!1},k=function(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);return!(r&&!r.configurable)||"value"in r&&!0===r.writable},x=function(e,t){var r=e,n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var l=a.value;if(O(r)){if(!S(r,l))return!0;if(!k(r,l))return!1}else if(c(r)){if(!(l in r))return!0}else if(!P(r)||!(l in r))return!1;r=Reflect.get(r,l)}}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return O(r)},E=function(e){var t=_object_spread({window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document},e),r=e&&e[ee];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(e){if("object"!=(void 0===e?"undefined":_type_of(e))||null===e)return!1;if(!("paths"in e)||!("record"in e))return!1;var t=e.paths,r=e.record;return Array.isArray(t)&&t.every(function(e){return"string"==typeof e})&&"function"==typeof r}(r)){delete t[ee];var n=function(e,t,r){var n=[],o=[],i=[],a=!0,u=!1,l=void 0;try{for(var s,f=t[Symbol.iterator]();!(a=(s=f.next()).done);a=!0){var p=s.value,_=j(p);if(0!==_.length){var d=_.join(".");i.push({rest:_,fn:d}),x(e,_)||o.push(d)}}}catch(e){u=!0,l=e}finally{try{a||null==f.return||f.return()}finally{if(u)throw l}}var y=new WeakMap,v=new WeakSet;function b(e,t){var o=!0,i=!1,a=void 0;try{for(var u,c=e[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var l=u.value;if(r)try{r(l,t)}catch(e){}else n.push({fn:l,args:t,ts:Date.now()})}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function g(e,t){return 0===t.length||h(e)?e:c(e)&&!t.some(function(t){return t.rest[0]in e})?Promise.resolve(e).then(function(e){return g(e,t)}):O(e)?D(e,[],t):P(e)?w(e,t):e}function h(e){return(P(e)||O(e))&&v.has(e)}function m(e,t){var r=[],n=[],o=!0,i=!1,a=void 0;try{for(var u,c=e[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var l=u.value;l.rest[0]===t&&(1===l.rest.length?r.includes(l.fn)||r.push(l.fn):n.push({rest:l.rest.slice(1),fn:l.fn}))}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}return{leafs:r,deeper:n}}function w(e,t){var r,n=t.map(function(e){return"".concat(e.fn,":").concat(e.rest.join("."))}).join("|"),o=null!==(r=y.get(e))&&void 0!==r?r:new Map;y.set(e,o);var i=o.get(n);if(i)return i;var a=E(e,t);return o.set(n,a),a}function E(e,t){return O(e)?R(e,t):t.some(function(t){return!k(e,t.rest[0])})?function(e,t){var r=Object.create(Object.getPrototypeOf(e)),n=A(e,t,function(){return o}),o=new Proxy(r,{get:function(e,t){return n.get(t)},set:function(t,r,n){return Reflect.set(e,r,n,e)},has:function(t,r){return Reflect.has(e,r)},ownKeys:function(){return Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(t,r){var n=Reflect.getOwnPropertyDescriptor(e,r);return n&&_object_spread_props(_object_spread({},n),{configurable:!0})},defineProperty:function(t,r,n){return Reflect.defineProperty(e,r,n)},deleteProperty:function(t,r){return Reflect.deleteProperty(e,r)}});return v.add(o),o}(e,t):R(e,t)}function R(e,t){var r=A(e,t,function(){return n}),n=new Proxy(e,{get:function(e,t){return"string"!=typeof t||k(e,t)?r.get(t):Reflect.get(e,t,e)},set:function(e,t,r){return Reflect.set(e,t,r,e)}});return v.add(n),n}function A(e,t,r){var n=new Map;return{get:function(o){var i=Reflect.get(e,o,e);if("string"!=typeof o)return i;if(!O(i)&&!P(i))return i;if(h(i))return i;var a=n.get(o);if(a&&a.value===i)return a.out;var u=m(t,o),c=u.leafs,l=u.deeper;if(!(c.length>0||l.length>0)&&(!O(i)||function(e){if(Array.isArray(e))return!0;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e)))return i;var s=i;return O(i)?s=D(i,c,l,{proxy:r(),target:e}):l.length>0&&(s=w(i,l)),n.set(o,{value:i,out:s}),s}}}function D(e,t,r,n){var o=function(){return r.filter(function(t){return!S(e,t.rest[0])})},i=new Map,a=new Proxy(e,{get:function(e,t){var n=Reflect.get(e,t,e);if("string"!=typeof t||!k(e,t))return n;if(!S(e,t))return n;var o=m(r,t),u=o.leafs,c=o.deeper;if(0===u.length&&0===c.length)return n;if(h(n))return n;var l=i.get(t);if(l&&l.value===n)return l.out;var s=n;return O(n)?s=D(n,u,c,{proxy:a,target:e}):P(n)&&c.length>0&&(s=w(n,c)),i.set(t,{value:n,out:s}),s},set:function(e,t,r){return Reflect.set(e,t,r,e)},apply:function(e,r,i){b(t,i);var a=!n||r!==n.proxy&&void 0!==r?r:n.target;return g(Reflect.apply(e,a,i),o())},construct:function(e,r,n){b(t,r);var i=Reflect.construct(e,r,n===a?e:n),u=g(i,o());return P(u)||O(u)?u:i}});return v.add(a),a}return{env:E(e,i),calls:n,unresolved:o}}(t,r.paths,r.record).env,o=new Set,i=!0,a=!1,u=void 0;try{for(var l,s=r.paths[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){var f=l.value,p=j(f)[0];if(void 0!==p){var _=t[p];null!==_&&"object"==(void 0===_?"undefined":_type_of(_))&&o.add(p)}}}catch(e){a=!0,u=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw u}}var d=Array.from(o,function(e){return[e,n[e]]}),y=!0,v=!1,b=void 0;try{for(var g,h=d[Symbol.iterator]();!(y=(g=h.next()).done);y=!0){var m=_sliced_to_array(g.value,2),w=m[0],E=m[1];t[w]=E}}catch(e){v=!0,b=e}finally{try{y||null==h.return||h.return()}finally{if(v)throw b}}}return t},R=function(e,t){var r,n,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var a=null!=(r=i.document)?r:"undefined"!=typeof document?document:void 0;if(!a)throw new $("Vendor script ".concat(e," has no document to go into"),{code:"vendor-not-ready"});o=function(e,t,r,n,o){var i=function(e,t){var r=e.querySelectorAll("script[".concat(ne,"]"));return Array.from(r).find(function(e){return e.getAttribute("src")===t})}(e,t),a=i&&oe.get(i);if(a)return a;var u={state:"loading",expired:!1,timeout:r,waiting:[]};if(i&&o())return u.state="loaded",oe.set(i,u),u;var c=null!=i?i:e.createElement("script"),l=function(e){var t=u.waiting;u.waiting=[],t.forEach(function(t){return t(e)})},s=setTimeout(function(){u.expired=!0,l("expired")},r);if(oe.set(c,u),c.addEventListener("load",function(){clearTimeout(s),u.state="loaded",l("loaded")}),c.addEventListener("error",function(){clearTimeout(s),u.state="failed",l("failed")}),!i){var f=!0,p=!1,_=void 0;try{for(var d,y=Object.entries(n)[Symbol.iterator]();!(f=(d=y.next()).done);f=!0){var v=_sliced_to_array(d.value,2),b=v[0],g=v[1];c.setAttribute(b,g)}}catch(e){p=!0,_=e}finally{try{f||null==y.return||y.return()}finally{if(p)throw _}}c.src=t,c.async=!0,c.setAttribute(ne,""),e.head.appendChild(c)}return u}(a,e,function(e){return"number"==typeof e&&e>0?e:1e4}(i.timeout),null!=(n=i.attributes)?n:{},function(){return null!=t()})}var u=function(){var e=t();return null==e?Promise.reject(new $("Vendor not ready: its global is missing",{code:"vendor-not-ready"})):Promise.resolve(e)};return{ready:function(){return o?"failed"===o.state?Promise.reject(ie()):"loaded"===o.state||o.expired?u():new Promise(function(e,t){o.waiting.push(function(r){var n;"failed"===r?t(ie()):"expired"===r?t((n=o.timeout,new $("Vendor script did not load within ".concat(n,"ms"),{code:"vendor-timeout"}))):u().then(e,t)})}):u()},check:function(){if("failed"===(null==o?void 0:o.state))throw ie()}}},A=function(e){var t=E(e).window.pintrk;if(!t)throw new $("Pinterest Tag not ready: pintrk is missing",{code:"vendor-not-ready"});return t},D=function(e,t){return R(!1!==e.loadScript?ue:void 0,function(){return E(t).window.pintrk},{timeout:e.timeout,document:E(t).document})},I=function(e,t,r){return _async_to_generator(function(){var n,o,i,a;return _ts_generator(this,function(u){switch(u.label){case 0:return null==t?[2,void 0]:[4,m(e,t,{collector:r})];case 1:return n=u.sent(),l(n)?(o={},i=n.em,a=n.external_id,s(i)&&i&&(o.em=i),s(a)&&a&&(o.external_id=a),[2,Object.keys(o).length>0?o:void 0]):[2,void 0]}})})()},K=Object.defineProperty,T=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyNames,M=Object.prototype.hasOwnProperty,N=function(e,t,r){return function(e,t,r){return t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r}(e,"symbol"!==(void 0===t?"undefined":_type_of(t))?t+"":t,r)},V={};!function(e,t){for(var r in t)K(e,r,{get:t[r],enumerable:!0})}(V,{DestinationPinterest:function(){return ae},default:function(){return le},destinationPinterest:function(){return ce}});var W=Object.defineProperty,L=function(e,t){for(var r in t)W(e,r,{get:t[r],enumerable:!0})};L({},{stepId:function(){return e}});L({},{getDestination:function(){return t}});L({},{Level:function(){return B}});var q,B=((q=B||{})[q.ERROR=0]="ERROR",q[q.WARN=1]="WARN",q[q.INFO=2]="INFO",q[q.DEBUG=3]="DEBUG",q);L({},{getTransformer:function(){return r}});L({},{getSource:function(){return n}});L({},{getStore:function(){return o},getStoreValue:function(){return i}});var z="\\$flow\\.(".concat("[a-zA-Z_][a-zA-Z0-9_-]*",")(?:\\.([a-zA-Z0-9_.]+))?");new RegExp("^".concat(z,"$")),new RegExp(z,"g");function F(e){for(var t=arguments.length>2?arguments[2]:void 0,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split("."),n=e,o=0;o<r.length;o++){var i=r[o];if("*"===i&&a(n)){var c=r.slice(o+1).join("."),s=[],f=!0,p=!1,_=void 0;try{for(var d,y=n[Symbol.iterator]();!(f=(d=y.next()).done);f=!0){var v=F(d.value,c,t);s.push(v)}}catch(e){p=!0,_=e}finally{try{f||null==y.return||y.return()}finally{if(p)throw _}}return s}if(void 0===(n=l(n)||a(n)?n[i]:void 0))break}return u(n)?n:t}function C(e){return function(e){return"boolean"==typeof e}(e)||s(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!u(e)||a(e)&&e.every(C)||l(e)&&Object.values(e).every(C)}var U=function(){function e(t,r){var n;return _class_call_check(this,e),(n=_call_super(this,e,[t])).name="FatalError",r&&"cause"in r&&d(n,r.cause),Object.setPrototypeOf(n,e.prototype),n}return _inherits(e,_wrap_native_super(Error)),e}(),Z=["transport","timeout","breaker-open","blocked","queue-full","vendor-not-ready","vendor-timeout"],$=function(e){function t(e,r){var n;return _class_call_check(this,t),n=_call_super(this,t,[e]),N(n,"code"),N(n,"status"),N(n,"retryable"),N(n,"body"),void 0!==r.cause&&d(n,r.cause),n.name="StepError",n.code=r.code,void 0!==r.status&&(n.status=r.status),n.retryable=function(e){if(void 0!==e.retryable)return e.retryable;var t=e.status;if(void 0!==t){if(429===t||t>=500&&t<600)return!0;if(t>=400&&t<500)return!1}return Z.includes(e.code)}(r),void 0!==r.body&&(n.body=r.body),Object.setPrototypeOf(n,(_instanceof(this,t)?this.constructor:void 0).prototype),n}return _inherits(t,e),t}(_wrap_native_super(Error)),H=["type","mappingKey"],J=["count","suppressed"],Q=["condition","consent","fn","key","loop","map","set","validate","value"];function X(e,t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(o){return[2,(a(t)?t:[t]).reduce(function(t,o){return _async_to_generator(function(){var i,c,l,d,y,v,b,m,w,j,O,P,S,k,x,E,R,A,D,I,K,T,G,M,N;return _ts_generator(this,function(V){switch(V.label){case 0:return[4,t];case 1:return(i=V.sent())?[2,i]:(c=s(o)?{key:o}:o,Object.keys(c).length?Q.some(function(e){return e in c})?(l=c.condition,d=c.consent,y=c.fn,v=c.key,b=c.loop,m=c.map,w=c.set,j=c.validate,O=c.value,P=_object_spread_props(_object_spread({},r),{mapping:o}),(S=l)?[4,_(l,function(e){if(_instanceof(e,U))throw e;return g(P,n,"mapping condition failed",e),!1})(e,P)]:[3,3]):[2,void g(_object_spread_props(_object_spread({},r),{mapping:o}),n,"mapping value has no operator (".concat(Object.keys(c).join(", "),"): wrap the fields in map, or use key, value, fn, loop or set"))]:[2]);case 2:S=!V.sent(),V.label=3;case 3:return S?[2]:d&&!f(d,P.consent)?[2,O]:(k=u(O)?O:e,b?(x=_sliced_to_array(b,2),E=x[0],R=x[1],"this"!==E?[3,4]:(D=[e],[3,6])):[3,10]);case 4:return[4,h(e,E,P,n)];case 5:D=V.sent(),V.label=6;case 6:return a(A=D)?[4,Promise.all(A.map(function(e){return u(e)?h(e,R,P,n):void 0}))]:[3,8];case 7:return I=V.sent().filter(u),[3,9];case 8:I=void 0,V.label=9;case 9:return k=I,[3,21];case 10:return m?[4,Object.entries(m).reduce(function(t,r){var o=_sliced_to_array(r,2),i=o[0],a=o[1];return _async_to_generator(function(){var r,o;return _ts_generator(this,function(c){switch(c.label){case 0:return[4,t];case 1:return r=c.sent(),[4,h(e,a,P,n)];case 2:return o=c.sent(),[2,(u(o)&&(r[i]=o),r)]}})})()},Promise.resolve({}))]:[3,12];case 11:return k=V.sent(),[3,20];case 12:return w?[4,Promise.all(w.map(function(t){return X(e,t,P,n)}))]:[3,14];case 13:return K=k=V.sent(),[3,19];case 14:return v?(T=k=F(e,v,O),[3,18]):[3,15];case 15:return(G=y)?[4,_(y,function(e){if(_instanceof(e,U))throw e;g(P,n,"mapping fn failed",e)})(e,P)]:[3,17];case 16:G=k=V.sent(),V.label=17;case 17:T=G,V.label=18;case 18:K=T,V.label=19;case 19:V.label=20;case 20:V.label=21;case 21:return(M=j)?[4,_(j,function(e){if(_instanceof(e,U))throw e;return g(P,n,"mapping validate failed",e),!1})(k,P)]:[3,23];case 22:M=!V.sent(),V.label=23;case 23:return M&&(k=void 0),N=p(k),[2,u(N)?N:p(O)]}})})()},Promise.resolve(void 0))]})})()}var Y,ee="observe",te="call:",re=["name","length","prototype","arguments","caller"],ne="data-walkeros-vendor",oe=new WeakMap,ie=function(){return new $("Vendor script failed to load",{code:"vendor-not-loaded"})},ae={},ue="https://s.pinimg.com/ct/core.js",ce={type:"pinterest",config:{},init:function(e){return _async_to_generator(function(e){var t,r,n,o,i,a;return _ts_generator(this,function(u){switch(u.label){case 0:if(t=e.config,r=e.env,!(n=_object_spread({},t.settings)).apiKey)throw new $("Pinterest needs settings.apiKey",{code:"config"});return o=n.apiKey,i=!1!==n.pageview,function(e){var t=E(e).window;if(!t.pintrk){var r=Object.assign(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o;null===(o=r.queue)||void 0===o||o.push(t)},{queue:[],version:"3.0"});t.pintrk=r}}(r),D(t,r),a=A(r),[4,y(function(){return a("load",o)},"vendor-not-ready","Pinterest load call failed")];case 1:return u.sent(),i?[4,y(function(){return a("page")},"vendor-not-ready","Pinterest page call failed")]:[3,3];case 2:u.sent(),u.label=3;case 3:return[2,_object_spread_props(_object_spread({},t),{settings:_object_spread_props(_object_spread({},n),{_state:{lastIdentify:void 0,consentGranted:!0}})})]}})}).apply(this,arguments)},push:function(e,t){return _async_to_generator(function(e,t){var r,n,o,i,a,u,c,f,p,_,d,v,b,g,h,m;return _ts_generator(this,function(w){switch(w.label){case 0:return r=t.config,n=t.rule,o=t.data,i=t.env,a=t.collector,u=t.logger,D(r,i).check(),c=r.settings||{},f=c._state||(c._state={consentGranted:!0}),p=A(i),!1===f.consentGranted?[3,6]:(v=null!==(_=null==n||null===(d=n.settings)||void 0===d?void 0:d.identify)&&void 0!==_?_:c.identify,[4,I(e,v,a)]);case 1:return(b=w.sent())?[3,2]:(void 0!==v&&function(e,t,r,n){e.debug("Pinterest skipped ".concat(r,": ").concat(n," resolved to nothing"),{event:t.name})}(u,e,"set","identify"),[3,4]);case 2:return j=b,O=f.lastIdentify,!j&&!O||j&&O&&j.em===O.em&&j.external_id===O.external_id?[3,4]:[4,y(function(){return p("set",b)},"transport","Pinterest set call failed")];case 3:w.sent(),f.lastIdentify=b,w.label=4;case 4:return!0===(null==n?void 0:n.silent)?[3,6]:(g=s(null==n?void 0:n.name)?n.name:e.name,h=l(o)?o:{},m=_object_spread({},e.id?{event_id:e.id}:{},h),[4,y(function(){return p("track",g,m)},"transport","Pinterest track call failed")]);case 5:w.sent(),w.label=6;case 6:return[2]}var j,O})}).apply(this,arguments)},on:function(e,t){var r=t.config,n=t.data,o=t.collector,i=r.consent;if("consent"===e&&i&&l(n)&&Object.keys(i).some(function(e){return e in n})){var a=r.settings;if(l(a))(l(a._state)?a._state:a._state={consentGranted:!0}).consentGranted=!1!==f(i,o.consent)}}},le=ce;return Y=V,function(e,t,r,n){if(t&&"object"===(void 0===t?"undefined":_type_of(t))||"function"==typeof t){var o=!0,i=!1,a=void 0;try{for(var u,c=function(){var o=u.value;M.call(e,o)||o===r||K(e,o,{get:function(){return t[o]},enumerable:!(n=T(t,o))||n.enumerable})},l=G(t)[Symbol.iterator]();!(o=(u=l.next()).done);o=!0)c()}catch(e){i=!0,a=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw a}}}return e}(K({},"__esModule",{value:!0}),Y)}();
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-destination-pinterest",
|
|
4
|
-
"version": "4.9.0
|
|
4
|
+
"version": "4.9.0",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"web"
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"trigger": "load",
|
|
131
131
|
"entity": "page",
|
|
132
132
|
"action": "view",
|
|
133
|
-
"timestamp":
|
|
133
|
+
"timestamp": 1700000100000,
|
|
134
134
|
"timing": 3.14,
|
|
135
135
|
"source": {
|
|
136
136
|
"count": 1,
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"trigger": "test",
|
|
192
192
|
"entity": "user",
|
|
193
193
|
"action": "update",
|
|
194
|
-
"timestamp":
|
|
194
|
+
"timestamp": 1700000108000,
|
|
195
195
|
"timing": 3.14,
|
|
196
196
|
"source": {
|
|
197
197
|
"count": 1,
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
"trigger": "load",
|
|
329
329
|
"entity": "order",
|
|
330
330
|
"action": "complete",
|
|
331
|
-
"timestamp":
|
|
331
|
+
"timestamp": 1700000106000,
|
|
332
332
|
"timing": 3.14,
|
|
333
333
|
"source": {
|
|
334
334
|
"count": 1,
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
"trigger": "load",
|
|
442
442
|
"entity": "page",
|
|
443
443
|
"action": "view",
|
|
444
|
-
"timestamp":
|
|
444
|
+
"timestamp": 1700000102000,
|
|
445
445
|
"timing": 3.14,
|
|
446
446
|
"source": {
|
|
447
447
|
"count": 1,
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
"trigger": "click",
|
|
504
504
|
"entity": "product",
|
|
505
505
|
"action": "add",
|
|
506
|
-
"timestamp":
|
|
506
|
+
"timestamp": 1700000105000,
|
|
507
507
|
"timing": 3.14,
|
|
508
508
|
"source": {
|
|
509
509
|
"count": 1,
|
|
@@ -601,7 +601,7 @@
|
|
|
601
601
|
"trigger": "load",
|
|
602
602
|
"entity": "product",
|
|
603
603
|
"action": "view",
|
|
604
|
-
"timestamp":
|
|
604
|
+
"timestamp": 1700000104000,
|
|
605
605
|
"timing": 3.14,
|
|
606
606
|
"source": {
|
|
607
607
|
"count": 1,
|
|
@@ -696,11 +696,11 @@
|
|
|
696
696
|
"consent": {
|
|
697
697
|
"functional": true
|
|
698
698
|
},
|
|
699
|
-
"id": "
|
|
699
|
+
"id": "28e7cb498b2b656e",
|
|
700
700
|
"trigger": "test",
|
|
701
701
|
"entity": "page",
|
|
702
702
|
"action": "view",
|
|
703
|
-
"timestamp":
|
|
703
|
+
"timestamp": 1700000109000,
|
|
704
704
|
"timing": 3.14,
|
|
705
705
|
"source": {
|
|
706
706
|
"count": 1,
|
|
@@ -754,7 +754,7 @@
|
|
|
754
754
|
"trigger": "test",
|
|
755
755
|
"entity": "search",
|
|
756
756
|
"action": "submit",
|
|
757
|
-
"timestamp":
|
|
757
|
+
"timestamp": 1700000103000,
|
|
758
758
|
"timing": 3.14,
|
|
759
759
|
"source": {
|
|
760
760
|
"count": 1,
|
|
@@ -824,7 +824,7 @@
|
|
|
824
824
|
"trigger": "test",
|
|
825
825
|
"entity": "user",
|
|
826
826
|
"action": "login",
|
|
827
|
-
"timestamp":
|
|
827
|
+
"timestamp": 1700000107000,
|
|
828
828
|
"timing": 3.14,
|
|
829
829
|
"source": {
|
|
830
830
|
"count": 1,
|
|
@@ -913,11 +913,11 @@
|
|
|
913
913
|
"consent": {
|
|
914
914
|
"functional": true
|
|
915
915
|
},
|
|
916
|
-
"id": "
|
|
916
|
+
"id": "9cf080ccff2dc52f",
|
|
917
917
|
"trigger": "test",
|
|
918
918
|
"entity": "debug",
|
|
919
919
|
"action": "noise",
|
|
920
|
-
"timestamp":
|
|
920
|
+
"timestamp": 1700000101000,
|
|
921
921
|
"timing": 3.14,
|
|
922
922
|
"source": {
|
|
923
923
|
"count": 1,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-pinterest",
|
|
3
3
|
"description": "Pinterest Tag web destination for walkerOS (conversion tracking, enhanced matching, audience building)",
|
|
4
|
-
"version": "4.9.0
|
|
4
|
+
"version": "4.9.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"update": "npx npm-check-updates -u && npm update"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@walkeros/core": "4.9.0
|
|
42
|
-
"@walkeros/web-core": "4.9.0
|
|
41
|
+
"@walkeros/core": "4.9.0",
|
|
42
|
+
"@walkeros/web-core": "4.9.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@walkeros/collector": "4.9.0
|
|
45
|
+
"@walkeros/collector": "4.9.0"
|
|
46
46
|
},
|
|
47
47
|
"repository": {
|
|
48
48
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|